[FFmpeg-user] Issue with map command

Saket Sinha saket.sinha89 at gmail.com
Thu Oct 31 06:46:37 CET 2013


Hi,

I am facing some issue with the map command .
>From the documentation, I can make out that map command is used to direct
streams in the following ways-

*map x:y -* where *x* is the input file index and *y* the stream index in
that file, both starting at 0.

Now kindly have a look how map is used with 1 audio and 1 video source to
direct the output to single output file-
*
ffmpeg \
-f video4linux2 -r 25 -i /dev/video0 \
-f  alsa -i plughw:PCH -ar 22050 -ab 64k -strict experimental \
 -map 0:0 -map 1:0 \
-y webcam.mp4
*

and how map is used with 2 video sources(1 Ip camera 1 usb webcam) to
direct the output to two different output files-
*ffmpeg \
-f video4linux2 -r 25 -i /dev/video0 \
-f mjpeg -i http://admin:dlink123@192.168.1.21:80/video/mjpg.cgi \
-map 0:0 -map 1:0 \
-vcodec mpeg4 \
-y webcam7.mp4 -y webcam8.mp4
*

I dont think I can map to video on tha same file and it is also not
required.

My ogjective is to get ffmpeg work for the followingr-

a)2 video sources and a single audio source to direct the output to two
different output files(having same audio and different video)-
*ffmpeg \
-f video4linux2 -r 25 -i /dev/video0 \
-f mjpeg -i http://admin:dlink123@192.168.1.21:80/video/mjpg.cgi \
-f alsa -i plughw:PCH,0 -ar 22050 -ab 64k -strict experimental \
 -map 0:v:0 -map 2:a:0 -map 1:v:0 -map 2:a:0 \
-acodec aac -vcodec mpeg4 \
-y webcam7.mp4 -y webcam8.mp4
*

b)2 video sources and 2 audio sources to direct the output to two different
output files(having different audio and different video)-

*ffmpeg \
-f video4linux2 -r 25 -i /dev/video0 \
-f mjpeg -i http://admin:dlink123@192.168.1.21:80/video/mjpg.cgi \
-f alsa -i plughw:PCH,0 -ar 22050 -ab 64k -strict experimental \
**-f alsa -i plughw:CMI8738,0 -ar 22050 -ab 64k -strict experimental \
 -map 0:v:0 -map 2:a:0 -map 1:v:0 -map 3:a:0 \
-acodec aac -vcodec mpeg4 \
-y webcam7.mp4 -y webcam8.mp4
*
But I am getting errors in both. Kindly help.


Regards,
Saket Sinha


More information about the ffmpeg-user mailing list