2

I just started working for a new company and my new role demands that I help debug the video corruption that they are receiving through decoding frames. As much as I intend on digging down deep into the code and looking into the specifics of my problem, it made me think about video debugging in general.

Since handling videos is very new to me, the whole process seems pretty complex and it seems there are a lot of places for corruption to present itself. The way I see it there is at least three places where corruption could pop up (barring memory corruption from the machine):

  • Transporting the data before it is decoded
  • decoding implementation that perpetuates corruption once it is encountered, or is all together incorrect (Which seems to be my problem)
  • Transportation to the monitor(which seems unlikely but possible)

So what i'm really curious about is if/how people debug their video streams to determine the location of any potential corruption they are encountering. I'm sure there is no sure fire method but I am curious to see what problems are even possible and how they can be identified and triaged.

P.S. - I'm not sure of the differences between different decoding methods but, if this question seems too vague maybe it helps to mention I am using ffmpeg and avcodec_decode_video2 for the decoding.

CoderDake
  • 1,497
  • 2
  • 15
  • 30
  • If you are using established tools as ffmpeg then the chance of incorrect decoding is very low. Also, it is not uncommon that standard codecs "perpetuate" errors to the following frames. What codecs are you using? The first place where I would look for data corruption is the transport channel, particularly if it is wireless. Are you working with some specific scenario (e.g. tactic networks with unreliable wireless signals)? Of course, you need to check that the video is encoded correctly before being transmitted. Try do decode it before transmission and see if the corruption is still present. – elnigno Sep 17 '13 at 12:16
  • I believe the code in question is H264. I have also done testing on the encoding using a reliable decoding software, this software is able to decode the images perfectly. So at least I know it is limited to the decoding implementation. – CoderDake Sep 17 '13 at 14:37
  • Ok, if this is the case then what kind of distortion do you see? Does it appear only in some cases or is it general? Is the encoding lossy or lossless? – elnigno Sep 18 '13 at 08:23
  • It is just a bunch of garbled shapes and colors that take the shape of what the video feed is. As for the encoding I'm pretty sure it is lossless, but then again I have only been digging into the decoding side of things. I asked another question about what I hypothesize the corruption could be coming from. It might be a stretch but it seems to have some merit http://stackoverflow.com/questions/18857365/avcodec-decode-video2-what-do-the-extra-bytes-prevent/18857540#18857540 – CoderDake Sep 18 '13 at 11:19
  • 2
    Can you try also different encoding settings? This could help finding what's specifically wrong in the decoding. – elnigno Sep 18 '13 at 11:24

0 Answers0