[FFmpeg-devel] [RFC] QuickTime CC mux support

Jason Livingston jason at cpcweb.com
Fri Oct 19 03:46:19 CEST 2012

I'd like to get some comments on this approach to enable ffmpeg to mux/copy QuickTime closed captions tracks.

E.g. be able to:
ffmpeg -i source-with-qtcc.mov -map 0 -codec:s copy output-with-qtcc.mov

I have already implemented code that works but wanted to get some comments before I submit a patch.

What I did was:

1) Implement the already defined subtitle codec AV_CODEC_ID_EIA_608 with a dummy encoder/decoder.  (These don't decode the data to AVSubtitle or encode AVSubtitles into CC data, but they are needed so the codec can be opened.)

2) Modify movenc.c so it can write the required track header and metadata

The resulting file can be successfully played with CC in QuickTime Player (Win/Mac/iOS).  VLC does not support this type of CC yet.

Now my question is how best to handle the packet data.  The QuickTime closed caption packets contain some extra QuickTime specific atoms that are not used in CC tracks for other container formats.  If I leave the packets as-is, then no big changes are needed in mov.c or movenc.c, but these packets will only work in QuickTime containers.

The other approach is for mov.c to strip out the QuickTime specific stuff, so the demuxed packets contain only the raw CC data, and have movenc.c put the necessary atoms back in when muxing.  If there are any existing programs out there that handle the raw packets and expect the QuickTime atoms to be there, this change will break them.

Which approach is preferred?  Thanks.

More information about the ffmpeg-devel mailing list