FFmpeg

FFmpeg Server & avconv

Install avconv on Raspbian and ffmpeg on the streaming server host. Run UV4L with the raspicam driver:

raspberrypi ~ $ uv4l --driver raspicam --auto-video_nr --framerate 25
 [core] Device detected!
 [core] Registering device node /dev/video0

Give a real-time scheduling policy to the driver process for better performance (which is the same as running uv4l with sudo uv4l –sched-rr):

raspberrypi ~ $ sudo chrt -a -r -p 99 `pgrep uv4l`

Run the FFmpeg Streaming Server starting from the simple configuration file below:

server ~ $ wget https://www.linux-projects.org/home/wp-content/uploads/2016/06/ffserver.conf
server ~ $ ffserver -f ./ffserver.conf

Feed the server from your RaspberryPi:

raspberrypi ~ $ export LD_PRELOAD=/usr/lib/uv4l/uv4lext/armv6l/libuv4lext.so
raspberrypi ~ $ avconv -r 25 -s 640x480 -f video4linux2 -i /dev/video0 http://server:8080/raspicam.ffm

where raspberrypi is the host name or IP of your RaspberryPi and server the host name of you streaming server (they can be the same hots).

Now you can get the video stream via VLC, for example:

mypc ~ $ vlc http://server:8080/raspicam.mjpeg

I think this will give you about ~15fps on an old RaspberryPi 1. If you know more efficient configurations with ffmpeg, let me know.

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close