[FFmpeg-user] MPEG: embedding metadata is not working

Peter B. pb at das-werkstatt.com
Tue Aug 7 14:15:32 CEST 2012


Hello again :)

I'd like to embed some metadata (title, archive signature, ...) into  
an existing .mpg file (mpeg-PS), using the following command:

//---------------------
$ ffmpeg -i video.mpg -acodec copy -vcodec copy -metadata title="Title  
Test" output.mpg
//---------------------

I've googled for any examples, and found examples in the "FFmpeg  
MultimediaWiki" [1], and the syntax shown there matches mine.

I would have expected that "output.mpg" now has the title metadata set  
to "Title Test", but no metadata is written to the generated file :(
(I've verified using ffprobe and GSpot):

//---------------------
$ ffmpeg -i video.mpg -acodec copy -vcodec copy -metadata title="Title  
Testing" output.mpg && ffprobe output.mpg
//---------------------
ffmpeg version N-43292-g7febc5a Copyright (c) 2000-2012 the FFmpeg developers
   built on Aug  7 2012 13:58:57 with gcc 4.4.5 (Debian 4.4.5-8)
   configuration: --prefix=/usr/local --enable-gpl --enable-nonfree  
--enable-postproc --enable-swscale --enable-avfilter --enable-pthreads  
--enable-bzlib --enable-libmp3lame --enable-libvorbis --enable-libxvid  
--enable-zlib --enable-libopenjpeg --enable-decoder=png  
--enable-encoder=png --enable-libschroedinger
   libavutil      51. 66.101 / 51. 66.101
   libavcodec     54. 50.100 / 54. 50.100
   libavformat    54. 22.101 / 54. 22.101
   libavdevice    54.  2.100 / 54.  2.100
   libavfilter     3.  5.102 /  3.  5.102
   libswscale      2.  1.101 /  2.  1.101
   libswresample   0. 15.100 /  0. 15.100
   libpostproc    52.  0.100 / 52.  0.100
[mpeg @ 0x958f500] max_analyze_duration 5000000 reached at 5000000
Input #0, mpeg, from 'video.mpg':
   Duration: 00:02:06.61, start: 0.220000, bitrate: 3255 kb/s
     Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p, 720x576  
[SAR 16:15 DAR 4:3], 3900 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
     Stream #0:1[0x1c0]: Audio: mp2, 44100 Hz, stereo, s16, 224 kb/s
File 'output.mpg' already exists. Overwrite ? [y/N] y
Output #0, mpeg, to '../client/flash/script_devel/12-00255_b03.mpg':
   Metadata:
     title           : Title Testing
     encoder         : Lavf54.22.101
     Stream #0:0: Video: mpeg2video, yuv420p, 720x576 [SAR 16:15 DAR  
4:3], q=2-31, 3900 kb/s, 25 fps, 90k tbn, 25 tbc
     Stream #0:1: Audio: mp2, 44100 Hz, stereo, 224 kb/s
Stream mapping:
   Stream #0:0 -> #0:0 (copy)
   Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame= 3166 fps=0.0 q=-1.0 Lsize=   49966kB time=00:02:06.60  
bitrate=3233.2kbits/s
video:46248kB audio:3463kB subtitle:0 global headers:0kB muxing  
overhead 0.512266%

ffprobe version N-43292-g7febc5a Copyright (c) 2007-2012 the FFmpeg developers
   built on Aug  7 2012 13:58:57 with gcc 4.4.5 (Debian 4.4.5-8)
   configuration: --prefix=/usr/local --enable-gpl --enable-nonfree  
--enable-postproc --enable-swscale --enable-avfilter --enable-pthreads  
--enable-bzlib --enable-libmp3lame --enable-libvorbis --enable-libxvid  
--enable-zlib --enable-libopenjpeg --enable-decoder=png  
--enable-encoder=png --enable-libschroedinger
   libavutil      51. 66.101 / 51. 66.101
   libavcodec     54. 50.100 / 54. 50.100
   libavformat    54. 22.101 / 54. 22.101
   libavdevice    54.  2.100 / 54.  2.100
   libavfilter     3.  5.102 /  3.  5.102
   libswscale      2.  1.101 /  2.  1.101
   libswresample   0. 15.100 /  0. 15.100
   libpostproc    52.  0.100 / 52.  0.100
[mpeg @ 0xa8e45e0] max_analyze_duration 5000000 reached at 5000000
Input #0, mpeg, from '../client/flash/script_devel/12-00255_b03.mpg':
   Duration: 00:02:06.60, start: 1.000000, bitrate: 3233 kb/s
     Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p, 720x576  
[SAR 16:15 DAR 4:3], 3900 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
     Stream #0:1[0x1c0]: Audio: mp2, 44100 Hz, stereo, s16, 224 kb/s
//------------------------------------

Using the same commandline, but changing the target container to  
".avi" works as expected:

//------------------------------------
ffprobe version 0.7.12, Copyright (c) 2007-2011 the FFmpeg developers
   built on Apr 11 2012 07:30:33 with gcc 4.4.5
   configuration: --enable-libdc1394 --prefix=/usr  
--extra-cflags='-Wall -g ' --cc='ccache cc' --enable-shared  
--enable-libmp3lame --enable-gpl --enable-libvorbis --enable-pthreads  
--enable-libfaac --enable-libxvid --enable-postproc --enable-x11grab  
--enable-libgsm --enable-libtheora --enable-libopencore-amrnb  
--enable-libopencore-amrwb --enable-libx264 --enable-libspeex  
--enable-nonfree --disable-stripping --enable-avfilter  
--enable-libdirac --disable-decoder=libdirac --enable-libfreetype  
--enable-libschroedinger --disable-encoder=libschroedinger  
--enable-version3 --enable-libopenjpeg --enable-libvpx  
--enable-librtmp --extra-libs=-lgcrypt --disable-altivec  
--disable-armv5te --disable-armv6 --disable-vis
   libavutil    50. 43. 0 / 50. 43. 0
   libavcodec   52.123. 0 / 52.123. 0
   libavformat  52.111. 0 / 52.111. 0
   libavdevice  52.  5. 0 / 52.  5. 0
   libavfilter   1. 80. 0 /  1. 80. 0
   libswscale    0. 14. 1 /  0. 14. 1
   libpostproc  51.  2. 0 / 51.  2. 0
Input #0, avi, from 'output.avi':
   Metadata:
     title           : Title Testing
     encoder         : Lavf52.111.0
   Duration: 00:02:06.64, start: 0.000000, bitrate: 27366 kb/s
     Stream #0.0: Video: ffv1, yuv420p, 720x576, PAR 16:15 DAR 4:3, 25  
tbr, 25 tbn, 25 tbc
     Stream #0.1: Audio: mp2, 44100 Hz, stereo, s16, 224 kb/s
//------------------------------------

I've also tried the first commandline with "-vcodec mpeg2video" to see  
if maybe the "-vcodec copy" led to ignoring the new metadata tags:  
Same result :(

I have also checked back with Debian's repo-version of ffmpeg  
(v0.7.12): Same effect, so obviously there's a misunderstanding on my  
side regarding the metadata capabilities of an MPEG-PS?

Thanks,
Pb

== References:
[1] http://wiki.multimedia.cx/index.php?title=FFmpeg_Metadata



More information about the ffmpeg-user mailing list