[FFmpeg-user] Adding metadata at the stream level for a multi-stream media file

Alfredo Di Napoli alfredo.dinapoli at gmail.com
Tue Jul 26 11:03:41 EEST 2016


On 25 July 2016 at 19:29, William Caulfield <
william.caulfield at contentbridge.tv> wrote:

> On Mon, Jul 25, 2016 at 10:01 AM, Karl E. Fitzke <karl.fitzke at cornell.edu>
> wrote:
>
> > Might the metadata "stick" if you used .mov format (wrapper) for the mp4
> > instead of .mp4 extension in the command line?  I'm no expert either,
> but I
> > believe that could be helpful to try.
> >
>
> It would also work or "stick" in an MPEG2 Transport Stream. MXF, MOV and
> MPG2TS are more robust wrappers than MP4.
>
>
> >
> > ________________________________
> > > > Suppose I have a media file composed by 1 video stream and 2 audio
> > > > streams (both AAC).
> > > > Is it possible to add metadata at the stream level, for each of the
> > > > two audio?
> > >
> > > It most certainly is. But maybe the answer is that it depends.
> > > Apparently the file format plays a part in this.
> > >
> >
> >
>
>
> --
>
> [image: Inline image 1]
>
> *William Caulfield *| *ContentBridge Systems*
> Product and Encoding Manager | www.contentbridge.tv
> 445 N Douglas St |El Segundo | CA 90245
>
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
>

Hey folks,

I have tried MKV, MOV and MPEGTS. Of the three, only MKV works, as reported
by Peter.
For the other 2, I get the very same result. Example of commands I have
tried:

ffmpeg-3.1.1 -i multi.mp4 -map 0:v -map 0:a -y -codec copy -metadata:s:a:0
title="Foo" -metadata:s:a:1 title="bar" multi3.mkv (WORKS)

(probe output)

Input #0, matroska,webm, from 'multi3.mkv':
  Metadata:
    COMPATIBLE_BRANDS: isomiso2avc1mp41
    MAJOR_BRAND     : isom
    MINOR_VERSION   : 512
    ENCODER         : Lavf57.41.100
  Duration: 00:05:00.08, start: 0.000000, bitrate: 3798 kb/s
    Stream #0:0: Video: h264 (Constrained Baseline), yuv420p, 2560x720 [SAR
1:1 DAR 32:9], 29.97 fps, 29.97 tbr, 1k tbn, 59.94 tbc (default)
    Metadata:
      HANDLER_NAME    : VideoHandler
      DURATION        : 00:05:00.023000000
    Stream #0:1: Audio: aac (LC), 44100 Hz, stereo, fltp (default)
    Metadata:
      title           : Foo
      HANDLER_NAME    : SoundHandler
      DURATION        : 00:05:00.077000000
    Stream #0:2: Audio: aac (LC), 44100 Hz, stereo, fltp
    Metadata:
      title           : bar
      HANDLER_NAME    : SoundHandler
      DURATION        : 00:05:00.077000000

ffmpeg-3.1.1 -i multi.mp4 -map 0:v -map 0:a -y -codec copy -metadata:s:a:0
title="Foo" -metadata:s:a:1 title="bar" multi3.mov (DOES NOT WORK)

(probe output)

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'multi3.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 512
    compatible_brands: qt
    encoder         : Lavf57.41.100
  Duration: 00:05:00.08, start: 0.000000, bitrate: 3799 kb/s
    Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 /
0x31637661), yuv420p, 2560x720 [SAR 1:1 DAR 32:9], 3664 kb/s, 29.97 fps,
29.97 tbr, 11988 tbn, 59.94 tbc (default)
    Metadata:
      handler_name    : DataHandler
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz,
stereo, fltp, 64 kb/s (default)
    Metadata:
      handler_name    : DataHandler
    Stream #0:2(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz,
stereo, fltp, 64 kb/s
    Metadata:
      handler_name    : DataHandler

ffmpeg-3.1.1 -i multi.mp4 -map 0:v -map 0:a -y -codec copy -metadata:s:a:0
title="Foo" -metadata:s:a:1 title="bar" multi3.ts (DOES NOT WORK)

ffprobe version 3.1.1-tessus Copyright (c) 2007-2016 the FFmpeg developers
  built with Apple LLVM version 7.3.0 (clang-703.0.31)
  configuration: --prefix=/Users/adinapoli/ffmpeg-3.1.1/ffmpeg_build
--extra-cflags=-I/Users/adinapoli/ffmpeg-3.1.1/ffmpeg_build/include
--extra-ldflags=-L/Users/adinapoli/ffmpeg-3.1.1/ffmpeg_build/lib
--bindir=/Users/adinapoli/ffmpeg-3.1.1/bin --extra-libs=-ldl --as=yasm
--disable-debug --disable-ffplay --disable-indev=qtkit
--disable-indev=x11grab_xcb --enable-avisynth --enable-avresample
--enable-fontconfig --enable-frei0r --enable-gpl --enable-libmp3lame
--enable-libx264 --enable-libxvid --enable-nonfree --enable-pthreads
--enable-shared --enable-vda --enable-version3 --extra-version=tessus
  libavutil      55. 28.100 / 55. 28.100
  libavcodec     57. 48.101 / 57. 48.101
  libavformat    57. 41.100 / 57. 41.100
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 47.100 /  6. 47.100
  libavresample   3.  0.  0 /  3.  0.  0
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  1.100 /  2.  1.100
  libpostproc    54.  0.100 / 54.  0.100
Input #0, mpegts, from 'multi3.ts':
  Duration: 00:05:00.02, start: 1.400000, bitrate: 4127 kb/s
  Program 1
    Metadata:
      service_name    : Service01
      service_provider: FFmpeg
    Stream #0:0[0x100]: Video: h264 (Constrained Baseline) ([27][0][0][0] /
0x001B), yuv420p, 2560x720 [SAR 1:1 DAR 32:9], 29.97 fps, 29.97 tbr, 90k
tbn, 59.94 tbc
    Stream #0:1[0x101](und): Audio: aac (LC) ([15][0][0][0] / 0x000F),
44100 Hz, stereo, fltp, 66 kb/s
    Stream #0:2[0x102](und): Audio: aac (LC) ([15][0][0][0] / 0x000F),
44100 Hz, stereo, fltp, 64 kb/s

Thanks for your help guys!


More information about the ffmpeg-user mailing list