[FFmpeg-user] Extracting embedded xml metadata im mp4

Robert Krüger krueger at lesspain.software
Wed Oct 19 13:32:00 EEST 2016


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:

<?xml version="1.0" encoding="UTF-8"?>
<NonRealTimeMeta
xmlns="urn:schemas-professionalDisc:nonRealTimeMeta:ver.2.00"
xmlns:lib="urn:schemas-professionalDisc:lib:ver.2.00" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
lastUpdate="2016-03-14T14:00:37Z">
<TargetMaterial
umidRef="060A2B340101010501010D4313000000E6307195617405CCFCDBB3FFFE513305"/>
<Duration value="132"/>
<LtcChangeTable tcFps="24" halfStep="false">
<LtcChange frameCount="0" value="08401500" status="increment"/>
<LtcChange frameCount="131" value="19451500" status="end"/>
</LtcChangeTable>
<CreationDate value="2016-03-14T14:00:37Z"/>
<Device manufacturer="Sony" modelName="ILCE-7S" serialNo="4294967295"/>
<RecordingMode type="normal" cacheRec="false"/>
</NonRealTimeMeta>

Is it possible to extract that XML using ffmpeg or ffprobe? I tried this:

ffprobe -export_all 1 -show_format /Volumes/LPSSD2/Shoots/Animals/C0032.MP4
ffprobe version git-2016-10-17-2f0ea8d Copyright (c) 2007-2016 the FFmpeg
developers
  built with Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
  configuration: --enable-shared --disable-static --disable-doc
--disable-devices --enable-indev=lavfi
--prefix=/Users/teamcity/buildAgent/work/3b1b1b1b725f407e/build/ffmpeg
--install-name-dir='@rpath'
--extra-cflags=-I/Users/teamcity/buildAgent/work/3b1b1b1b725f407e/build/libmp3lame/include/
--extra-ldflags=-L/Users/teamcity/buildAgent/work/3b1b1b1b725f407e/build/libmp3lame/lib/
--extra-cflags=-I/Users/teamcity/buildAgent/work/3b1b1b1b725f407e/build/libogg/include/
--extra-ldflags=-L/Users/teamcity/buildAgent/work/3b1b1b1b725f407e/build/libogg/lib/
--extra-cflags=-I/Users/teamcity/buildAgent/work/3b1b1b1b725f407e/build/libvorbis/include/
--extra-ldflags=-L/Users/teamcity/buildAgent/work/3b1b1b1b725f407e/build/libvorbis/lib/
--extra-ldflags='-Wl,-rpath, at loader_path/../lib' --enable-libvorbis
--enable-libvpx --enable-libmp3lame --enable-libopenh264
--enable-libfreetype
  libavutil      55. 32.100 / 55. 32.100
  libavcodec     57. 61.103 / 57. 61.103
  libavformat    57. 52.100 / 57. 52.100
  libavdevice    57.  0.102 / 57.  0.102
  libavfilter     6. 64.100 /  6. 64.100
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  2.100 /  2.  2.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from
'/Volumes/LPSSD2/Shoots/Animals/C0032.MP4':
  Metadata:
    major_brand     : XAVC
    minor_version   : 16785407
    compatible_brands: XAVCmp42iso2
    creation_time   : 2016-03-14T14:00:37.000000Z
  Duration: 00:00:05.51, start: 0.000000, bitrate: 48999 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv),
1920x1080 [SAR 1:1 DAR 16:9], 47263 kb/s, 23.98 fps, 23.98 tbr, 24k tbn,
47.95 tbc (default)
    Metadata:
      creation_time   : 2016-03-14T14:00:37.000000Z
      handler_name    : Video Media Handler
      encoder         : AVC Coding
    Stream #0:1(und): Audio: pcm_s16be (twos / 0x736F7774), 48000 Hz, 2
channels, s16, 1536 kb/s (default)
    Metadata:
      creation_time   : 2016-03-14T14:00:37.000000Z
      handler_name    : Sound Media Handler
    Stream #0:2(und): Data: none (rtmd / 0x646D7472), 196 kb/s (default)
    Metadata:
      creation_time   : 2016-03-14T14:00:37.000000Z
      handler_name    : Timed Metadata Media Handler
      timecode        : 00:15:40:08
Unsupported codec with id 0 for input stream 2
[FORMAT]
filename=/Volumes/LPSSD2/Shoots/Animals/C0032.MP4
nb_streams=3
nb_programs=0
format_name=mov,mp4,m4a,3gp,3g2,mj2
format_long_name=QuickTime / MOV
start_time=0.000000
duration=5.505500
size=33721095
bit_rate=48999865
probe_score=100
TAG:major_brand=XAVC
TAG:minor_version=16785407
TAG:compatible_brands=XAVCmp42iso2
TAG:creation_time=2016-03-14T14:00:37.000000Z
[/FORMAT]

but as you can see, the metadata is not exported.

Any hints would be appreciated.

Thanks,

Robert


More information about the ffmpeg-user mailing list