[FFmpeg-devel] [PATCH v2] lavf/movenc: write track title metadata for mov files

Courtland Idstrom cidstrom at telltalegames.com
Wed Mar 21 23:30:47 EET 2018


>
>
> Any way of verifying will do, even a hex editor.
>
>
Output from Quicktime (screenshot of the movie inspector -- initial movie
was created in ffmpeg, title added in quicktime, file saved:
https://imgur.com/a/TPCkN)

00308ef0  00 00 00 21 75 64 74 61  00 00 00 15 6e 61 6d 65  |...!udta
....name|

00308f00  54 72 61 63 6b 20 54 69  74 6c 65 20 31 00 00 00  |Track Title
1...|

00308f10  00 00 00 0a 3e 74 72 61  6b 00 00 00 5c 74 6b 68
|....>trak...\tkh|


[size = 33]["udta"]

  [size = 21]["Track Title 1"]

  [0000]



Output from ffmpeg with the patch applied. It looks like this when opened
in Quicktime: https://imgur.com/a/LbT9m


ffmpeg -i acodec-pcm-s24le.wav -i acodec-pcm-s24le.wav -map 0 -map 1
-metadata:s:a:0 title="Track Title 1" -metadata:s:a:1 title="Track Title 2"
-codec copy test-two-tracks-ffmpeg.mov

00307bf0  30 14 1c 00 30 34 14 00  30 54 0c 00 00 00 1d 75
|0...04..0T.....u|

00307c00  64 74 61 00 00 00 15 6e  61 6d 65 54 72 61 63 6b
|dta....nameTrack|

00307c10  20 54 69 74 6c 65 20 31  00 00 08 60 74 72 61 6b  | Title
1...`trak|


[size = 29]["udta"]

  [size = 21]["Track Title 1"]


You'll note that these are different! The Quicktime version is terminated
with a 32-bit integer 0, which is included in the initial size. Relevant
excerpt from the Movie Atoms Quicktime reference:

"A user data list that is formatted as a series of atoms. Each data element
in the user data list contains size and type information along with its
payload data. For historical reasons, the data list is optionally
terminated by a 32-bit integer set to 0. If you are writing a program to
read user data atoms, you should allow for the terminating 0. However, if
you are writing a program to create user data atoms, you can safely leave
out the terminating 0."

See:
https://developer.apple.com/library/content/documentation/QuickTime/QTFF/QTFFChap2/qtff2.html#//apple_ref/doc/uid/TP40000939-CH204-25538


Please let me know if this is sufficient. I can also upload these movies
somewhere, I didn't think it would be appropriate to attach them to this
email.


Cheers,

-Courtland


More information about the ffmpeg-devel mailing list