Getting bad satellite recordings in TVHeadEnd? Here’s a possible fix

I was perusing the TBS forum recently and discovered that there’s a problem that can occur, notably with certain TBS cards but possibly with others as well, that can result in semi-corrupted recordings. The .ts file that contains the recording actually contains the entire program, and can usually be repaired by chopping off a few megabytes at the start of the file, but as it sits on the TVHeadEnd server it’s not easily playable for one or both of two reasons:

  • It reports the wrong length (time) for the recoding – for example a one hour program may appear to be of a much greater length (several hours long), and/or
  • The video and audio are out of sync by a second or two, where this is not usually the case.

In Kodi, you can generally play such a recording from the start, but skipping around within the program may be problematic or impossible.

The possible fix for this is to set a “Skip Initial Bytes” setting for each tuner, as described in this post on the TBS forum.  The conversation there appears to be about a specific TBS card (the TBS6905) but I have heard of this problem happening with other cards as well.  As best I can understand the problem, the card starts sending a virtual firehose stream of data before the buffers are ready to receive it, and some data gets lost at the start, corrupting the file.  By skipping some initial bytes, you get only the “good” data once everything has had time to initialize.  That’s probably a gross oversimplification, but that’s what I got out of that thread.

The place to change the setting is here:

Configuration | DVB Inputs | TV adapters, in the "Advanced Settings" section

Configuration | DVB Inputs | TV adapters, in the “Advanced Settings” section

You might think the number of bytes skipped is quite high, but since even a 30 minute recording can contain several gigabytes of data, that number is actually insignificant.  The original poster in the thread states that “The 18800000 setting is a bit arbitrary; I chose it because it is more than 1 Meg and is the ‘Input Buffer (Bytes)’ value x 1000. If the issue persists I may try an even higher value.”  Feel free to experiment with lower or higher values; I personally think I’d start with something lower such as 188000 (10 times the Input Buffer) and then if that doesn’t resolve the issue, go up to 1880000. And if that still doesn’t always fix the problem, then go to the 18800000 value.  But, it’s entirely up to you.  And remember that if you have more than one tuner, you have to add this setting for each affected tuner.

The thread also notes, “If the new value doesn’t appear after you change it and click save, refresh the page in your browser, then navigate back to the TV adapters tab.”

If TVHeadEnd is creating these types of bad recordings on your backend server, I’d suggest this fix is at least worth a try, since you can easily reverse it if it turns out to not have any effect.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s