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

Ted Park kumowoon1025 at gmail.com
Fri Mar 27 19:38:19 EET 2020


> Okay, using 'mov' is progress—it outputs a usable file without error.
> (-strict seems to have no effect.)
> To restate my goal clearly: I want to process some m4v files, removing an unwanted "cover art" image appearing as mjpeg streams.
> Some problems with the "output to mov" approach:
> 1) I'd really like a video in the original file format when I'm done (m4v/mp4), not a mov file. I think mov files are less widely compatible, and in any case I'm going for in-place modification.

You are correct more or less, QuickTime file format or ISO base media file format is what the long name for “mov” files would be, and it serves as a template of sorts that many other formats (especially IEC family) are based on, including MP4.

m4v is just an alternate extension for mp4 files that Apple used to use on the content they distributed indicating certain profile requirements or DRM presence.

Now, the original mov files were a big superset including mp4 files, and also pretty much any A/V content, even stuff like interactive games (when QuickTime had that brushed metal look and had a 4 figure price tag for server+client license). But this is far from what a typical QuickTime file contains nowadays, to the point where if the media uses a supported codec, and you did not use any quicktime features to edit the file, more often than not you can replace the extension with mp4 or m4v, and it will be recognized by the application that consumes it.

> 2) It strips a number of metadata tags (I counted about 13). I want to remove the mjpeg stream without perturbing the rest of the file.

This can be done, add -map_metadata 0 for the global file-level metadata and -map_metadata:s: 0:s: for stream-level metadata. As I’ll explain, you can’t remove the mjpeg stream, but you can copy everything else but the mjpeg stream. Add -map 0 to copy everything and then add -map -0:# (where # is the stream index of the cover image) to not copy it.

> 3) Testing on another file (also Apple-encoded and supported), the 'mov' output chokes on another stream:
>   Stream #0:4(eng): Data: bin_data (tx3g / 0x67337874), 0 kb/s
>   Metadata:
>     creation_time   : 2016-07-15T19:12:05.000000Z
>     handler_name    : Core Media Text

This I am curious about, tx3g literally indicates mp4:17 text streams, with decoder name “mov_text”. Do you have a sample you can provide?

> It sounds like, at this point, the answer is "ffmpeg is not the tool for you", but I'm happy to hear other suggestions.

I mean, it does seem like there are easier alternatives if this is all you are trying to do. Ffmpeg covers a lot of ground. But one thing that ffmpeg doesn’t do (I believe) is “in-place modification.” Personally I don’t think you should do this anyways on binary files you don’t want to risk breaking, but mov/mp4/m4v has a pretty solid definition of its structure that tools exist that work on the files in-place.

If by other suggestions you meant alternative tools, gpac, l-smash, mp4box are some tools that can work on ISO-family format files, if not in-place, piece by piece. If you have a Mac and are okay with a GUI solution, Subler is a very popular tool for apple-device-compatible-file editing.

Ted Park

More information about the ffmpeg-user mailing list