[FFmpeg-user] [HELP] ffmpeg how to arrange video , audio to the specific stream

Francois Visagie francois.visagie at gmail.com
Tue Aug 6 09:01:34 CEST 2013


> -----Original Message-----
> From: ffmpeg-user-bounces at ffmpeg.org [mailto:ffmpeg-user-
> bounces at ffmpeg.org] On Behalf Of Soho Soho123
> Sent: 06 August 2013 08:44
> To: FFmpeg user questions
> Subject: Re: [FFmpeg-user] [HELP] ffmpeg how to arrange video , audio to
> the specific stream
> 
> Hi ,
> 
> if I want to reverse the stream order ,
> where I should put the "-map 0:1 -map 0:0"?
> 
> for exampe :
> 
> ffmpeg -loglevel debug -f video4linux2 -r 30 -s 640x480 -input_format h264
-i
> /dev/video1 -f alsa -ar 48000 -ac 2 -i hw:0 -vcodec copy -acodec copy -map
0:1
> -map 0:0 http://localhost:8090/feed1.ffm
> 
> is the order correct if I put the "map" option ?
> 
> 
> 2013/8/6 Francois Visagie <francois.visagie at gmail.com>
> 
> > > -----Original Message-----
> > > From: ffmpeg-user-bounces at ffmpeg.org [mailto:ffmpeg-user-
> > > bounces at ffmpeg.org] On Behalf Of Soho Soho123
> > > Sent: 06 August 2013 08:16
> > > To: FFmpeg user questions and RTFMs
> > > Subject: [FFmpeg-user] [HELP] ffmpeg how to arrange video , audio to
> > > the specific stream
> > >
> > > hi All,
> > >
> > >
> > > the question is :
> > > how to set video to the specific stream how to set audio to the
> > > specific stream if I use ffmpeg to capture both video and audio
> > > simultaneously?
> > >
> > > for example :
> > > ffmpeg command:
> > > ffmpeg -loglevel debug -f video4linux2 -r 30 -s 640x480
> > > -input_format
> > h264
> > -i
> > > /dev/video1 -f alsa -ar 48000 -ac 2 -i hw:0 -vcodec copy -acodec
> > > copy http://localhost:8090/feed1.ffm
> > >
> > > I get the result :
> > > Output #0, ffm, to 'http://localhost:8090/feed1.ffm':
> > >   Metadata:
> > >     creation_time   : now
> > >     encoder         : Lavf55.12.100
> > >     Stream #0:0, 0, 1/1000000: Audio: pcm_s16be, 48000 Hz, stereo,
> > > 1536
> > kb/s
> > >     Stream #0:1, 0, 1/1000000: Video: h264, yuv420p, 640x480, 1/30,
> > q=2-31,
> > > -5 kb/s, 30 fps, 1000k tbn, 30 tbc
> > > Stream mapping:
> > >   Stream #1:0 -> #0:0 (copy)
> > >   Stream #0:0 -> #0:1 (copy)

When this changes to the order you want, you've done it right :-). The
streams are identified under "Metadata" above.

> > >
> > > how to modify the stream layout when capture video + audio?
> >
> > Do you mean you want to reverse the stream order in this instance? In
> > that case, use the -map option to enumerate streams in the order you
> > want them to appear in the output:
> >
> > -map 0:1 -map 0:0
> >
> > will put the 2nd stream (video in this case) first.
> >
> > > _______________________________________________
> > > ffmpeg-user mailing list
> > > ffmpeg-user at ffmpeg.org
> > > http://ffmpeg.org/mailman/listinfo/ffmpeg-user
> >
> > _______________________________________________
> > ffmpeg-user mailing list
> > ffmpeg-user at ffmpeg.org
> > http://ffmpeg.org/mailman/listinfo/ffmpeg-user
> >
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user



More information about the ffmpeg-user mailing list