[FFmpeg-devel] Adding MPEG user data on encode.

Daniel Kristjansson danielk
Wed Dec 16 18:00:56 CET 2009

I'm adding MPEG user data encoding to ffmpeg for my own app, but
I'd like to do it in a way that allows it to be integrated upstream.

The basic approach I'm planning to take is to add these to
    uint8_t *userdata;
    int userdata_size;

Where userdata is set to NULL when not used and points to a
buffer containing MPEG user data when not NULL and userdata_size
is set to a positive number of bytes. Then MPV_encode_picture
picks this up and inserts the user data on the encoded frames,
but with the smarts to delay CEA-708 data until the next I or
P frame since that spec doesn't specify whether the CEA-708
user data should be in DTS or PTS order.

In the future I can see this being extended for decode as well.
Right now mpeg_decode_user_data only decodes DTG1 data, but the
MythTV fork also decodes DVB CC, ATSC CEA-708 & CEA-608 and
CEA-608 in DVB; but in a way that is not likely to be accepted
into ffmpeg proper.


-- Daniel

More information about the ffmpeg-devel mailing list