View Full Version : Inserting SEI
ipanema
6th May 2011, 19:16
I'm thinking of adding a user-defined SEI to existing H.264/MTS files. It should be possible by inserting occasional MTS packets to hold the inserted data, and any existing data that would need to be moved to make room for the inserted data.
But this would progressively shift existing packets forward in the file.
Would this be likely to break any indexes that might be present in the other files that are present in the Blu-ray and AVCHD folder structure?
Or is there a better method of inserting data int existing H.264/MTS files?
kieranrk
6th May 2011, 19:18
It would break the VBV. It would also be pretty unlikely that you'd find a TS packet on exactly the right boundary to insert an SEI.
ipanema
6th May 2011, 19:28
Thanks for the quick response. I expected it would be problematic. In theory I think it should be possible to insert data with byte accuracy by resizing the preceding packet payload size, and moving the rest of the data into the inserted packet after the new data.
Is there any way to insert data without breaking anything?
I just noticed that tsmuxer seems to have a feature which inserts SEIs to existing files but I haven't looked at how it does this, or whether it ignores any indexing problems that may be caused by this.
kieranrk
6th May 2011, 20:08
Yes, you can extract the PES, add your SEI and put the PES back into TS packets.
ipanema
7th May 2011, 12:52
you can extract the PES, add your SEI and put the PES back into TS packets.
If I did that would it upset the integrity of the video stream at all - you mentioned breaking the VBV for example? (I guess the bitrate of the video stream would be very slightly greater.)
As regards any indexes that may be present in other auxilliary Blu-ray/AVCHD files, I'm assuming that any repackaging of the PES packets would break these indexes.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.