[FFmpeg-user] Extracting embedded xml metadata im mp4

Moritz Barsnick barsnick at gmx.net
Wed Oct 19 18:39:09 EEST 2016

On Wed, Oct 19, 2016 at 12:32:00 +0200, Robert Kr├╝ger wrote:
> Hi,
> I am currently looking at files from Sony A7S cameras (h264 in mp4) and
> looking at those files in a hex/text editor I can see that they have xml
> metadata written in a "meta" tag as far as I can see:

I couldn't find a sample to test. I found one with a "Timed Metadata
Media Handler" data stream in this ticket:
but it seems to contain binary data.

$ ffprobe -show_packets -show_data
or even
$ ffprobe -show_packets -show_data -print_format compact
you should see each packet's data in hexadecimal form. That could be
parsed back to plain text (or binary, or whatever was in your data

To actually *extract* the data, I used this patch:

A newer version is here, though I think that's not the one I tested:

Note that both were rejected on ffmpeg-devel.

I used that patch (patched ffmpeg) to extract the data stream to
(Base64 text) file, and converted that to original data:

$ grep -Ev ':|^\;' sony_a7s_XAVC_S_1080_25p_10s.fftextdata | perl -MMIME::Base64 -e 'while(<>) { print decode_base64($_) . "\n"; }'

But as I said, there's only binary data in that sample apparently, and
I *seem* to see the same stuff in the extracted data an in the MP4


More information about the ffmpeg-user mailing list