Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gstreamer streaming to nginx rtmp server

PS: First time gstreamer user here. :)

Im trying to stream video from a logitech c920 webcam connected to a beaglebone using gstreamer to an nginx server. But somehow rtmpsink is failing on me. However, with filesink im able to save the video on the beaglebone. Though I still have some frame loss issues and no audio, I want the streaming part to be working first. The command Im using is

GST_DEBUG=4 GST_DEBUG_FILE=gst2.log gst-launch-1.0 -v -e uvch264src device=/dev/video0 name=src auto-start=true average-bitrate=5000000 iframe-period=33  src.vidsrc  ! queue ! video/x-h264,width=1920,height=1080,framerate=30/1 ! h264parse ! flvmux ! rtmpsink location="rtmp://192.168.1.104:1935/hls/movie"

My debug output is here. gist

gstreamer just quits within 5 seconds.

I verified that the streaming server works. But from the client, gstreamer is not giving me any kind of error messages. Or I dont know how to debug it properly.

Im stuck on this issue for the last so many days. Any help would be appreciated.

Thank you.

Update 1

: Im able to send a local file to my rtmp server with ffmpeg and server is handling it as expected.

ffmpeg -re -i /Users/r3dsm0k3/10.mp4 -vprofile baseline -ar 44100 -ac 1 -c copy -f flv rtmp://192.168.1.4:1935/hls/example

Tried gstreamer with fakesink and it doesn't give any errors.

Update 2

Tried with v4l2src as well, without luck.

like image 326
Ajith Avatar asked Oct 21 '14 15:10

Ajith


People also ask

Does nginx support RTMP?

Most modern streaming tools support the RTMP protocol, which defines the basic parameters of an internet video stream. The Nginx web server includes a module that allows you to provide an RTMP stream with minimal configuration from a dedicated URL, just like it provides HTTP access to web pages by default.

Can Nginx stream video?

You can configure NGINX to stream video using one or both of the HTTP Live Streaming (HLS) and Dynamic Adaptive Streaming over HTTP (DASH) protocols. The protocols provide the same functionality, so choosing between them is really a matter of preference.


1 Answers

Finally figured it out. It was rather simple but on the server side of things.

I had to add publish_time_fix off; in the nginx config for rtmp server.

Thanks to this blog.

like image 81
Ajith Avatar answered Oct 12 '22 00:10

Ajith