[FFmpeg-user] Concat specific streams from 2 files

Hans Carlson forbyta at gmx.com
Mon Nov 7 03:22:32 EET 2016


On Sun, 6 Nov 2016, Moritz Barsnick wrote:

> On Sun, Nov 06, 2016 at 14:23:02 -0800, Hans Carlson wrote:
>
> Well, this is certainly part of your issue with merging: The "file"
> directive comes before its details. The docs say:
>
>  All subsequent file-related directives apply to that file.

Well, that was my first inclination, at least it seemed the most logical, 
but the only real example I could find that used "stream/exact_stream_id" 
is the output from the dvd2concat command (from the ffmpeg/tools 
directory).  The output it creates lists all the streams first, then all 
the files.

At any rate, I tried with the file directive before the stream directive 
and it didn't make any difference... same results:


$ ffmpeg -f concat -i files.txt -codec copy -f vob TEST.mpg
ffmpeg version N-82261-g2d72ea6 Copyright (c) 2000-2016 the FFmpeg developers
   built with gcc 4.9.2 (GCC) 20150212 (Red Hat 4.9.2-6)
   configuration: --enable-gpl --enable-version3 --enable-nonfree --disable-static --enable-shared --disable-debug --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-x11grab --disable-ffplay --disable-ffserver
   libavutil      55. 35.100 / 55. 35.100
   libavcodec     57. 66.101 / 57. 66.101
   libavformat    57. 57.100 / 57. 57.100
   libavdevice    57.  2.100 / 57.  2.100
   libavfilter     6. 66.100 /  6. 66.100
   libswscale      4.  3.100 /  4.  3.100
   libswresample   2.  4.100 /  2.  4.100
   libpostproc    54.  2.100 / 54.  2.100
Input #0, concat, from 'files.txt':
   Duration: N/A, start: 0.000000, bitrate: N/A
     Stream #0:0: Video: mpeg2video (Main), yuv420p(tv, bottom first), 720x480 [SAR 32:27 DAR 16:9], 29.67 fps, 59.94 tbr, 90k tbn, 90k tbc
     Stream #0:1: Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s
     Stream #0:2: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
     Stream #0:3: Video: mpeg2video (Main), yuv420p(tv, bottom first), 720x480 [SAR 32:27 DAR 16:9], 29.67 fps, 59.94 tbr, 90k tbn, 90k tbc
     Stream #0:4: Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s
     Stream #0:5: Audio: ac3, 48000 Hz, 5.1(side), fltp, 384 kb/s
[vob @ 0x1154500] VBV buffer size not set, using default size of 130KB
If you want the mpeg file to be compliant to some specification
Like DVD, VCD or others, make sure you set the correct buffer size
Output #0, vob, to 'TEST.mpg':
   Metadata:
     encoder         : Lavf57.57.100
     Stream #0:0: Video: mpeg2video (Main), yuv420p(tv, bottom first), 720x480 [SAR 32:27 DAR 16:9], q=2-31, 29.67 fps, 59.94 tbr, 90k tbn, 90k tbc
     Stream #0:1: Audio: ac3, 48000 Hz, 5.1(side), 448 kb/s
Stream mapping:
   Stream #0:3 -> #0:0 (copy)
   Stream #0:4 -> #0:1 (copy)
Press [q] to stop, [?] for help
[vob @ 0x1154500] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
[vob @ 0x1154500] Non-monotonous DTS in output stream 0:1; previous: 898560, current: -9223372028264793088; changing to 898561. This may result in incorrect timestamps in the output file.
Segmentation fault (core dumped)

$ cat files.txt
file TEST-1.mpg
stream
exact_stream_id 0x1E0
stream
exact_stream_id 0x80
stream
exact_stream_id 0x84

file TEST-2.mpg
stream
exact_stream_id 0x1E0
stream
exact_stream_id 0x80
stream
exact_stream_id 0x81


More information about the ffmpeg-user mailing list