Como concatir arquivos VOB com o ffmpeg usando o mapeamento de fluxo?

2

Eu tenho 5 arquivos VOB, gostaria de concatenciá-los em um grande arquivo mpegts e manter apenas o fluxo de vídeo e o último (terceiro) fluxo de áudio. Infelizmente, a ordem do fluxo é diferente nos VOBs:

    Input #0, mpeg, from 'VTS_01_1.VOB':
      Duration: 00:25:03.00, start: 0.280633, bitrate: 5715 kb/s
        Stream #0:0[0x1bf]: Data: dvd_nav_packet
        Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p(tv), 720x576 [SAR 64:45 DAR 16:9], max. 7500 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
        Stream #0:2[0x20]: Subtitle: dvd_subtitle
        Stream #0:3[0x80]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
        Stream #0:4[0x81]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
        Stream #0:5[0x82]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
    [mpeg2video @ 0x82d3600] Invalid frame dimensions 0x0.
        Last message repeated 5 times

Input #1, mpeg, from 'VTS_01_2.VOB':
      Duration: 00:24:51.03, start: 1503.128633, bitrate: 5761 kb/s
        Stream #1:0[0x1e0]: Video: mpeg2video (Main), yuv420p(tv), 720x576 [SAR 64:45 DAR 16:9], max. 7500 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
        Stream #1:1[0x21]: Subtitle: dvd_subtitle
        Stream #1:2[0x80]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
        Stream #1:3[0x81]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
        Stream #1:4[0x82]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
        Stream #1:5[0x1bf]: Data: dvd_nav_packet
        Stream #1:6[0x20]: Subtitle: dvd_subtitle
    [mpeg2video @ 0x86aff00] Invalid frame dimensions 0x0.
        Last message repeated 8 times

Input #2, mpeg, from 'VTS_01_3.VOB':
      Duration: 00:24:17.94, start: 2993.976633, bitrate: 5891 kb/s
        Stream #2:0[0x1e0]: Video: mpeg2video (Main), yuv420p(tv), 720x576 [SAR 64:45 DAR 16:9], max. 7500 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
        Stream #2:1[0x80]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
        Stream #2:2[0x81]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
        Stream #2:3[0x82]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
        Stream #2:4[0x1bf]: Data: dvd_nav_packet
        Stream #2:5[0x20]: Subtitle: dvd_subtitle
        Stream #2:6[0x21]: Subtitle: dvd_subtitle
    [mpeg2video @ 0x868fc20] Invalid frame dimensions 0x0.
        Last message repeated 8 times

Input #3, mpeg, from 'VTS_01_4.VOB':
      Duration: 00:24:38.52, start: 4451.800633, bitrate: 5809 kb/s
        Stream #3:0[0x1e0]: Video: mpeg2video (Main), yuv420p(tv), 720x576 [SAR 64:45 DAR 16:9], max. 7500 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
        Stream #3:1[0x80]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
        Stream #3:2[0x81]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
        Stream #3:3[0x82]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
        Stream #3:4[0x1bf]: Data: dvd_nav_packet
    [mpeg2video @ 0x83a4aa0] Invalid frame dimensions 0x0.
        Last message repeated 9 times

Input #4, mpeg, from 'VTS_01_5.VOB':
      Duration: 00:02:45.18, start: 5930.104633, bitrate: 5897 kb/s
        Stream #4:0[0x1e0]: Video: mpeg2video (Main), yuv420p(tv), 720x576 [SAR 64:45 DAR 16:9], max. 7500 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
        Stream #4:1[0x80]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
        Stream #4:2[0x81]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
        Stream #4:3[0x82]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
        Stream #4:4[0x1bf]: Data: dvd_nav_packet

Então eu tentei este comando:

ffmpeg -y f concat -i list.txt -map 0:v -map 0:a:2 -map 1:v -map 1:a:2 -map 2:v -map 2:a:2 -map 3:v -map 3:a:2 -map 4:v -map 4:a:2 -c copy -f mpegts joined.mpeg

Onde list.txt contém

file VTS_01_1.VOB
file VTS_01_2.VOB
file VTS_01_3.VOB
file VTS_01_4.VOB
file VTS_01_5.VOB

Infelizmente, não funciona, resultado completo:

ffmpeg -y -f concat -i list.txt -map 0:v -map 0:a:2 -map 1:v -map 1:a:2 -map 2:v -map 2:a:2 -map 3:v -map 3:a:2 -map 4:v -map 4:a:2 -c copy -f mpegts joined.mpeg
ffmpeg version 2.3.1 Copyright (c) 2000-2014 the FFmpeg developers
  built on Jul 31 2014 14:53:16 with gcc 4.9.1 (GCC)
  configuration: --prefix=/usr --disable-debug --disable-static --enable-avisynth --enable-avresample --enable-decoder=atrac3 --enable-decoder=atrac3p --enable-dxva2 --enable-fontconfig --enable-gnutls --enable-gpl --enable-libass --enable-libbluray --enable-libfreetype --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libv4l2 --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-pic --enable-postproc --enable-runtime-cpudetect --enable-shared --enable-swresample --enable-vdpau --enable-version3 --enable-x11grab
  libavutil      52. 92.100 / 52. 92.100
  libavcodec     55. 69.100 / 55. 69.100
  libavformat    55. 48.100 / 55. 48.100
  libavdevice    55. 13.102 / 55. 13.102
  libavfilter     4. 11.100 /  4. 11.100
  libavresample   1.  3.  0 /  1.  3.  0
  libswscale      2.  6.100 /  2.  6.100
  libswresample   0. 19.100 /  0. 19.100
  libpostproc    52.  3.100 / 52.  3.100
[concat @ 0x893b1c0] Estimating duration from bitrate, this may be inaccurate
Input #0, concat, from 'list.txt':
  Duration: 00:00:00.00, start: 0.000000, bitrate: 573 kb/s
    Stream #0:0: Data: dvd_nav_packet
    Stream #0:1: Video: mpeg2video (Main), yuv420p(tv), 720x576 [SAR 64:45 DAR 16:9], max. 7500 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:2: Subtitle: dvd_subtitle
    Stream #0:3: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
    Stream #0:4: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
    Stream #0:5: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
Invalid input file index: 1.

Como posso alcançar a concatenação com o mapeamento de fluxo aplicado?

    
por Konstantin 06.08.2014 / 20:42

1 resposta

3

Você pode usar o comando cat do shell para concatenar os arquivos .vob em um.

Aqui está um exemplo:

Para concatenar file1.vob , file2.vob e file3.vob de dentro do mesmo diretório em Allfiles.vob , você pode usar o seguinte comando:

cat file*.vob > Allfiles.vob
    
por 19.02.2015 / 08:15