Can ffmpeg retrieve private header data

I am currently using ffmpeg to convert videos in various formats to FLV files. A request also appeared, which should also receive information about closing the file header. Does anyone have any experience with this or know that this can be done. I do not see any options for this, but thought that I would ask and see.

+11
ffmpeg
source share
7 answers

If someone, like me, falls into this thread, here is a slightly more detailed explanation in the ffmpeg command that worked for me.

 ffmpeg -f lavfi -i movie=input.ts[out+subcc] -map 0:1 output.srt 

It looks like the original data source has the mpegts format ( .ts file .ts ). Otherwise, the lavfi filter lavfi not work. The out+subcc causes ffmpeg to process closed captions (which are embedded in the frame data) as a separate stream. Later -map 0:1 does ffmpeg only displays this stream and discards everything else. The result is saved until output.srt . The display may vary depending on your input. One easy way to detect a closed signature display is to run the ffprobe command, for example

 $ ffprobe -f lavfi -i movie=input.ts[out+subcc] ffprobe version N-79653-g4efd3ec Copyright (c) 2007-2016 the FFmpeg developers libavutil 55. 22.101 / 55. 22.101 libavcodec 57. 38.100 / 57. 38.100 libavformat 57. 34.103 / 57. 34.103 libavdevice 57. 0.101 / 57. 0.101 libavfilter 6. 44.100 / 6. 44.100 libswscale 4. 1.100 / 4. 1.100 libswresample 2. 0.101 / 2. 0.101 libpostproc 54. 0.100 / 54. 0.100 [h264 @ 0x7fe869826200] Increasing reorder buffer to 1 Input #0, lavfi, from 'movie=input.ts[out+subcc]': Duration: N/A, start: 1562.233011, bitrate: N/A Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 90k fps, 30 tbr, 90k tbn Stream #0:1: Subtitle: eia_608 

The Subtitle: eia_608 has an β€œindex” of 0:1 , so this is what should be displayed.

Few markup notes, the order of the arguments matters for ffmpeg , -f lavfi must go before -i move=... , otherwise the specification will not be recognized. This function is also quite recent, so double check the version of ffmpeg and update if necessary.

+17
source share

Closed signature - 2 formats
1) American standard ATSC (support exists in ffmpeg)
2) Japanese standard ISDB (support does not yet exist in ffmpeg)

you can use the following command

 ffmpeg -f lavfi -i "movie=test.ts[out0+subcc]" -map s output.srt 

This thing was recently developed, so check out your version of FFmpeg.

+9
source share

For only subtitles, not meta garbage, I found that

 ffmpeg -i input.mov -an -vn -bsf:s mov2textsub -scodec copy -f rawvideo sub.txt 

works best for me.

+2
source share

If the header is included as a separate stream, then extracting them (relatively) directly:

 ffmpeg -i input.mov -an -vn -c:s copy -f rawvideo -map 0:s sub.txt 

If it "burned out" in the video file, then you probably were not lucky, but I would be more common for subtitles than closed captions.

+1
source share

Closed captions are not separate streams, and they are not burned in the picture, they alternate in the scan lines. In the picture, this is a strange American idea that is not used elsewhere. Although you can buy a DVD that has such subtitles, usually people outside the US cannot see the subtitles and may not even know if there is a file.

CCExtractor can extract this information from VOB by looking at TS metadata: http://ccextractor.sourceforge.net/

0
source share

It depends on what input file you are working with. In my case, I had Final Cut Pro MOV Master files with a Siaarist (.scc) track in eia-608 style. Although ffmpeg can extract embedded closed captions from mpeg2 transport stream files, it cannot process eia-608 data on a separate track.

The ccextractor should work, but the MOV revolves around Apple products and sometimes shifts completely to third parties ... so you have to normalize the MOV files before dealing with them ... simple ffmpeg -i my.mov -c copy -map 0 out.mov should do ffmpeg -i my.mov -c copy -map 0 out.mov case. Then CCExtractor, built into the MP4Box assembly, will be able to pass the eia-track to it and decode it into something suitable for use ... like vtt.

Source: https://trac.ffmpeg.org/ticket/7694

0
source share

ColdLearning's answer works with mp4 files using ffmpeg 4.1.4, but generates a lot of meta tags as part of the subtitles.

Heshy does not work with mp4 files because it cannot find subtitle streams.

These mp4 files do not display subtitles on the VLC, and ffmpeg and mp4box do not display subtitles as streams, but Handbrake detects the subtitle track as closed captions (CC608).

So if someone stumbles upon this after a long search, as I knew, this works, but later you need to clean up using regular expressions.

0
source share

All Articles