[FFmpeg-user] Question about splitting video with dvd_nav_packet data streams

David Favor david at davidfavor.com
Sun Dec 29 05:15:36 CET 2013


I have around 100 VOB files (format @ end).

My goal is to process every stream as follows...

1) adjust volume

2) reduce bitrate

3) retain all data streams (varies 1-3 data streams/VOB file)

Questions...

Probably the easiest way to handle this is just to split all the streams into separate
files... process them... reassemble them...

1) I'm familiar with -c:v + -c:a usage... Someone let me know how to reference data streams,
    as the docs appear wrong... for example... this fails...

     ffmpeg -i VTS_01_0.VOB -c:d:0 copy -c:v:1 copy -c:a:2 copy foo.vob

     rather than a straight copy... this drops the data stream + re-encodes audio to mp2.

     So first question is just how to do a straight copy, so eventually I can do all my
     processing by substituting filters where required.

     These all fail...

     - ffmpeg -i VTS_01_0.VOB -map 0 -c:d:0 copy -map 0 -c:v:1 copy -map 0 -c:a:2 copy foo.vob
       Input #0, mpeg, from 'VTS_01_0.VOB':
          Duration: 00:00:33.99, start: 0.300300, bitrate: 80296 kb/s
       Stream #0:0[0x1bf]: Data: dvd_nav_packet
       Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, smpte170m), 720x480 [SAR 8:9 DAR 4:3], max. 8000 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 
59.94 tbc
       Stream #0:2[0xa0]: Audio: pcm_dvd, 48000 Hz, stereo, s16, 1536 kb/s
       Data stream encoding not supported yet (only streamcopy)

     - ffmpeg -i VTS_01_0.VOB -map 0 -c:d:0 copy -c:v:1 copy -c:a:2 copy foo.vob

       Output #0, svcd, to 'foo.vob':
       Metadata:
         encoder         : Lavf55.22.100
         Stream #0:0: Data: dvd_nav_packet
         Stream #0:1: Video: mpeg2video, yuv420p, 720x480 [SAR 8:9 DAR 4:3], q=2-31, 200 kb/s, 90k tbn, 29.97 tbc
         Stream #0:2: Audio: mp2, 48000 Hz, stereo, s16, 128 kb/s
       Stream mapping:
         Stream #0:0 -> #0:0 (copy)
         Stream #0:1 -> #0:1 (mpeg2video -> mpeg2video)
         Stream #0:2 -> #0:2 (pcm_dvd -> mp2)
       Could not write header for output file #0 (incorrect codec parameters ?): Operation not permitted

     - ffmpeg -i VTS_01_0.VOB -map 0:0 -c copy -map 0:1 -c copy -map 0:2 -c copy foo.vob

       Output #0, svcd, to 'foo.vob':
         Metadata:
           encoder         : Lavf55.22.100
           Stream #0:0: Data: dvd_nav_packet
           Stream #0:1: Video: mpeg2video, yuv420p, 720x480 [SAR 8:9 DAR 4:3], q=2-31, max. 8000 kb/s, 29.97 fps, 90k tbn, 29.97 tbc
           Stream #0:2: Audio: pcm_dvd, 48000 Hz, stereo, 1536 kb/s
       Stream mapping:
         Stream #0:0 -> #0:0 (copy)
         Stream #0:1 -> #0:1 (copy)
         Stream #0:2 -> #0:2 (copy)
       Could not write header for output file #0 (incorrect codec parameters ?): Operation not permitted

2) Next question is syntax to extract each stream into a separate file + then reassemble
    all components back into a VOB container. The following extracts the first audio + first
    video stream correctly + the data stream fails because of an incorrect extension...

    So question is, what's the correct extension for extracting data streams...

    ffmpeg -y -i VTS_01_0.VOB -c:a pcm_s16le -ar 44100 -ac 2 foo.wav -map 0:1 -c:v copy foo.vob -map 0:1 -c:d copy foo.data

    Input #0, mpeg, from 'VTS_01_0.VOB':
      Duration: 00:00:33.99, start: 0.300300, bitrate: 80296 kb/s
        Stream #0:0[0x1bf]: Data: dvd_nav_packet
        Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, smpte170m), 720x480 [SAR 8:9 DAR 4:3], max. 8000 kb/s, 29.97 fps, 29.97 tbr, 90k 
tbn, 59.94 tbc
        Stream #0:2[0xa0]: Audio: pcm_dvd, 48000 Hz, stereo, s16, 1536 kb/s
    [NULL @ 0x7fb0f2038600] Unable to find a suitable output format for 'foo.data'
    foo.data: Invalid argument

David-Favor-iMac> ffmpeg -i VTS_01_0.VOB
ffmpeg version 2.1.1-2013-12-29-59404-g54bb30b Copyright (c) 2000-2013 the FFmpeg developers
   built on Dec 28 2013 20:05:13 with gcc 4.8.2 (MacPots gcc48 4.8.2_0)
   configuration: --prefix=/david-favor-tools/osx-10.9 --enable-pic --enable-gpl --disable-debug --extra-cflags='-I/david-favor-tools/osx-10.9/include 
-I/opt/local/include -I/usr/local/include -I/usr/include' --extra-ldflags='-Wl,-rpath,/david-favor-tools/osx-10.9/lib -Wl,-rpath,/opt/local/lib 
-Wl,-rpath,/usr/local/lib -Wl,-rpath,/usr/lib -L/david-favor-tools/osx-10.9/lib -L/opt/local/lib -L/usr/local/lib -L/usr/lib' --enable-version3 
--enable-shared --disable-static --enable-ffplay --enable-ffprobe --enable-ffserver --enable-runtime-cpudetect --enable-nonfree --enable-zlib 
--enable-bzlib --enable-openssl --enable-libmp3lame --enable-libfaac --enable-libfdk_aac --enable-libvpx --enable-libtheora --enable-libvorbis 
--enable-libxvid --enable-libopus --enable-libopenjpeg --enable-libx264 --enable-postproc --enable-frei0r --enable-libopencore-amrnb 
--enable-libfreetype --enable-libmodplug --enable-libass --enable-openssl
   libavutil      52. 59.100 / 52. 59.100
   libavcodec     55. 47.100 / 55. 47.100
   libavformat    55. 22.100 / 55. 22.100
   libavdevice    55.  5.102 / 55.  5.102
   libavfilter     4.  0.103 /  4.  0.103
   libswscale      2.  5.101 /  2.  5.101
   libswresample   0. 17.104 /  0. 17.104
   libpostproc    52.  3.100 / 52.  3.100
Guessed Channel Layout for  Input Stream #0.2 : stereo
Input #0, mpeg, from 'VTS_01_0.VOB':
   Duration: 00:00:33.99, start: 0.300300, bitrate: 80296 kb/s
     Stream #0:0[0x1bf]: Data: dvd_nav_packet
     Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, smpte170m), 720x480 [SAR 8:9 DAR 4:3], max. 8000 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 
59.94 tbc
     Stream #0:2[0xa0]: Audio: pcm_dvd, 48000 Hz, stereo, s16, 1536 kb/s


More information about the ffmpeg-user mailing list