[FFmpeg-user] Write QuickTime tags
Moritz Barsnick
barsnick at gmx.net
Tue Jul 11 13:31:38 EEST 2017
On Mon, Jul 10, 2017 at 21:12:14 +0100, Kieran O Leary wrote:
> > I am wondering if there is any good documentation available on the web on
> > what QuickTime tags ffmpeg is available to write.
[...]
> > I also found this webpage:
> > https://multimedia.cx/eggs/supplying-ffmpeg-with-metadata/ but it
> > is not up to date either.
There's another list here, but the same conclusion is valid:
https://wiki.multimedia.cx/index.php/FFmpeg_Metadata#QuickTime.2FMOV.2FMP4.2FM4A.2Fet_al.
(Some of it is incorrect.)
> It looks like your best bet is to go to the source code itself.
I agree.
> https://github.com/FFmpeg/FFmpeg/blob/master/libavformat/movenc.c#L3304
>
> There's some other sections in there for other profiles too:
> https://github.com/FFmpeg/FFmpeg/blob/master/libavformat/movenc.c#L3520
Actually, if you look at that latter code location closely, you will
see that those differentiations are between MOV, MP4 ("iTunes
metadata") and 3GP - three very similar, but somewhat different
formats.
The most important observation is that the "mdta" atom, as mentioned in
the Apple link given:
https://developer.apple.com/library/content/documentation/QuickTime/QTFF/Metadata/Metadata.html#//apple_ref/doc/uid/TP40000939-CH1-SW43
is written only for "iTunes" (MP4, M4A I guess) files by default. To
write it to MOV files as well, you need to specify
-movflags +use_metadata_tags
And indeed, in a quick test, I can add arbitrary metadata keys to MOV
files. :-) (You need to find a different tool to check for sure, I
guess. Does Apple have a refence MOV file checker?) I would need to
double-check the source code to understand whether you have to specify
the "com.apple.quicktime." prefix or not.
> but i do not see 'keywords' on the ffmpeg encoding list. It might be not be
> that difficult to add support for these tags.
ffmpeg apparently is capable of encoding *anything* to "mdta", see
mov_write_mdta_keys_tag().
Moritz
More information about the ffmpeg-user
mailing list