Failure in minimal demo with rtmpsink, nginx-rtmp-plugin and rtmpsrc

classic Classic list List threaded Threaded
4 messages Options
F32
Reply | Threaded
Open this post in threaded view
|

Failure in minimal demo with rtmpsink, nginx-rtmp-plugin and rtmpsrc

F32
Hi,

I'm working on Ubuntu 20.04, shipped with:
 - gstreamer 1.16.2
 - ffmpeg 4.2.2
 - nginx 1.17.10
 - libnginx-mod-rtmp 1.17.10
(all from Ubuntu official repo)

The nginx configuration is:
> rtmp {
>        server {
>                listen 1935;
>                application tv {
>                        live on;
>                }
>        }
> }
so that it acts as a media server.

With this command, I can push a test video stream to nginx:
> gst-launch-1.0 videotestsrc ! x264enc ! flvmux ! rtmpsink location='rtmp://127.0.0.1/tv live=1'

I can open the video stream with ffmpeg:
> ffplay rtmp://127.0.0.1/tv

However when I tried several gstreamer commands, all of them failed:

> $ gst-launch-1.0 playbin uri=rtmp://127.0.0.1/tv
> Setting pipeline to PAUSED ...
> ERROR: Pipeline doesn't want to pause.
> ERROR: from element /GstURIDecodeBin:uridecodebin0: Could not parse RTMP URI
> Additional debug info:
> gsturidecodebin.c(1413): gen_source_element (): /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0:
> No element accepted URI 'rtmp://127.0.0.1/tv'
> Setting pipeline to NULL ...
> Freeing pipeline ...

> $ gst-launch-1.0 rtmpsrc location='rtmp://127.0.0.1/tv live=1' ! decodebin ! autovideosink
> Setting pipeline to PAUSED ...
> ERROR: Pipeline doesn't want to pause.
> ERROR: from element /GstPipeline:pipeline0/GstRTMPSrc:rtmpsrc0: Could not open resource for reading.
> Additional debug info:
> gstrtmpsrc.c(626): gst_rtmp_src_start (): /GstPipeline:pipeline0/GstRTMPSrc:rtmpsrc0:
> No filename given
> Setting pipeline to NULL ...
> Freeing pipeline ...

> $ gst-launch-1.0 rtmpsrc location='rtmp://127.0.0.1/tv live=1' ! flvdemux ! decodebin ! autovideosink
> Setting pipeline to PAUSED ...
> ERROR: Pipeline doesn't want to pause.
> ERROR: from element /GstPipeline:pipeline0/GstRTMPSrc:rtmpsrc0: Could not open resource for reading.
> Additional debug info:
> gstrtmpsrc.c(626): gst_rtmp_src_start (): /GstPipeline:pipeline0/GstRTMPSrc:rtmpsrc0:
> No filename given
> Setting pipeline to NULL ...
> Freeing pipeline ...

I also tried encoding with avenc_flv, but there's no difference.

I'd like to know what is the cause of the failure, and what is the correct way of playing rtmp stream with gstreamer.

Regards
Windy



 


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Failure in minimal demo with rtmpsink, nginx-rtmp-plugin and rtmpsrc

swarupe
Were you able to fix the issue. Even I am trying similar thing but its not
working am I missing something in my rtmp server?



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Failure in minimal demo with rtmpsink, nginx-rtmp-plugin and rtmpsrc

aligokkaya
In reply to this post by F32
I have the same problem, did you find a solution?



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Failure in minimal demo with rtmpsink, nginx-rtmp-plugin and rtmpsrc

aligokkaya
In reply to this post by F32
I understand that

for opencv

   --rtmpsrc location="rtmp://<location>  live=1" ! decodebin name=d d. !
queue ! videoconvert  ! queue !  
    appsink sync=false

or

   --rtmpsrc location="rtmp://192.168.10.112:1935/gmscore/CAM1 live=1"
timeout="10" !  decodebin
    name=d d.  ! queue !  videoconvert ! queue ! appsink sync=false  
 
for terminal


   --gst-launch-1.0 rtmpsrc
location="rtmp://192.168.10.112:1935/gmscore/CAM1 live=1" ! decodebin
     name=decoder decoder. ! queue ! videoconvert ! queue ! xvimagesink

or

   --gst-launch-1.0 rtmpsrc
location='rtmp://192.168.10.112:1935/gmscore/CAM1 live=1' ! flvdemux
     name=d d. ! queue ! decodebin ! xvimagesink

Description:
   I had the same problem
   I learned that I need to use appsink for IP Camera
   I got positive results when I wrote these pips for opencv

   for terminal
this resource helped me
 
https://stackoverflow.com/questions/19187048/view-h264-from-rtmpsrc-via-gstreamer
   It was easy to write pipe as I know I need to use appsink for opencv


good luck :)





   





--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel