[FFmpeg-user] multiple input video streams
morganw at chemikals.org
Wed Mar 30 13:20:47 CEST 2011
On Tue, 29 Mar 2011, Rodney Baker wrote:
> On Tue, 29 Mar 2011 09:36:53 Wes Morgan wrote:
> > 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.
> The order of options is important. Try the -map 0.0 after -vcodec. Put -an
> last before your output file (after all the video codec parameters).
Tried moving the -map options all over the place, to no avail. Strangely
enough, if I do -map 0.12 it will use the proper stream, so it might just
be a problem with the options parser. Will have to look at that later.
> > > 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!
> Fair enough - it must makes it a lot harder to read the command line to see
> what options you're using and what might be causing the problem (which is why
> I missed the -map 0.0 the first time). :-)
More information about the ffmpeg-user