[FFmpeg-user] Copying a EIA-608 subtitle stream in an m4v

Ted Park kumowoon1025 at gmail.com
Fri Mar 27 04:49:29 EET 2020


> I'm trying to process an m4v video with the following subtitle stream:
>    Stream #0:3(eng): Subtitle: eia_608 (c608 / 0x38303663), 1920x1080, 0 kb/s (default)
>    Metadata:
>      creation_time   : 2014-03-29T03:43:15.000000Z
>      handler_name    : Apple Closed Caption Media Handler
> When I play the video in QuickTime Player, the subtitles are available for selection and display properly.

Keep in mind closed captions and subtitles have subtle differences, though it seems more like a subtitle in formats like these, where the captions are carried as a separate stream, they are still captions, not text or bitmap subtitles.

> If I copy the stream, I get an error:

> [ipod @ 0x7f8074810600] Could not find tag for codec eia_608 in stream #0, codec not currently supported in container
> Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument

> (I also tried with extension mp4, behavior is the same.)

Try with extension mov, and/or -strict -2.

> If I transcode the stream, I get a number of errors, and the resulting subtitles are garbage:

>  Stream #0:3 -> #0:0 (eia_608 (cc_dec) -> mov_text (native))

> [Closed caption Decoder @ 0x7fb894079800] Data Ignored since exceeding screen width
>    Last message repeated 1529 times
> size=       2kB time=00:07:20.53 bitrate=   0.0kbits/s speed=1.2e+04x    
> video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 2963.333252%
> ~~~~~
> (To test the output, I used a slightly different invocation, copying the video/audio streams, and played the file in QuickTime Player. Subtitles are gibberish.)
> How can I get ffmpeg to play nicely with these subtitles?

I think this might be a bug? I didn’t think the captions decoder could decode in a way that direct conversion like cea-708 -> text subtitles was possible, I think it should be saying that and not do this. The gibberish is like if you used cat on a compiled executable I bet.

> Suggestions:
> - Is there an option to override the "codec not currently supported" error? Can't ffmpeg just copy the bits and ignore the content?
> - Is there another path/tool for transcoding the eia_608 subtitle stream correctly?
> - All I really want at the moment is to strip a "cover art" image appearing as stream 0:4. Is there another way to accomplish that?
- codec not currently supported _in container_ so you can dump the data or use a format that works. Usually broadcast captioning is done with scenarist .scc
- Builds with libzvbi support can extract teletext pages to side data, then you can assemble the subtitle track from that I think. Transcoding is tricky because eia_608 is not just text, or even multiple pages of text, it is comparable to the machine language used in dvd subtitles.
- Try mapping all input, negative mapping the stream you don’t want, and stream copying into QuickTime (.mov). -strict -2 might be needed.

Ted Park

More information about the ffmpeg-user mailing list