[FFmpeg-user] filter ffmetadata does not output all metadata and is missing in documentation

Ulf Zibis Ulf.Zibis at gmx.de
Wed Mar 4 00:07:48 EET 2020


Am 03.03.20 um 21:48 schrieb Nicolas George:
> Ulf Zibis (12020-03-03):
>> Does it have some options to make it output *all* metadata?
> It does output all metadata.

No, it misses the creation_time.

See the output from using the example from:
https://ffmpeg.org/ffmpeg-formats.html#Metadata-1

$ ~/Projects/ffmpeg/ffmpeg-git-20200211-amd64-static/ffmpeg -i
20200205_165401.mp4 -f ffmetadata 20200205_165401.meta
ffmpeg version N-51730-gf15007afa9-static
https://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2020 the FFmpeg
developers
   built with gcc 8 (Debian 8.3.0-6)
   configuration: --enable-gpl --enable-version3 --enable-static
--disable-debug --disable-ffplay --disable-indev=sndio
--disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r
--enable-gnutls --enable-gmp --enable-libgme --enable-gray
--enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf
--enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb
--enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband
--enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis
--enable-libopus --enable-libtheora --enable-libvidstab
--enable-libvo-amrwbenc --enable-libvpx --enable-libwebp
--enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d
--enable-libxvid --enable-libzvbi --enable-libzimg
   libavutil      56. 39.100 / 56. 39.100
   libavcodec     58. 68.102 / 58. 68.102
   libavformat    58. 38.100 / 58. 38.100
   libavdevice    58.  9.103 / 58.  9.103
   libavfilter     7. 75.100 /  7. 75.100
   libswscale      5.  6.100 /  5.  6.100
   libswresample   3.  6.100 /  3.  6.100
   libpostproc    55.  6.100 / 55.  6.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '20200205_165401.mp4':
   Metadata:
     major_brand     : mp42
     minor_version   : 0
     compatible_brands: isommp42
     creation_time   : 2020-02-05T19:55:01.000000Z
     location        : -00.7655-047.1715/
     location-eng    : -00.7655-047.1715/
     com.android.version: 8.0.0
   Duration: 00:00:58.65, start: 0.000000, bitrate: 17273 kb/s
     Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661),
yuv420p(tv, bt709), 1920x1080, 17013 kb/s, SAR 1:1 DAR 16:9, 29.99 fps,
30 tbr, 90k tbn, 180k tbc (default)
     Metadata:
       creation_time   : 2020-02-05T19:55:01.000000Z
       handler_name    : VideoHandle
     Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz,
stereo, fltp, 256 kb/s (default)
     Metadata:
       creation_time   : 2020-02-05T19:55:01.000000Z
       handler_name    : SoundHandle
File '20200205_165401.meta' already exists. Overwrite? [y/N] y
Output #0, ffmetadata, to '20200205_165401.meta':
   Metadata:
     major_brand     : mp42
     minor_version   : 0
     compatible_brands: isommp42
     com.android.version: 8.0.0
     location        : -00.7655-047.1715/
     location-eng    : -00.7655-047.1715/
     encoder         : Lavf58.38.100
Stream mapping:
Press [q] to stop, [?] for help
size=       0kB time=-577014:32:22.77 bitrate=N/A speed=N/A
video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: unknown
Output file is empty, nothing was encoded

$ ~/Projects/ffmpeg/ffmpeg-git-20200211-amd64-static/ffmpeg -i
20200205_165401.mp4 -i 20200205_165401.meta -movflags +faststart
-map_metadata 1 -vf scale=w=iw/2:h=ih/2 20200205_165401_2_git_meta.mp4
ffmpeg version N-51730-gf15007afa9-static
https://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2020 the FFmpeg
developers
   built with gcc 8 (Debian 8.3.0-6)
   configuration: --enable-gpl --enable-version3 --enable-static
--disable-debug --disable-ffplay --disable-indev=sndio
--disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r
--enable-gnutls --enable-gmp --enable-libgme --enable-gray
--enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf
--enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb
--enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband
--enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis
--enable-libopus --enable-libtheora --enable-libvidstab
--enable-libvo-amrwbenc --enable-libvpx --enable-libwebp
--enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d
--enable-libxvid --enable-libzvbi --enable-libzimg
   libavutil      56. 39.100 / 56. 39.100
   libavcodec     58. 68.102 / 58. 68.102
   libavformat    58. 38.100 / 58. 38.100
   libavdevice    58.  9.103 / 58.  9.103
   libavfilter     7. 75.100 /  7. 75.100
   libswscale      5.  6.100 /  5.  6.100
   libswresample   3.  6.100 /  3.  6.100
   libpostproc    55.  6.100 / 55.  6.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '20200205_165401.mp4':
   Metadata:
     major_brand     : mp42
     minor_version   : 0
     compatible_brands: isommp42
     creation_time   : 2020-02-05T19:55:01.000000Z
     location        : -00.7655-047.1715/
     location-eng    : -00.7655-047.1715/
     com.android.version: 8.0.0
   Duration: 00:00:58.65, start: 0.000000, bitrate: 17273 kb/s
     Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661),
yuv420p(tv, bt709), 1920x1080, 17013 kb/s, SAR 1:1 DAR 16:9, 29.99 fps,
30 tbr, 90k tbn, 180k tbc (default)
     Metadata:
       creation_time   : 2020-02-05T19:55:01.000000Z
       handler_name    : VideoHandle
     Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz,
stereo, fltp, 256 kb/s (default)
     Metadata:
       creation_time   : 2020-02-05T19:55:01.000000Z
       handler_name    : SoundHandle
Input #1, ffmetadata, from '20200205_165401.meta':
   Metadata:
     major_brand     : mp42
     minor_version   : 0
     compatible_brands: isommp42
     com.android.version: 8.0.0
     location        : -00.7655-047.1715/
     location-eng    : -00.7655-047.1715/
     encoder         : Lavf58.38.100
   Duration: N/A, start: 0.000000, bitrate: N/A
Stream mapping:
   Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
   Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
[libx264 @ 0x68b8300] using SAR=1/1
[libx264 @ 0x68b8300] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.1
Cache64
[libx264 @ 0x68b8300] profile High, level 3.1, 4:2:0, 8-bit
[libx264 @ 0x68b8300] 264 - core 159 r2991 1771b55 - H.264/MPEG-4 AVC
codec - Copyleft 2003-2019 - http://www.videolan.org/x264.html -
options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7
psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1
8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=3
lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0
bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1
b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250
keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf
mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40
aq=1:1.00
Output #0, mp4, to '20200205_165401_2_git_meta.mp4':
   Metadata:
     major_brand     : mp42
     minor_version   : 0
     compatible_brands: isommp42
     com.android.version: 8.0.0
     location        : -00.7655-047.1715/
     location-eng    : -00.7655-047.1715/
     encoder         : Lavf58.38.100
     Stream #0:0(eng): Video: h264 (libx264) (avc1 / 0x31637661),
yuv420p, 960x540 [SAR 1:1 DAR 16:9], q=-1--1, 30 fps, 15360 tbn, 30 tbc
(default)
     Metadata:
       creation_time   : 2020-02-05T19:55:01.000000Z
       handler_name    : VideoHandle
       encoder         : Lavc58.68.102 libx264
     Side data:
       cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
     Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz,
stereo, fltp, 128 kb/s (default)
     Metadata:
       creation_time   : 2020-02-05T19:55:01.000000Z
       handler_name    : SoundHandle
       encoder         : Lavc58.68.102 aac
frame=    3 fps=0.0 q=0.0 size=       0kB time=00:00:01.00 bitrate=  
0.4kbits/sframe=    4 fps=3.6 q=0.0 size=       0kB time=00:00:01.00
bitrate=   0.4kbits/sframe=   32 fps= 20 q=0.0 size=       0kB
time=00:00:01.57 bitrate=   0.2kbits/sframe=   47 fps= 21 q=0.0
size=       0kB time=00:00:02.00 bitrate= 0.2kbits/sframe=   57 fps= 20
q=29.0 size=       0kB time=00:00:02.00 bitrate=   0.2kbits/frame=   63
fps= 19 q=29.0 size=       0kB time=00:00:02.02 bitrate=  
0.2kbits/frame=   71 fps= 18 q=29.0 size=       0kB time=00:00:03.00
bitrate= 0.1kbits/frame=   79 fps= 18 q=29.0 size=     256kB
time=00:00:03.00 bitrate= 697.3kbits/frame=   85 fps= 17 q=29.0
size=     256kB time=00:00:03.00 bitrate= 697.3kbits/frame=   94 fps= 17
q=29.0 size=     256kB time=00:00:03.00 bitrate= 697.3kbits/frame=  102
fps= 17 q=29.0 size=     512kB time=00:00:04.01
bitrate=1045.9kbits/frame=  110 fps= 17 q=29.0 size=     512kB
time=00:00:04.01 bitrate=1045.9kbits/frame=  119 fps= 17 q=29.0
size=     512kB time=00:00:04.01 bitrate=1045.9kbits/frame=  129 fps= 16
q=29.0 size=     512kB time=00:00:05.01 bitrate= 836.7kbits/frame=  136
fps= 16 q=29.0 size=     768kB time=00:00:05.01
bitrate=1255.0kbits/frame=  144 fps= 16 q=29.0 size=     768kB
time=00:00:05.01 bitrate=1255.0kbits/
[.....]
frame= 1757 fps= 12 q=29.0 size=   17152kB time=00:00:58.53
bitrate=2400.3kbits/[mp4 @ 0x68f6e00] Starting second pass: moving the
moov atom to the beginning of the file
frame= 1761 fps= 12 q=-1.0 Lsize=   17814kB time=00:00:58.60
bitrate=2490.4kbits/s dup=1 drop=0 speed= 0.4x
video:16820kB audio:930kB subtitle:0kB other streams:0kB global
headers:0kB muxing overhead: 0.363400%
[libx264 @ 0x68b8300] frame I:8     Avg QP:20.17  size: 71230
[libx264 @ 0x68b8300] frame P:444   Avg QP:22.89  size: 22734
[libx264 @ 0x68b8300] frame B:1309  Avg QP:26.81  size:  5011
[libx264 @ 0x68b8300] consecutive B-frames:  0.8%  0.2%  0.2% 98.8%
[libx264 @ 0x68b8300] mb I  I16..4: 16.0% 46.4% 37.6%
[libx264 @ 0x68b8300] mb P  I16..4:  2.3%  5.8%  1.2%  P16..4: 33.0%
21.2% 13.5%  0.0%  0.0%    skip:23.0%
[libx264 @ 0x68b8300] mb B  I16..4:  0.1%  0.1%  0.1%  B16..8: 37.1% 
4.6%  1.5%  direct: 5.3%  skip:51.3%  L0:44.2% L1:48.0% BI: 7.7%
[libx264 @ 0x68b8300] 8x8 transform intra:59.1% inter:49.1%
[libx264 @ 0x68b8300] coded y,uvDC,uvAC intra: 54.9% 40.2% 16.0% inter:
20.1% 5.2% 0.4%
[libx264 @ 0x68b8300] i16 v,h,dc,p: 14% 52% 18% 16%
[libx264 @ 0x68b8300] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 17% 29% 33% 3%  3% 
2%  5%  2%  6%
[libx264 @ 0x68b8300] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 23% 18% 21% 6%  6% 
5%  8%  4%  8%
[libx264 @ 0x68b8300] i8c dc,h,v,p: 68% 17% 14%  1%
[libx264 @ 0x68b8300] Weighted P-Frames: Y:4.1% UV:0.9%
[libx264 @ 0x68b8300] ref P L0: 58.2% 14.4% 17.4%  9.9%  0.2%
[libx264 @ 0x68b8300] ref B L0: 88.2%  8.8%  2.9%
[libx264 @ 0x68b8300] ref B L1: 92.8%  7.2%
[libx264 @ 0x68b8300] kb/s:2347.26
[aac @ 0x68b7d80] Qavg: 310.465

$ ~/Projects/ffmpeg/ffmpeg-git-20200211-amd64-static/ffprobe
20200205_165401_2_git_meta.mp4
ffprobe version N-51730-gf15007afa9-static
https://johnvansickle.com/ffmpeg/  Copyright (c) 2007-2020 the FFmpeg
developers
   built with gcc 8 (Debian 8.3.0-6)
   configuration: --enable-gpl --enable-version3 --enable-static
--disable-debug --disable-ffplay --disable-indev=sndio
--disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r
--enable-gnutls --enable-gmp --enable-libgme --enable-gray
--enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf
--enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb
--enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband
--enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis
--enable-libopus --enable-libtheora --enable-libvidstab
--enable-libvo-amrwbenc --enable-libvpx --enable-libwebp
--enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d
--enable-libxvid --enable-libzvbi --enable-libzimg
   libavutil      56. 39.100 / 56. 39.100
   libavcodec     58. 68.102 / 58. 68.102
   libavformat    58. 38.100 / 58. 38.100
   libavdevice    58.  9.103 / 58.  9.103
   libavfilter     7. 75.100 /  7. 75.100
   libswscale      5.  6.100 /  5.  6.100
   libswresample   3.  6.100 /  3.  6.100
   libpostproc    55.  6.100 / 55.  6.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '20200205_165401_2_git_meta.mp4':
   Metadata:
     major_brand     : isom
     minor_version   : 512
     compatible_brands: isomiso2avc1mp41
     encoder         : Lavf58.38.100
     location-eng    : -00.7655-047.1715/
     location        : -00.7655-047.1715/
   Duration: 00:00:58.70, start: 0.000000, bitrate: 2486 kb/s
     Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p,
960x540 [SAR 1:1 DAR 16:9], 2347 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc
(default)
     Metadata:
       handler_name    : VideoHandle
     Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz,
stereo, fltp, 129 kb/s (default)
     Metadata:
       handler_name    : SoundHandle

As you can see, the creation_time is missing, because it is missing in
the metadata file !!!


But using
ffmpeg -i 20200205_165401.mp4 -movflags +faststart -map_metadata 0 -vf
scale=w=iw/2:h=ih/2 20200205_165401_2_git.mp4
creation_time was copied:

$ ~/Projects/ffmpeg/ffmpeg-git-20200211-amd64-static/ffprobe
20200205_165401_2_git.mp4
ffprobe version N-51730-gf15007afa9-static
https://johnvansickle.com/ffmpeg/  Copyright (c) 2007-2020 the FFmpeg
developers
   built with gcc 8 (Debian 8.3.0-6)
   configuration: --enable-gpl --enable-version3 --enable-static
--disable-debug --disable-ffplay --disable-indev=sndio
--disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r
--enable-gnutls --enable-gmp --enable-libgme --enable-gray
--enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf
--enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb
--enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband
--enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis
--enable-libopus --enable-libtheora --enable-libvidstab
--enable-libvo-amrwbenc --enable-libvpx --enable-libwebp
--enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d
--enable-libxvid --enable-libzvbi --enable-libzimg
   libavutil      56. 39.100 / 56. 39.100
   libavcodec     58. 68.102 / 58. 68.102
   libavformat    58. 38.100 / 58. 38.100
   libavdevice    58.  9.103 / 58.  9.103
   libavfilter     7. 75.100 /  7. 75.100
   libswscale      5.  6.100 /  5.  6.100
   libswresample   3.  6.100 /  3.  6.100
   libpostproc    55.  6.100 / 55.  6.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '20200205_165401_2_git.mp4':
   Metadata:
     major_brand     : isom
     minor_version   : 512
     compatible_brands: isomiso2avc1mp41
     creation_time   : 2020-02-05T19:55:01.000000Z          <-- creation
time
     encoder         : Lavf58.38.100
     location-eng    : -00.7655-047.1715/
     location        : -00.7655-047.1715/
   Duration: 00:00:58.70, start: 0.000000, bitrate: 2486 kb/s
     Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p,
960x540 [SAR 1:1 DAR 16:9], 2347 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc
(default)
     Metadata:
       creation_time   : 2020-02-05T19:55:01.000000Z <-- creation time
       handler_name    : VideoHandle
     Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz,
stereo, fltp, 129 kb/s (default)
     Metadata:
       creation_time   : 2020-02-05T19:55:01.000000Z <-- creation time
       handler_name    : SoundHandle

-Ulf



More information about the ffmpeg-user mailing list