2

I'm trying to set up a webcam with a raspberry pi 2 that I can view from VLC media player on another computer. I followed the tutorial here to get video only working, but his other tutorial that involved audio didn't work for me.

Here are the settings that worked for me with video for ffserver -f webcam.conf:

HTTPPort 80
HTTPBindAddress 0.0.0.0
MaxClients 10
MaxBandwidth 50000

<Feed webcam.ffm>

File /tmp/web.ffm
FileMaxSize 10M

</Feed>

<Stream webcam.mjpeg>

Feed webcam.ffm
Format mjpeg
VideoSize 320x240
VideoFrameRate 10
VideoBitRate 20000
VideoQMin 1
VideoQMax 10

</Stream>

<Stream stat.html>
Format status
</Stream>

Then I was able to run it with this command:

ffserver -f webcam.conf & ffmpeg -v verbose -r 5 -s 320x240 \
-f video4linux2 -i /dev/video0 http://0.0.0.0/webcam.ffm

I tried a couple different file formats to get audio working, the tutorial suggests avi, but that didn't work and the ffmpeg documentation explains why it shouldn't. So I tried asf, rm, and mpeg as well. With asf I was able to get a grey screen in VLC, but no real video or audio. Here's the configuration changes:

<Stream test.asf>
Feed webcam.ffm
Format asf
VideoCodec msmpeg4v2
VideoFrameRate 15
VideoSize vga
VideoBitRate 320
VideoBufferSize 40
VideoGopSize 15
AudioBitRate 64
# StartSendOnKey
</Stream>

And the command I tried to run it:

ffmpeg -thread_queue_size 512 -v verbose -f video4linux2 -r 3 \
-i /dev/video0 -f alsa -ac 1 -i hw:1 http:/0.0.0.0/webcam.ffm

I've read some articles that mentioned a delay, but I kept it running for at least 30 minutes and got nothing but grey. I feel like I'm just not getting the right combination of settings between my ffserver config and the ffmpeg command I'm running to stream it. What am I missing? Alternatively, is there a different media player I should be using to view my streams?

0

You must log in to answer this question.

Browse other questions tagged .