mchr3k
Posts: 14
Joined: Thu May 10, 2012 9:04 pm

Streaming webcam over RTMP

Wed Apr 17, 2013 9:48 pm

I have a Raspberry Pi and a Logitech Webcam Pro 9000 (Business edition). I am currently using (mjpg-streamer) to stream video from my Raspberry Pi.

I would now like to stream video to ustream.tv. Ustream accepts RTMP streams so I am trying to work out how to use ffmpeg/avconv to produce a correctly encoded stream.

I found (this blog post) which appeared to cover exactly my use case. However, when I run ffmpeg/avconv I get an error which I don't understand and which Google isn't shedding much light on:

Code: Select all

raspberrypi ~ $ avconv -f video4linux2 -s 320x240 -r 1 -i /dev/video0 -metadata title="title" -f flv rtmp://ustream.video.url/
avconv version 0.8.5-6:0.8.5-1+rpi1, Copyright (c) 2000-2012 the Libav developers
  built on Jan 24 2013 08:41:09 with gcc 4.6.3
[video4linux2 @ 0xf67840] Cannot find a proper format for codec_id 0, pix_fmt -1.
/dev/video0: Input/output error
I also tried using a source codec of mjpeg and got the following error:

Code: Select all

raspberrypi ~ $ avconv -an -f mjpeg -s 320x240 -r 1 -i /dev/video0 -metadata title="title" -f flv rtmp://ustream.video.url/
avconv version 0.8.5-6:0.8.5-1+rpi1, Copyright (c) 2000-2012 the Libav developers
  built on Jan 24 2013 08:41:09 with gcc 4.6.3
Option video_size not found.
Can anyone help me with either of these errors?

squirrel534
Posts: 3
Joined: Mon Mar 30, 2015 2:01 pm

Re: Streaming webcam over RTMP

Thu Apr 02, 2015 12:12 am

Did you ever find a solution to this problem? I am trying to investigate streaming to Youtube, and Ustream and finding similar problems

JGwinner
Posts: 6
Joined: Mon Jul 09, 2018 4:57 pm

Re: Streaming webcam over RTMP

Fri Feb 08, 2019 3:43 pm

I'm trying to make a webcam out of motion, and I think 1280x720 is too much.

I tried running ffmpeg manually and ran into the same error. DuckDuckGo hasn't found many answers either.

ffmpeg -s 320x180 -i rtsp://192.168.0.213:8554/unicast testmpeg2.avi

Code: Select all

pi@pib:~/motiontest $ ffmpeg -s 320x180 -i rtsp://192.168.0.213:8554/unicast testmpeg2.avi
ffmpeg version 3.2.12-1~deb9u1+rpt1 Copyright (c) 2000-2018 the FFmpeg developers
....
Option video_size not found.
Did you solve your problem?

Return to “Troubleshooting”