Video Compression

VideoNerd

MPEG System standard (13818) allows packet to be duplicated, it says:

“In transport streams, duplicate packets may be sent as two, and only two, consecutive transport stream packets of the same PID. The duplicate packets shall have the same continuity_counter value

as the original packet and the adaptation_field_control field shall be equal to ’01’ or ’11’. In duplicate packets each byte of the original packet shall be duplicated, with the exception that in the program clock reference fields,

if present, a valid value shall be encoded.”

So, what’s a reason to duplicate packets? i think to enhance error resilience. Not all packets should be duplicated, for example packets carrying important information like SPS/PPS headers are worth to be  repeated, because in case of bit-stream error the whole GOP (or even video sequence) gets invalidated. Many players (e.g. VLC, ffplay and Pot players) don’t discard duplicated packets if they are present in transport stream. Consequently, video is played corrupted.

For example, if a duplicated packet contains only SPS/PPS then the output elementary stream would contains a pair of SPS/PPS (not error). However, if the duplicated packet contains SPS/PPS and the start of the slice header

then the output stream is a mess (non-parseable).

Therefore it’s worth to detect and remove duplicated packets before playing back the stream. How to detect duplicated ts-packets?

If  two successive packets with the same PID and continuity_counter are sensed then the following check is executed: 

       Compare content of these two packets excluding PCR field  if it present.

       if they are “identical” then remove one of them

 

17 Responses

  1. Thank you a lot for giving everyone remarkably terrific possiblity to check tips from here. It’s always very terrific plus packed with a good time for me and my office mates to visit the blog at the very least three times in a week to see the new guidance you will have. Not to mention, we’re usually pleased concerning the stunning methods served by you. Some 2 facts in this post are clearly the very best I have had.

  2. Good write-up, I’m regular visitor of one’s website, maintain up the excellent operate, and It’s going to be a regular visitor for a long time.

  3. Hello, Neat post. There’s an issue together with your web site in internet explorer, might check this?K IE still is the market chief and a large element of people will leave out your wonderful writing due to this problem.

  4. Excellent read, I just passed this onto a colleague who was doing some research on that. And he just bought me lunch as I found it for him smile So let me rephrase that: Thank you for lunch!

  5. Just want to say your article is as amazing. The clarity in your post is just nice and i can assume you are an expert on this subject. Fine with your permission allow me to grab your feed to keep up to date with forthcoming post. Thanks a million and please keep up the gratifying work.

  6. Hello! I could have sworn I’ve been to this blog before but after browsing through some of the post I realized it’s new to me. Anyways, I’m definitely happy I found it and I’ll be book-marking and checking back frequently!

  7. Does your site have a contact page? I’m having a tough time locating it but, I’d like to send you an e-mail. I’ve got some creative ideas for your blog you might be interested in hearing. Either way, great blog and I look forward to seeing it develop over time.

Leave a Reply

Your email address will not be published. Required fields are marked *