Recording audio with FFMPEG works in terminal but not through exec() of PHP -
i use command record audio , video webcam in terminal , works!
ffmpeg -f video4linux2 -r 25 -sameq -s 640x480 -i /dev/video0 -f alsa -i plughw:0,0 -ar 22050 -ab 128k -y webcam.flv
but when through php, this:
echo shell_exec('ffmpeg -f video4linux2 -r 25 -sameq -s 640x480 -i /dev/video0 -f alsa -i plughw:0,0 -ar 22050 -ab 128k -y webcam.flv 2>&1 &');
i receive log:
ffmpeg version 0.8.6-4:0.8.6-0ubuntu0.12.04.1, copyright (c) 2000-2013 libav developers built on apr 2 2013 17:02:36 gcc 4.6.3 * program deprecated * program provided compatibility , removed in future release. please use avconv instead. [video4linux2 @ 0x23579a0] estimating duration bitrate, may inaccurate input #0, video4linux2, '/dev/video0': duration: n/a, start: 4868.729067, bitrate: 122880 kb/s stream #0.0: video: rawvideo, yuyv422, 640x480, 122880 kb/s, 25 tbr, 1000k tbn, 25 tbc home directory /var/www not ours.
alsa lib pcm_hw.c:1401:(_snd_pcm_hw_open) invalid value card [alsa @ 0x23589e0] cannot open audio device plughw:0,0 (no such file or directory) plughw:0,0: input/output error
before got mic device problem having problem webcam device's permissions, did:
sudo chmod -r 777 /dev/video0
and video capture ready used! got mic device problem!
i think can permissions too, dont know linux , have no idea how fix that!
thanks!
i found solution! =x
sudo chmod -r 666 /dev/snd/*
Comments
Post a Comment