MPEG2 TS block parity check and error correction

Archive of historical feature requests.
Please use the GitHub link above to report issues.
Forum rules
*******************************
Please be aware we are now using GitHub for issue tracking and feature requests.
- This section of the forum is now closed to new topics.

*******************************
Post Reply
Elan
Posts: 35
Joined: Wed Jan 30, 2008 6:32 am

MPEG2 TS block parity check and error correction

Post by Elan »

Handbrake is awesome but one important feature is missing. It would be great if you can include a block parity check and error correction for bad blocks in mpeg-2 stream as you already fix discontinuity issue.

Using firewire I can capture the raw stream including all the encoding and transmitting errors inside it. My PVR correct these errors because the picture is perfect when I use the HDMI input. I can't even tell there is blocks errors and where they are but when I switch my TV to the FireWire input and replay it I see them.

Here is a screenshot :
Image

If it was only a bad frame, I could delete it but it's always short sequences of about 5 to 15 frames. Some recording are clean but most have some (3 to 12) and others have too much. That's hard to figure how the cable box can perfectly correct that make me believe all the required info to correct them are already in the stream.

At first I think it was an issue with the Hard Drive so I changed it. Then I notice the errors blocks are alway at the same place in a specific recording (not an issue with playback). They even are at the same place if I record the same movie/episode next time it air (not an issue with recording). It seems to be something common because in the diagnostic menu from my SA8300HD the is a section with "corr blks" and "uncorr blks".

Yesterday I was googling about that when I find something on VideoHelp about a similar issue with DV cam stream. Playback on the camcorder is okay but the stream is not. http://forum.videohelp.com/threads/3025 ... aulty-head

If my cable box or some camcorders can correct them I guess the is a way to include that feature inside Handbrake. You guys should probably know where to find technical documentation or maybe Van have a hint or know something about that.

To help you, I can provide some shorts stream with that issue.
User avatar
JohnAStebbins
HandBrake Team
Posts: 5725
Joined: Sat Feb 09, 2008 7:21 pm

Re: MPEG2 TS block parity check and error correction

Post by JohnAStebbins »

My bet would be that the errors are somehow caused by the firewire connection and are not in the stream before going out the firewire. There is no error correction information contained in the TS stream. This type of information is usually carried in a layer above the TS stream and is used and removed before the data gets to the demux in the hardware.

One possibility is that the 'raw' data that is going to the firewire isn't a pure TS stream and contains some additional information that is causing software and devices that expect TS to choke. The only way to compensate for this kind of problem would be to have the specifications for the format being used and write a special filter for it.

The thread you linked to mostly discusses error concealment which is much different than error correction. And as one poster in the thread says, error concealment is almost never done by software decoders.
Elan
Posts: 35
Joined: Wed Jan 30, 2008 6:32 am

Re: MPEG2 TS block parity check and error correction

Post by Elan »

Ok, but what about something like this?

Mpeg-2 Error Concealment based on block matching principee
User avatar
JohnAStebbins
HandBrake Team
Posts: 5725
Joined: Sat Feb 09, 2008 7:21 pm

Re: MPEG2 TS block parity check and error correction

Post by JohnAStebbins »

Error concealment is a task for the decoder, and as I said, very few software based decoders do this. HandBrake relies on other open source decoders to do it's work. So this is really a request for those other projects.

Given the screenshot you posted, I doubt error concealment would help much anyway. Error concealment just replaces bad blocks with blocks from previous images. It's ok for an occasional small error but it still leaves visible artefacts whereever the error was because it is not correcting errors.
Post Reply