2

I'm getting (two alternating) errors following this guide for streaming from a Raspberry Pi. Are there any other grabbers besides V4L2 that I can use with ffmpeg?

Or are there any other streaming setups I could try? I gave 'motion' a go but it was very jerky and couldn't get more than a couple of fps at 160x120.

I also tried VLC but got an error with that. (Something about ALSA - I'm guessing because neither the RPi or webcam have a microphone or other audio input).

(And yes, the webcam does work with the RPi, I have managed to view it using guvcview.)

Thanks!

Edit 1 As far as I can tell, just about everything (e.g. VLC, motion, etc) use V4L2, so it looks like there's no alternatives.

Edit 2 : Below is one configuration I've used and the results. This is now a third problem. I can't replicate the other two error messages while running ffmpeg/server that I had. I've run top and there is next to no CPU usage by other processes. Of concern is that the webcam seems to always force raw capture at 30fps. In some configurations the system copes but at a low output FPS (as with motion), and other times it throws one error or another.

Command:

ffserver -f ~/ffserver3.conf & ffmpeg -v verbose -r 1 -s 320x240 -f video4linux2 -i /dev/video0 http://localhost:8080/webcam.ffm

ffserver3.conf:

Port 8080
BindAddress 0.0.0.0
MaxClients 10
MaxBandwidth 50000
NoDaemon

<Feed webcam.ffm>
file /tmp/webcam.ffm
FileMaxSize 10M
</Feed>

<Stream webcam.mjpeg>
Feed webcam.ffm
Format mjpeg
VideoSize 320x240
VideoFrameRate 1
VideoBitRate 50000
VideoQMin 1
VideoQMax 10
</Stream>

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

Result:

ffmpeg version N-51221-gdda04a5 Copyright (c) 2000-2013 the FFmpeg developers
  built on Mar 23 2013 02:21:23 with gcc 4.6 (Debian 4.6.3-12+rpi1)
  configuration:
  libavutil      52. 22.101 / 52. 22.101
  libavcodec     55.  1.100 / 55.  1.100
  libavformat    55.  0.100 / 55.  0.100
  libavdevice    55.  0.100 / 55.  0.100
  libavfilter     3. 48.100 /  3. 48.100
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
[video4linux2,v4l2 @ 0x256c4b0] fd:3 capabilities:4000001
[video4linux2,v4l2 @ 0x256c4b0] The driver changed the time per frame from 1/1 to 1/30
ffserver version N-51221-gdda04a5 Copyright (c) 2000-2013 the FFmpeg developers
  built on Mar 23 2013 02:21:23 with gcc 4.6 (Debian 4.6.3-12+rpi1)
  configuration:
  libavutil      52. 22.101 / 52. 22.101
  libavcodec     55.  1.100 / 55.  1.100
  libavformat    55.  0.100 / 55.  0.100
  libavdevice    55.  0.100 / 55.  0.100
  libavfilter     3. 48.100 /  3. 48.100
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
[video4linux2,v4l2 @ 0x256c4b0] ioctl(VIDIOC_DQBUF): Input/output error
[video4linux2,v4l2 @ 0x256c4b0] Estimating duration from bitrate, this may be inaccurate
Input #0, video4linux2,v4l2, from '/dev/video0':
  Duration: N/A, bitrate: 36864 kb/s
    Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 320x240, 36864 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc
[http @ 0x256d3c0] HTTP error 503 Server too busy
http://localhost:8080/webcam.ffm: Input/output error
3
  • 2
    What errors are you getting? Please post the ffmpeg command you are using, and the full, uncut terminal output. AFAIK, V4L2 is the only way of doing what you want, it will almost certainly be easier to debug that than to find an alternative.
    – evilsoup
    Commented Mar 23, 2013 at 13:23
  • I know this is an old thread, but @jodes did you fix it somehow? Im struggling with the same issue.
    – Ajith
    Commented Oct 6, 2014 at 10:42
  • @Aji, I'm afraid not
    – Jodes
    Commented Oct 6, 2014 at 14:17

1 Answer 1

0

V4L2 Test Bench (qv4l2 package) can help to know the webcam parameters. For example it lists possible resolution/framerate combinations.

Vivi dummy driver (sudo modprobe vivi) can help to identify if the problem is coming from the driver or from ffmpeg. It creates /dev/videoX displaying a text card (text pattern) mentioning the current parameters.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .