Download - Video Transcoding with Raspberry Pi
Video Transcoding with Raspberry Pi
June 2016
What do we mean by#BeEpic!
A Team-centric vision…
The culture of Creativity Enjoy what you do, and how you do it Grow as a professional, grow as a person Make it sustainable Talent enjoys talent. Talent attracts talent
… and it is built for purpose
Let’s build something awesome!, let’s make it Epic!
Agenda• Starting with some context• Toolbox
–Raspberry PI–nginx–ffmpeg–Hardware acceleration components
• Putting all together• Benchmark
3
Starting with some context
❖ Media encoders working with high quality streams (10 Mbps)❖ Need of monitoring streams:
➢ From external tools/platform that could be out of device network
➢ Without the need of sending HD streams to the monitoring tools
➢ Preprocessing of the stream■ Audio extraction■ Audio spectrum analyzer■ Black screen
❖ RPI to the rescue!❖ Low cost computer❖ Optimized for video
➢ HW Acceleration➢ Up to 1080p and 50Mbps➢ Did I say RPI is a computer?
❖ Pretty flexible➢ It can do tons of things!
Toolbox - Raspberry PI
❖ Nginx: High performance HTTP reverse proxy.
❖ Why a HTTP reverse proxy???➢ nginx-rtmp-module!➢ Flexible➢ Easy to install, deploy and
configure rtmp relay server❖ And not just RTMP!
➢ HLS repackaging➢ DASH repackaging
Toolbox - nginx
Toolbox - ffmpeg❖ Available for many different
platforms and cpus (RPI included)❖ Easy to use tool to:
➢ Transcode ➢ Forward streams from one point
to otherFFmpeg
But what about the CPU???
Toolbox - Hardware acceleration
• FFmpeg with hardware encoding/decoding support– MMAL (--enable-mmal)– OMX (--enable-omx --enable-omx-rpi )
Putting all together
ffmpeg
10 Mbps
300 Kbps
Benchmark• Software decoding/encoding
– libx264 encoding– 98% CPU load
• Software decoding/hardware encoding– OMX HW encoding– 60-65% CPU load
• Hardware decoding/encoding– MMAL HW decoding– OMX HW encoding– 20-25% CPU load
ffmpeg -i bbb_sunflower_1080p_30fps_normal.mp4 -vcodec libx264 -b:v 100k -s 320x200 -map v -f flv rtmp://localhost/small/test
ffmpeg -i bbb_sunflower_1080p_30fps_normal.mp4 -vcodec h264_omx -b:v 100k -s 320x200 -map v -f flv rtmp://localhost/small/test
ffmpeg -vcodec h264_mmal -i bbb_sunflower_1080p_30fps_normal.mp4 -vcodec h264_omx -b:v 100k -s 320x200 -map v -f flv rtmp://localhost/small/test
#BeEpic!
epiclabs.io