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

Soho Soho123 soho123.2012 at gmail.com
Tue Aug 6 09:09:34 CEST 2013


Hi ,

I still get the error when I use "map" option.

# 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:0 -
map 0:1 http://localhost:8090/feed1.ffm
ffmpeg version 2.0 Copyright (c) 2000-2013 the FFmpeg developers
  built on Aug  6 2013 13:22:29 with gcc 4.4.5-1.5.5p4 (GCC)
  configuration: --enable-cross-compile --cross-prefix=sdk-linux-
--arch=mips --target-os=linux --disable-doc --disable-htmlpages
--disable-manpages --disable-podpages --disable-txtpages --disable-mips32r2
--disable-ffplay --disable-postproc --disable-runtime-cpudetect
--disable-swscale-alpha --disable-mipsdspr1 --disable-mipsdspr2
--disable-mipsfpu --enable-small --prefix=/ffmpeg-2.0/romfs
--bindir=/ffmpeg-2.0/romfs --disable-bsfs --disable-filters --enable-gpl
--enable-libfaac --enable-nonfree --enable-libx264
--extra-cflags=-I/ShareLib_Install/bin/../include
--extra-libs='-L/ShareLib_Install/bin/../lib -lx264'
--enable-filter='aformat,aresample,anull,copy,format,fps,framestep,resample'
libavutil      52. 38.100 / 52. 38.100
  libavcodec     55. 18.102 / 55. 18.102
  libavformat    55. 12.100 / 55. 12.100
  libavdevice    55.  3.100 / 55.  3.100
  libavfilter     3. 79.101 /  3. 79.101
  libswscale      2.  3.100 /  2.  3.100
  libswresample   0. 17.102 /  0. 17.102
Splitting the commandline.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging
level) with argument 'debug'.
Reading option '-f' ... matched as option 'f' (force format) with argument
'video4linux2'.
Reading option '-r' ... matched as option 'r' (set frame rate (Hz value,
fraction or abbreviation)) with argument '30'.
Reading option '-s' ... matched as option 's' (set frame size (WxH or
abbreviation)) with argument '640x480'.
Reading option '-input_format' ... matched as AVOption 'input_format' with
argument 'h264'.
Reading option '-i' ... matched as input file with argument '/dev/video1'.
Reading option '-f' ... matched as option 'f' (force format) with argument
'alsa'.
Reading option '-ar' ... matched as option 'ar' (set audio sampling rate
(in Hz)) with argument '48000'.
Reading option '-ac' ... matched as option 'ac' (set number of audio
channels) with argument '2'.
Reading option '-i' ... matched as input file with argument 'hw:0'.
Reading option '-vcodec' ... matched as option 'vcodec' (force video codec
('copy' to copy stream)) with argument 'copy'.
Reading option '-acodec' ... matched as option 'acodec' (force audio codec
('copy' to copy stream)) with argument 'copy'.
Reading option '-map' ... matched as option 'map' (set input stream
mapping) with argument '0:0'.
Reading option '-map' ... matched as option 'map' (set input stream
mapping) with argument '0:1'.
Reading option 'http://localhost:8090/feed1.ffm' ... matched as output file.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set logging level) with argument debug.
Successfully parsed a group of options.
Parsing a group of options: input file /dev/video1.
Applying option f (force format) with argument video4linux2.
Applying option r (set frame rate (Hz value, fraction or abbreviation))
with argument 30.
Applying option s (set frame size (WxH or abbreviation)) with argument
640x480.
Successfully parsed a group of options.
Opening an input file: /dev/video1.
[video4linux2,v4l2 @ 0x71ed40] fd:3 capabilities:4000001
[video4linux2,v4l2 @ 0x71ed40] Current input_channel: 0, input_name: Camera
1
[video4linux2,v4l2 @ 0x71ed40] Setting time per frame to 1/30
[video4linux2,v4l2 @ 0x71ed40] All info found
Input #0, video4linux2,v4l2, from '/dev/video1':
  Duration: N/A, start: 1193.780000, bitrate: N/A
    Stream #0:0, 8, 1/1000000: Video: h264, yuv420p, 640x480, 1/2000000, -5
kb/s, 30 fps, 30 tbr, 1000k tbn, 2000k tbc
Successfully opened the file.
Parsing a group of options: input file hw:0.
Applying option f (force format) with argument alsa.
Applying option ar (set audio sampling rate (in Hz)) with argument 48000.
Applying option ac (set number of audio channels) with argument 2.
Successfully parsed a group of options.
Opening an input file: hw:0.
[alsa @ 0x79ca50] All info found
Guessed Channel Layout for  Input Stream #1.0 : stereo
Input #1, alsa, from 'hw:0':
  Duration: N/A, start: 1375801320.208875, bitrate: N/A
    Stream #1:0, 1, 1/1000000: Audio: pcm_s16be, 48000 Hz, stereo, 1536 kb/s
Successfully opened the file.
Parsing a group of options: output file http://localhost:8090/feed1.ffm.
Applying option vcodec (force video codec ('copy' to copy stream)) with
argument copy.
Applying option acodec (force audio codec ('copy' to copy stream)) with
argument copy.
Applying option map (set input stream mapping) with argument 0:0.
Applying option map (set input stream mapping) with argument 0:1.
Stream map '0:1' matches no streams.



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: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
>
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>


More information about the ffmpeg-user mailing list