[FFmpeg-trac] #2876(avformat:new): Stream mapping: unable to set Video like first stream in output file (mpeg)

FFmpeg trac at avcodec.org
Fri Aug 16 16:47:50 CEST 2013


#2876: Stream mapping: unable to set Video like first stream in output file (mpeg)
-------------------------------------+-------------------------------------
             Reporter:  kadmandux    |                     Type:  defect
               Status:  new          |                 Priority:  normal
            Component:  avformat     |                  Version:  git-
             Keywords:  stream       |  master
  mapping                            |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 Summary of the bug:
 I'm having problems with stream ordering in mpeg files, as you can see
 here:

 http://trac.ffmpeg.org/ticket/2875

 I've found some problems to recover the original stream order, because
 ffmpeg don't generates the stream order I'm asking for.

 These are the two original files. Look at stream order:


 {{{
 % ffprobe v1.mpg
 Input #0, mpeg, from 'v1.mpg':
   Duration: 00:00:40.14, start: 0.500000, bitrate: 7713 kb/s
     Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p, 720x576 [SAR
 64:45 DAR 16:9], max. 9100 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
     Stream #0:1[0x80]: Audio: ac3, 48000 Hz, stereo, fltp, 256 kb/s

 % ffprobe v2.mpg
 Input #0, mpeg, from 'v2.mpg':
   Duration: 00:02:09.82, start: 0.500000, bitrate: 7583 kb/s
     Stream #0:0[0x80]: Audio: ac3, 48000 Hz, stereo, fltp, 256 kb/s
     Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p, 720x576 [SAR
 64:45 DAR 16:9], max. 9100 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
 }}}

 I'm going to try to reverse the order of the streams in both files.

 How to reproduce:
 {{{
 % ffmpeg -i v1.mpg -c:a copy -c:v copy -nostats -map 0:1 -map 0:0 v11.mpg
 ffmpeg version N-55393-g3b2e99f Copyright (c) 2000-2013 the FFmpeg
 developers
   built on Aug  8 2013 21:32:57 with gcc 4.7.3 (GCC)
   configuration: --enable-gpl --enable-version3 --disable-w32threads
 --enable-av
 isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls
 --enab
 le-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-
 libfreetyp
 e --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame
 --ena
 ble-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg
 --enable-l
 ibopus --enable-librtmp --enable-libschroedinger --enable-libsoxr
 --enable-libsp
 eex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --enable-
 libvo-
 amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-
 libxavs --
 enable-libxvid --enable-zlib
   libavutil      52. 41.100 / 52. 41.100
   libavcodec     55. 24.100 / 55. 24.100
   libavformat    55. 13.102 / 55. 13.102
   libavdevice    55.  3.100 / 55.  3.100
   libavfilter     3. 82.100 /  3. 82.100
   libswscale      2.  4.100 /  2.  4.100
   libswresample   0. 17.103 /  0. 17.103
   libpostproc    52.  3.100 / 52.  3.100
 Input #0, mpeg, from 'v1.mpg':
   Duration: 00:00:40.14, start: 0.500000, bitrate: 7713 kb/s
     Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p, 720x576 [SAR
 64:45 DAR 16:9], max. 9100 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
     Stream #0:1[0x80]: Audio: ac3, 48000 Hz, stereo, fltp, 256 kb/s
 Output #0, mpeg, to 'v11.mpg':
   Metadata:
     encoder         : Lavf55.13.102
     Stream #0:0: Audio: ac3, 48000 Hz, stereo, 256 kb/s
     Stream #0:1: Video: mpeg2video, yuv420p, 720x576 [SAR 64:45 DAR 16:9],
 q=2-31, max. 9100 kb/s, 25 fps, 90k tbn, 25 tbc
 Stream mapping:
   Stream #0:1 -> #0:0 (copy)
   Stream #0:0 -> #0:1 (copy)
 Press [q] to stop, [?] for help
 frame=  999 fps=533 q=-1.0 Lsize=   37800kB time=00:00:40.16
 bitrate=7710.6kbits/s
 video:36393kB audio:1255kB subtitle:0 global headers:0kB muxing overhead
 0.403831%



 % ffmpeg -i v2.mpg -c:a copy -c:v copy -nostats -map 0:1 -map 0:0 v22.mpg
 ffmpeg version N-55393-g3b2e99f Copyright (c) 2000-2013 the FFmpeg
 developers
   built on Aug  8 2013 21:32:57 with gcc 4.7.3 (GCC)
   configuration: --enable-gpl --enable-version3 --disable-w32threads
 --enable-av
 isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls
 --enab
 le-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-
 libfreetyp
 e --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame
 --ena
 ble-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg
 --enable-l
 ibopus --enable-librtmp --enable-libschroedinger --enable-libsoxr
 --enable-libsp
 eex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --enable-
 libvo-
 amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-
 libxavs --
 enable-libxvid --enable-zlib
   libavutil      52. 41.100 / 52. 41.100
   libavcodec     55. 24.100 / 55. 24.100
   libavformat    55. 13.102 / 55. 13.102
   libavdevice    55.  3.100 / 55.  3.100
   libavfilter     3. 82.100 /  3. 82.100
   libswscale      2.  4.100 /  2.  4.100
   libswresample   0. 17.103 /  0. 17.103
   libpostproc    52.  3.100 / 52.  3.100
 Input #0, mpeg, from 'v2.mpg':
   Duration: 00:02:09.82, start: 0.500000, bitrate: 7583 kb/s
     Stream #0:0[0x80]: Audio: ac3, 48000 Hz, stereo, fltp, 256 kb/s
     Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p, 720x576 [SAR
 64:45 DAR 16:9], max. 9100 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
 Output #0, mpeg, to 'v22.mpg':
   Metadata:
     encoder         : Lavf55.13.102
     Stream #0:0: Video: mpeg2video, yuv420p, 720x576 [SAR 64:45 DAR 16:9],
 q=2-31, max. 9100 kb/s, 25 fps, 90k tbn, 25 tbc
     Stream #0:1: Audio: ac3, 48000 Hz, stereo, 256 kb/s
 Stream mapping:
   Stream #0:1 -> #0:0 (copy)
   Stream #0:0 -> #0:1 (copy)
 Press [q] to stop, [?] for help
 frame= 3240 fps=324 q=-1.0 Lsize=  120176kB time=00:02:09.85
 bitrate=7581.3kbits/s
 video:115639kB audio:4058kB subtitle:0 global headers:0kB muxing overhead
 0.399988%
 }}}


 The results are different than expected: v11.mpg has changed the stream
 order of v1.mpg, but v22.mpg has the same stream order than v2.mpg:


 {{{
 % ffprobe v11.mpg
 Input #0, mpeg, from 'v11.mpg':
   Duration: 00:00:40.14, start: 0.500000, bitrate: 7713 kb/s
     Stream #0:0[0x80]: Audio: ac3, 48000 Hz, stereo, fltp, 256 kb/s
     Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p, 720x576 [SAR
 64:45 DAR 16:9], max. 9100 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc

 % ffprobe v22.mpg
 Input #0, mpeg, from 'v22.mpg':
   Duration: 00:02:09.82, start: 0.500000, bitrate: 7583 kb/s
     Stream #0:0[0x80]: Audio: ac3, 48000 Hz, stereo, fltp, 256 kb/s
     Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p, 720x576 [SAR
 64:45 DAR 16:9], max. 9100 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
 }}}

-- 
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/2876>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list