Can ffmpeg extract EIA-708 subtitles
- User
Can ffmpeg extract EIA-708 subtitles
Assistant
Yes, ffmpeg can extract EIA-708 (CEA-708) closed captions from video files. The process involves using the "lavfi" filter to treat the closed captions as a separate stream, which can then be extracted. Here's a command that can be used to extract EIA-708 closed captions:forum.videohelp+2 bash ffmpeg -f lavfi -i "movie=input.ts[out0+subcc]" -map 0:s output.srt This command works as follows: The -f lavfi option specifies the use of the input virtual device. The movie=input.ts[out0+subcc] part loads the input file and forces ffmpeg to treat closed captions as a separate stream. The -map 0:s option maps only the subtitle stream to the output. The output is saved as an SRT file. It's important to note that this feature is relatively recent in ffmpeg, so you may need to ensure you're using an up-to-date version. Additionally, the input file format may need to be MPEG-TS (.ts) for the lavfi filter to work correctly with closed captions.stackoverflow If you're dealing with multiple subtitle streams, you may need to adjust the mapping. You can use ffprobe to identify the correct stream index for the closed captions.stackoverflow Share Export
- User
I have an mp4 file with EIA-608 and EIA-708 subtitle tracks. How do I export one or both to .srt files? I have ffmpeg.
Assistant
To extract EIA-608 and EIA-708 subtitle tracks from an MP4 file using ffmpeg, you can use the following commands: For EIA-608: bash ffmpeg -f lavfi -i "movie=input.mp4[out0+subcc]" -map 0:s:0 output_608.srt For EIA-708: bash ffmpeg -f lavfi -i "movie=input.mp4[out0+subcc]" -map 0:s:1 output_708.srt Here's how these commands work: The -f lavfi option specifies the use of the input virtual The movie=input.mp4[out0+subcc] part loads the input file and forces ffmpeg to treat closed captions as separate streams.forum.videohelp The -map 0:s:0 (for EIA-608) or -map 0:s:1 (for EIA-708) option maps the respective subtitle stream to the output.reddit+1 The output is saved as an SRT file. If you're unsure which stream index corresponds to which subtitle format, you can first run: bash ffprobe input.mp4 This will list all streams in the file, including subtitle tracks. Look for streams labeled as "Subtitle: eia_608" or "Subtitle: eia_708" and note their index numbers.stackoverflow If you encounter any issues, ensure you have a recent version of ffmpeg installed, as support for these features has been added relatively recently.reddit+1 Share Export