简体   繁体   English

无法将流元数据插入 MP4?

[英]Can't insert stream metadata into MP4?

MKV out ( yes metadata ): MKV 输出(是元数据):

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 ): MP4 输出(不是元数据):

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?是否有任何解释表明无法将元数据插入到 MP4 输出文件的流中?

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

It's possible to add title and title only to streams in MP4.可以仅将标题和标题添加到 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.但是,ffmpeg 的 MP4 解复用器不会读取用户插入的流元数据,因此不会在输出中显示它。 Use Mediainfo to check its presence.使用 Mediainfo 检查它的存在。

"Any explanation of why it's not possible to insert metadata into the stream into the MP4 output file?" “为什么不能将元数据插入到 MP4 输出文件的流中的任何解释?”

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM