lockwise
lockwise

Reputation: 51

Can't insert stream metadata into MP4?

MKV out (yes metadata):

ffmpeg -y -i input.mkv -map 0:v:0 -c:v copy -metadata:s:v:0 title="My video" output.mkv

~# ffmpeg -hide_banner -i output.mkv

    Stream #0:0(eng): Video: h264 (High), yuv420p(tv, bt709, progressive), 1024x576 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
    Metadata:
      title           : My video
      DURATION        : 01:37:03.942000000

MP4 out (not metadata):

ffmpeg -y -i input.mkv -map 0:v:0 -c:v copy -metadata:s:v:0 title="My video" output.mp4

~# ffmpeg -hide_banner -i output.mp4

    Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1024x576 [SAR 1:1 DAR 16:9], 2766 kb/s, 23.98 fps, 23.98 tbr, 16k tbn, 47.95 tbc (default)
    Metadata:
      handler_name    : VideoHandler

Is there any explanation that it is not possible to insert metadata into the stream into the MP4 output file?

ffmpeg version 4.3.1-1ubuntu0~18.04.sav1 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04)
  configuration: --prefix=/usr --extra-version='1ubuntu0~18.04.sav1' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-crystalhd --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100

Upvotes: 0

Views: 361

Answers (2)

Gyan
Gyan

Reputation: 93319

It's possible to add title and title only to streams in MP4. And your command is fine. However, ffmpeg's MP4 demuxer does not read user-inserted stream metadata so it does not display it in the output. Use Mediainfo to check its presence.

Upvotes: 1

VC.One
VC.One

Reputation: 15936

"Any explanation of why it's not possible to insert metadata into the stream into the MP4 output file?"

It is possible, try doing it like below:

ffmpeg -y -i input.mkv -map 0:v:0 -c:v copy -metadata title="My Video Test" output.mp4

Upvotes: 0

Related Questions