[Libav-user] Add MPEG-2 user data or H.264 SEI metadata while remuxing

jettoblack jettoblack at gmail.com
Thu May 3 19:24:06 CEST 2012

Deepika wrote
> Hi,
> I am looking for this too. Any leads?
> Regards,
> Deepika

Hi Deepika,
I've got the basic idea of it working now.

For MPEG-2 Video it is relatively simple as you can just append the user
data structure to the end of the frame data.  It looks like: 0x000001b2
[user data] 0x000001

For H.264 you must construct a NAL type 6 containing a SEI message:
0x00000106 [SEI message starting with payload type] 0x00 [payload size] 0x80

This gets inserted into the packet after any other SEI messages but before
the first video slice, so you have to parse the NALs in the frame data to
find the insertion point.

Hope this helps,

View this message in context: http://libav-users.943685.n4.nabble.com/Add-MPEG-2-user-data-or-H-264-SEI-metadata-while-remuxing-tp4530217p4606610.html
Sent from the libav-users mailing list archive at Nabble.com.

More information about the Libav-user mailing list