[FFmpeg-user] multiple input video streams

Wes Morgan morganw at chemikals.org
Tue Mar 29 01:06:53 CEST 2011


On Tue, 29 Mar 2011, Rodney Baker wrote:

> On Mon, 28 Mar 2011 21:30:06 Wes Morgan wrote:
> > I'm trying to transcode an m2ts file that contains three video streams,
> > and I don't seem to be able to tell ffmpeg to use the first stream:
> >
> > /usr/local/bin/ffmpeg -i Frost-Nixon.m2ts -y -sn -sws_flags spline+sse2
> > -vtag X264 -threads 6 -map 0.0 -refs 5 -an -vcodec libx264 -passlogfile
> > Frost-Nixon.log -b 8771k -f matroska -vstats -vstats_file
> > Frost-Nixon-1.vstats -bf 3 -b_strategy 1 -coder 1 -cmp +chroma -directpred
> > 1 -flags +loop -g 250 -keyint_min 25 -level 41 -me_method dia -me_range 16
> > -sc_threshold 40 -deblockalpha -1 -deblockbeta -1 -partitions
> > -parti8x8-parti4x4-partp8x8-partp4x4-partb8x8 -i_qfactor 0.71 -qcomp 0.6
> > -subq 2 -qdiff 4 -qmax 51 -qmin 10 -trellis 0 -wpredp 2 -aq_mode 1
> > -rc_lookahead 40 -maxrate 40000k -bufsize 30000k -flags2
> > +wpred-mixed_refs-dct8x8+bpyramid+psy+ssim+mbtree -pass 1 /dev/null
>
> use -map 0.0 (for the video) and -map 0.x (subst x for whichever audio stream
> you want). You need to map each stream that you want in the output if you want
> fewer than what is in the source.

That doesn't seem to work properly. I'm already using -map 0.0 for the
video and -an to skip audio processing for remuxing later yet it seems to
ignore that and use the last video stream. Normally it exits because the
crop filter can't apply the parameters for the real stream 0 (which is HD,
others are SD), but if you remove it and encode say 30 seconds of video,
you have an SD resolution file.

> You should also consider using the x264 presets unless you have a specific
> reason to specify all the parameters yourself on the command line. You can
> even write your own preset file with the specific options that you want, store
> in the preset directory and then call it with -vpre <mypresetname>.

It's all part of a python script for transcoding video; it's just easier
for me to maintain it with everything in one place.

Thanks!

>
> >
> > Input #0, mpegts, from 'Frost-Nixon.m2ts':
> >   Duration: 02:01:51.50, start: 11.650667, bitrate: 34626 kb/s
> >   Program 1
> >     Stream #0.0[0x1011]: Video: vc1 (Advanced), yuv420p, 1920x1080 [PAR 1:1
> > DAR 16:9], 23.98 fps, 23.98 tbr, 90k tbn, 23.98 tbc Stream #0.1[0x1100]:
> > Audio: dca (DTS-HD MA), 48000 Hz, 5.1, s16, 1536 kb/s Stream #0.2[0x1101]:
> > Audio: dca (DTS), 48000 Hz, 5.1, s16, 768 kb/s Stream #0.3[0x1102]: Audio:
> > dca (DTS), 48000 Hz, 5.1, s16, 768 kb/s Stream #0.4[0x1103]: Audio: ac3,
> > 48000 Hz, stereo, s16, 192 kb/s Stream #0.5[0x1200]: Subtitle: pgssub
> >     Stream #0.6[0x1201]: Subtitle: pgssub
> >     Stream #0.7[0x1202]: Subtitle: pgssub
> >     Stream #0.8[0x1203]: Subtitle: pgssub
> >     Stream #0.9[0x1204]: Subtitle: pgssub
> >     Stream #0.10[0x1a00]: Data: [162][0][0][0] / 0x00A2
> >     Stream #0.11[0x1a01]: Data: [162][0][0][0] / 0x00A2
> >     Stream #0.12[0x1b00]: Video: vc1 (Advanced), yuv420p, 720x480 [PAR
> > 40:33 DAR 20:11], 23.98 fps, 23.98 tbr, 90k tbn, 23.98 tbc Stream
> > #0.13[0x1b01]: Video: vc1 (Advanced), yuv420p, 720x480 [PAR 40:33 DAR
> > 20:11], 23.98 fps, 23.98 tbr, 90k tbn, 23.98 tbc Output #0, matroska, to
> > '/dev/null':
> >   Metadata:
> >     encoder         : Lavf52.103.0
> >     Stream #0.0: Video: libx264, yuv420p, 720x480 [PAR 40:33 DAR 20:11],
> > q=10-51, pass 1, 8771 kb/s, 1k tbn, 23.98 tbc Stream mapping:
> >   Stream #0.0 -> #0.0
> >
> > Note that it *claims* 0.0 -> 0.0, but the video is listed as 720x480.
> > Anyone know what I'm doing wrong here?
> >
> >
> > Thanks!
> >
> > _______________________________________________
> > ffmpeg-user mailing list
> > ffmpeg-user at ffmpeg.org
> > http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
>


More information about the ffmpeg-user mailing list