GNOME Bugzilla – Bug 768059
Not able to play the RTSP stream in VLC or mplayer,
Last modified: 2018-01-13 15:38:42 UTC
Hi, I'm streaming the Raspberry camera feed using gst-rtsp (1.4.4) using the following: raspivid -n -vf -fl -t 0 -w 640 -h 480 -b 1200000 -fps 20 -pf baseline -o - | gst-launch-1.0 -v fdsrc do-timestamp=true ! h264parse ! gdppay ! tcpserversink host=192.168.1.4 port=5000 | ./test-launch "( tcpclientsrc host=192.168.1.4 port=5000 ! gdpdepay ! rtph264pay config-interval=1 name=pay0 pt=96 )" But I'm not able to play it (rtsp://192.168.1.4:8554/test) in mplayer or vlc. using mplayer it shows the following after some time ** (lt-test-launch:6317): CRITICAL **: gst_rtsp_session_manage_media: assertion 'status == GST_RTSP_MEDIA_STATUS_PREPARED || status == GST_RTSP_MEDIA_STATUS_SUSPENDED' failed
Please use https://github.com/thaytan/gst-rpicamsrc or v4l2src instead of piping from raspivid, then you can also do it all from a single pipeline. Does the problem disappear then?
exactly the same issue when using: gst-launch-1.0 rpicamsrc bitrate=1000000 ! h264parse ! gdppay ! tcpserversink host=192.168.1.4 port=5000 | ./test-launch "( tcpclientsrc host=192.168.1.4 port=5000 ! gdpdepay ! rtph264pay config-interval=1 name=pay0 pt=96 )"
Try using ./test-launch "( rpicamsrc bitrate=1000000 ! rtph264pay config-interval=1 name=pay0 pt=96 )" No need for the second pipeline, that's exactly where I expect your problem to be.
OK, i tried it and it throws now these errors: (lt-test-launch:1044): GStreamer-CRITICAL **: gst_structure_fixate_field_nearest_int: assertion 'gst_structure_has_field (structure, field_name)' failed (lt-test-launch:1044): GStreamer-CRITICAL **: gst_structure_fixate_field_nearest_fraction: assertion 'gst_structure_has_field (structure, field_name)' failed ** (lt-test-launch:1044): WARNING **: Unknown profile string in rpicamsrc caps: constrained-baseline mmal: mmal_vc_port_info_set: failed to set port info (3:0): EINVAL mmal: mmal_vc_port_set_format: mmal_vc_port_info_set failed 0x7302b3a0 (EINVAL)
i tried now to install ubuntu-mate instead of raspian OS and it seems the rtsp is working without the above issues. it seems the issue is with raspian and not the gst-rtsp module. the version on ubuntu is 1.8.1 i tried to install manually 1.8.2 on raaspian but still rtsp is not working. i think most of the packages in raspian is outdated. nevertheless, the quality/latency for the gst-rtsp is not near at all to the live555. mplayer is throwing a lot of messages and warnings. i will try to tune it to see the max that i can get out of it. thanks
the code that is working for me is: raspivid -n -vf -fl -t 0 -w 640 -h 480 -b 1200000 -fps 20 -pf baseline -o - | gst-launch-1.0 -v fdsrc do-timestamp=true ! h264parse ! gdppay ! tcpserversink host=192.168.1.5 port=5000 | ./test-launch "( tcpclientsrc host=192.168.1.5 port=5000 ! gdpdepay ! rtph264pay config-interval=1 name=pay0 pt=96 )" rpicamsrc is not working on ubuntu-mate 16.04
Ok so what exactly is the status of all this now? What works, what doesn't, how does it it not? :) Also what do you mean with latency/quality not being very good (in which cases and what does it mean in general)?
You also generally need h264parse before the rtph264pay element, especially when using rpicamsrc. How does rpicamsrc not work on Ubuntu Mate? If it doesn't, then its RPi setup is a bit broken.
what works: ** gst-rtsp 1.8.2 on Ubuntu-Mate using the following: $raspivid -n -vf -fl -t 0 -w 640 -h 480 -b 1200000 -fps 20 -pf baseline -o - | gst-launch-1.0 -v fdsrc do-timestamp=true ! h264parse ! gdppay ! tcpserversink host=192.168.1.5 port=5000 | ./test-launch "( tcpclientsrc host=192.168.1.5 port=5000 ! gdpdepay ! rtph264pay config-interval=1 name=pay0 pt=96 )" what doesn't: ** gst-rtsp on Raspian (1.4.4 or 1.8.2) ** rpicamsrc on Raspian (latest image 27-5-16)/Ubuntu Mate (16.04). I have opened a ticket: https://github.com/thaytan/gst-rpicamsrc/issues/51 ** adding h264parse will not make it works in Ubuntu Mate: $raspivid -n -vf -fl -t 0 -w 640 -h 480 -b 1200000 -fps 20 -pf baseline -o - | gst-launch-1.0 -v fdsrc do-timestamp=true ! h264parse ! gdppay ! tcpserversink host=192.168.1.5 port=5000 | ./test-launch "( tcpclientsrc host=192.168.1.5 port=5000 ! h264parse ! gdpdepay ! rtph264pay config-interval=1 name=pay0 pt=96 )" ** adding h264parse for rpicamsrc is not also not working: $./test-launch "( rpicamsrc bitrate=1000000 ! h264parse ! rtph264pay config-interval=1 name=pay0 pt=96 )" regarding the quality/latency. there is a lag of almost 5 seconds. in addition VLC is not working with the stream from gst-rtsp. Only mplayer is working with me. in addition Android internal player API (videoView) is not working with gst-rtsp, it works with live555 stream. live555 stream latency is less than 1 sec latency. I tried as well to receive it using gstreamer but still latency is 5 s: $gst-launch-1.0 rtspsrc location=rtsp://192.168.1.5:8554/test latency=0 ! decodebin ! autovideosink -vvv
(In reply to Abu Abdulla from comment #9) > what doesn't: > ** gst-rtsp on Raspian (1.4.4 or 1.8.2) > ** rpicamsrc on Raspian (latest image 27-5-16)/Ubuntu Mate (16.04). I have > opened a ticket: > https://github.com/thaytan/gst-rpicamsrc/issues/51 > ** adding h264parse will not make it works in Ubuntu Mate: > $raspivid -n -vf -fl -t 0 -w 640 -h 480 -b 1200000 -fps 20 -pf baseline -o - > | gst-launch-1.0 -v fdsrc do-timestamp=true ! h264parse ! gdppay ! > tcpserversink host=192.168.1.5 port=5000 | ./test-launch "( tcpclientsrc > host=192.168.1.5 port=5000 ! h264parse ! gdpdepay ! rtph264pay > config-interval=1 name=pay0 pt=96 )" > ** adding h264parse for rpicamsrc is not also not working: > $./test-launch "( rpicamsrc bitrate=1000000 ! h264parse ! rtph264pay > config-interval=1 name=pay0 pt=96 )" How do all these not work? > regarding the quality/latency. there is a lag of almost 5 seconds. in > addition VLC is not working with the stream from gst-rtsp. Only mplayer is > working with me. in addition Android internal player API (videoView) is not > working with gst-rtsp, it works with live555 stream. live555 stream latency > is less than 1 sec latency. How does it not work with VLC or Android? "Not working" is nothing we can work with really. I assume something like this works fine in both? $./test-launch "( videotestsrc is-live=true ! x264enc tune=zerolatency ! h264parse ! rtph264pay name=pay0 pt=96 )" > I tried as well to receive it using gstreamer but still latency is 5 s: > $gst-launch-1.0 rtspsrc location=rtsp://192.168.1.5:8554/test latency=0 ! > decodebin ! autovideosink -vvv Whenever you do such hacks with going via a TCP socket (or a fd) without any additional means to handle synchronisation, you lose meaningful ways of synchronization and timestamping. I'm not surprised if you get insane latencies or other problems. (Also don't set latency on rtspsrc to 0, it should be the value that reflects your network's jitter) Let's get rpicamsrc working and then we can look into the latency problems, if there still are any.
I'm not sure how to show this but the players failed to play the streams (I'm using windows version in the client side whether it is mplayer or VLC). now even the command that was working for me yesterday is not today !! i really do not understand what is happening. so i will focus on rpicamsrc as you mentioned. * rpicamsrc is installed on ubuntu-Mate, i can see the output from gst-inspect-1.0 rpicamsrc * gst version 1.8.1 [input] $ ./test-launch "( rpicamsrc bitrate=1000000 ! rtph264pay config-interval=1 name=pay0 pt=96 )" [output/test-launch terminal] Nothing [output/VLC] live555 error: Failed to connect with rtsp://192.168.1.5:8554/test access_realrtsp warning: Cseq mismatch, got 1, assumed 0 access_realrtsp warning: only real/helix rtsp servers supported for now core error: open of `rtsp://192.168.1.5:8554/test' failed [output/mplayer] rtsp: read error. rtsp_session: unsupported RTSP server. Server type is 'GStreamer RTSP server'. Failed to get a SDP description from URL "rtsp://192.168.1.5:8554/test": 503 Service Unavailable On Raspian (latest image 27-06-16) * gst version 1.4.4, rpicamsrc is installed [input] $ ./test-launch "( rpicamsrc bitrate=1000000 ! rtph264pay config-interval=1 name=pay0 pt=96 )" [output/test-launch terminal] mmal: mmal_vc_port_info_set: failed to set port info (3:0): EINVAL mmal: mmal_vc_port_set_format: mmal_vc_port_info_set failed 0x75e28680 (EINVAL) (lt-test-launch:871): GStreamer-CRITICAL **: gst_structure_fixate_field_nearest_int: assertion 'gst_structure_has_field (structure, field_name)' failed (lt-test-launch:871): GStreamer-CRITICAL **: gst_structure_fixate_field_nearest_int: assertion 'gst_structure_has_field (structure, field_name)' failed (lt-test-launch:871): GStreamer-CRITICAL **: gst_structure_fixate_field_nearest_fraction: assertion 'gst_structure_has_field (structure, field_name)' failed ** (lt-test-launch:871): WARNING **: Unknown profile string in rpicamsrc caps: constrained-baseline mmal: mmal_vc_port_info_set: failed to set port info (3:0): EINVAL mmal: mmal_vc_port_set_format: mmal_vc_port_info_set failed 0x7310b320 (EINVAL) [output/VLC/mplayer] is the same as in ubuntu Mate I do not know if this is useful but you can guide me in a better way to troubleshoot
I got update from gst-rpicamsrc support and it turns out I missed some parameters to make it works, so the following is working on Raspian for both vlc/mplayer: ./test-launch "( rpicamsrc bitrate=750000 intra-refresh-type=both drc=medium ! video/x-h264,profile=baseline,width=640,height=480 ! h264parse config-interval=1 ! rtph264pay name=pay0 pt=96 )" ubuntu mate issue seems still there but at least it is working now in one of them. now rpicamsrc is working, is there a chance to do the same without using it. I tried to simulate the same command but no luck: raspivid -n -vf -fl -t 0 -w 640 -h 480 -b 1200000 -fps 30 -pf baseline -o - | gst-launch-1.0 -v fdsrc do-timestamp=true ! h264parse ! gdppay ! tcpserversink host=192.168.1.5 port=5000 | ./test-launch "( tcpclientsrc host=192.168.1.5 port=5000 ! video/x-h264,profile=baseline,width=640,height=480 ! h264parse config-interval=1 ! rtph264pay name=pay0 pt=96 )" thanks for your support