Currently I have a mic and a webcam connected to my computer. I am running ffmpeg on CentOS 6.3.
When I try to record a video without audio by:
ffmpeg -y -f video4linux2 -t 15 -s 640x480 -r 25 -i /dev/video0 /home/irdb/Desktop/out2.mp4
it runs perfectly and I get a nice video. However when I try to run with audio included by:
ffmpeg -y -f video4linux2 -t 15 -s 640x480 -r 25 -i /dev/video0 -f alsa -ar 22050 -ab 64k -ac 2 -i default /home/irdb/Desktop/out2.mp4
It errors out and prints:
[NULL @ 0x1e33fc0] Codec is experimental but experimental codecs are not enabled, see -strict -2 Output #0, mp4, to '/home/irdb/Desktop/out2.mp4': Stream #0:0: Video: h264, yuv420p, 640x480, q=-1--1, 90k tbn, 25 tbc Stream #0:1: Audio: none, 22050 Hz, 2 channels, flt, 128 kb/s Stream mapping: Stream #0:0 -> #0:0 (rawvideo -> libx264) Stream #1:0 -> #0:1 (pcm_s16le -> aac) Error while opening encoder for output stream #0:1 - maybe incorrect parameters such as bit_rate, rate, width or height
I assume this has to do with the first error as when I use something like mpg it works just fine. However I plan on streaming this live and want mp4 format as that is pretty much supported by all browsers (Firefox with flash fallback).
Does anyone know how to get the audio to work without additional processing (as I want to stream live and not write to a file eventually).