Eder Torres Lopez
Published © GPL3+

Compilation of GStreamer to Stream H264 with Linux

GStreamer will be compiled from source to read compressed H264 video directly from an HD webcam to not waste CPU resources on a BeagleBone.

AdvancedProtip5 hours1,787
Compilation of GStreamer to Stream H264 with Linux

Things used in this project

Hardware components

BeagleBone Black
BeagleBoard.org BeagleBone Black
×1
Webcam, Logitech® HD Pro
Webcam, Logitech® HD Pro
Camera should have an internal H264 encoder and UVC capabilities
×1
Ethernet Cable, Cat5e
Ethernet Cable, Cat5e
This cable is needed if the communication will be done wired
×1
5V 2.5A Switching Power Supply
Digilent 5V 2.5A Switching Power Supply
If an ethernet connection will be used for communication, a 1.5A power supply will be needed at least. If a USB Wi-Fi will be used for communication, then the power supply can be 1A but an externally powered USB hub will be needed
×1
USB Hub, Bus Powered
USB Hub, Bus Powered
An externally powered USB Hub is needed if more than one USB device will be used such as the USB camera and a Wi-Fi USB adapter
×1

Software apps and online services

BeagleBoard.org AM3358 Debian 10.3 2020-04-06 1GB SD console
SD card version is needed to image it into an SD card in order to boot.

Story

Read more

Schematics

Diagram to connect BBB with Wi-Fi and Camera through a USB hub

This image shows the way to connected the camera and the Wi-Fi adapter to the BBB.
Camera and adapter connect to a USB hub which is powered externally. And the USB hub connects to the BBB through the USB port

Code

Script File to Play Video with GStreamer on a Windows Machine - PowerShell

Powershell
This script file contains the command that was typed on the section to stream video on a Windows machine.
https://www.javatpoint.com/create-and-run-a-powershell-script
Follow the link to know how to run PS scripts if desired
gst-launch-1.0 -v udpsrc port=4000 caps='application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264' ! rtph264depay ! avdec_h264 ! autovideosink sync=false   

Linux Terminal Bash file to run gstreamer to read webcam and send through network

SH
This script will run the command to play video with GStreamer
Follow the next link to learn how to read execute script files in Linux
https://linuxhint.com/make-a-file-executable-in-linux/
#!/bin/bash
gst-launch-1.0 uvch264src initial-bitrate=800000 average-bitratge=800000 iframe-period=1000 name=src auto-start=true src.vidsrc ! video/x-h264,width=640,height=480,framerate=30/1 ! h264parse ! rtph264pay ! udpsink host=192.168.1.162 port=4000

Script to play Video with GStreamer with Linux Machine

SH
This script contains the command needed to received the video on the Linux machine using GStreamer
Follow the link to know how to execute script files:
https://linuxhint.com/make-a-file-executable-in-linux/
#!/bin/bash
gst-launch-1.0 -v udpsrc port=4000 caps='application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264' ! rtph264depay ! avdec_h264 ! xvimagesink sync=false

Credits

Eder Torres Lopez

Eder Torres Lopez

8 projects • 9 followers
I've been working on embedded systems since 2012 to create workshops for our IEEE student branch at the University where I obtained a BSEE.
Thanks to Soren Kuula.

Comments