Hardware Reference
In-Depth Information
7.
To transmit the camera feed over
Real Time Messaging Protocol
(
RTMP
),
we'll need to use an application called avconv that's part of the
ffmpeg
package. If you installed Motion earlier in this chapter, you already have
this package, otherwise install it now with the following command:
pi@raspberrypi ~ $ sudo apt-get install ffmpeg
8.
Now let's try broadcasting. You'll get the best performance if you let the
avconv
utility grab the video straight from the camera, without
mjpg_
streame
r or
motion
running in the background. Enter the following command
but replace
[RTMP URL]
and
[Stream Key]
with the values copied previously:
pi@raspberrypi ~ $ avconv -f video4linux2 -s 480x270 -r 15 -b 400k
-i /dev/video0 -f flv [RTMP URL]/[Stream Key]
These are the lowest recommended broadcast settings for resolution
and frame rate. You might have to adjust them slightly to fit your
camera's capabilities.
9. You should now be able to tune in to your camera feed from any web
browser by visiting your channel URL:
http://ustream.tv/channel/
[your-channel-name]
Pi camera broadcast viewed in browser