I wanted to use gstreamer for network steaming. Intention is to launch a video content (from Transmitter) and play it on receiver side.
I wrote a sample test code for steaming network content.
At transmitter side:
GST_DEBUG="*:2" gst-launch-1.0 videotestsrc ! video/x-raw ! jpegenc ! rtpjpegpay ! udpsink host=127.0.0.1 port=5001
At Receiver side:
GST_DEBUG="*:2" gst-launch-1.0 udpsrc port=5001 ! application/x-rtp,encoding-name=JPEG,payload=26 ! rtpjpegdepay ! jpegdec ! autovideosink
At receiver I'm getting following error:
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
0:00:00.130187750 4589 0x1a690a0 WARN GST_PADS gstpad.c:3669:gst_pad_peer_query: could not send sticky events
0:00:00.130796352 4589 0x1a690a0 WARN basesrc gstbasesrc.c:2865:gst_base_src_loop: error: Internal data flow error.
0:00:00.130812589 4589 0x1a690a0 WARN basesrc gstbasesrc.c:2865:gst_base_src_loop: error: streaming task paused, reason not-negotiated (-4)
ERROR: from element /GstPipeline:pipeline0/GstUDPSrc:udpsrc0: Internal data flow error.
Additional debug info:
gstbasesrc.c(2865): gst_base_src_loop (): /GstPipeline:pipeline0/GstUDPSrc:udpsrc0:
streaming task paused, reason not-negotiated (-4)
Execution ended after 0:00:00.017176721
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
Please guide me.
(note Im using Gstreamer in Ubuntu 14.04 PC. The same PC is being for transmitter and receiver purpose.)
you need to copy paste the caps like mentioned here
Related
I am trying to stream mp4 over rtsp url and read from other terminal but facing issue Service Unavailable (503)
Server Code : Reference From
./test-launch "filesrc location=./sample.mp4 \
! qtdemux \
! h264parse \
! decodebin \
! videoconvert \
! omxh264enc insert-sps-pps=true bitrate=16000000 \
! rtph264pay name=pay0"
Server Response :
stream ready at rtsp://127.0.0.1:8554/test
Client Code :
sudo gst-launch-1.0 -v rtspsrc location=rtsp://127.0.0.1:8554/test ! rtph264depay ! h264parse ! decodebin ! videoconvert ! autovideosink sync=false
Client Response :
Setting pipeline to PAUSED ...
error: XDG_RUNTIME_DIR not set in the environment.
Pipeline is live and does not need PREROLL ...
Got context from element 'autovideosink0': gst.gl.GLDisplay=context, gst.gl.GLDisplay=(GstGLDisplay)"\(GstGLDisplayX11\)\ gldisplayx11-0";
Progress: (open) Opening Stream
Progress: (connect) Connecting to rtsp://127.0.0.1:8554/test
Progress: (open) Retrieving server options
Progress: (open) Retrieving media info
ERROR: from element /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0: Unhandled error
Additional debug info:
gstrtspsrc.c(6161): gst_rtspsrc_send (): /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0:
Service Unavailable (503)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
Im working on this project :
https://www.hackster.io/jonmendenhall/jetson-nano-search-and-rescue-ai-uav-9ca547
At some point I will need to mount my camera (waveshare ; IMX219-77IR) on top of the drone and I would like to use vlc on Windows or Linux outside of nomachine (because I have installed nomachine server on the nano and the client on windows and because it will run in headless mode),to display what the camera sees when the drone is flying. For this reason I’m trying to configure a gstreamer with RTSP to start a streaming server on the Ubuntu 18.04 that I have installed on the jetson nano.
Below u can see what are the commands that I have issued :
$ ./test-launch "videotestsrc ! nvvidconv ! nvv4l2h264enc ! h264parse ! rtph264pay name=pay0 pt=96"
And on the same Jetson Nano, I opened another console where I ran this pipeline to decode the RTSP stream:
gst-launch-1.0 uridecodebin uri=rtsp://127.0.0.1:8554/test ! nvoverlaysink
I see this picture :
The picture is from videotestsrc plugin. I would like to replace videotestsrc with my video source,but I don't know how to do that.
I tried these combinations,but none of them worked :
./test-launch "v4l2src device=/dev/video0 ! nvvidconv ! nvv4l2h264enc ! h264parse ! queue ! rtph264pay name=pay0 pt=96"
./test-launch "device=/dev/video0 ! nvvidconv ! nvv4l2h264enc ! h264parse ! queue ! rtph264pay name=pay0 pt=96"
but the error is still the same :
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Progress: (open) Opening Stream
Progress: (connect) Connecting to rtsp://127.0.0.1:8554/test
Progress: (open) Retrieving server options
Progress: (open) Retrieving media info
ERROR: from element /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstRTSPSrc:source: Could not read from resource.
Additional debug info:
gstrtspsrc.c(5917): gst_rtsp_src_receive_response (): /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstRTSPSrc:source:
Could not receive message. (Timeout while waiting for server response)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
but why ? I know for sure that my camera (model waveshare ; IMX219-77IR) created a device called /dev/video0 and I know for sure that it works,because this command is able to show my face on the screen :
DISPLAY=:0.0 gst-launch-1.0 nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width=3280, height=2464, format=(string)NV12, framerate=(fraction)20/1' ! nvoverlaysink -e
I am fairly new to GStreamer, and without any error messages I am lost trying to debug my problem. I am trying to stream a h264 stream as RTP packets over UDP:
gst-launch-1.0 v4l2src ! 'video/x-raw, width=1280, height=720, framerate=30/1' ! videoconvert ! x264enc ! rtph264pay ! udpsink host=192.168.88.1 port=5004
Output:
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Redistribute latency...
When I do a netcat on 192.168.88.1 I see nothing:
nc -ul 5004
And neither VLC nor Janus Gateway are picking up any stream. I am honestly shooting in the dark because I'm not very familiar with gstreamer or video streaming in general. Any guidance would be appreciated.
Thanks!
I am trying to stream adpcm (G726),32kbps audio from a host to a client through
RTP:
I have tried following commands from the client(receiver) and the host(sender).
Both boards are connected through IP.
I am getting "internal data flow error" at the receiver once i run the cmds on
the sender:
RECEIVER:
gst-launch -v udpsrc port=3004 caps="application/x-rtp” ! rtpg726depay !
ffdec_g726 ! alsasink
SENDER:
gst-launch -v autoaudiosrc ! audioconvert ! audioresample ! ffenc_g726
bitrate=32000 ! rtpg726pay ! udpsink host=192.168.1.104 port=3004
If I try the same with pcm, alaw encoder and decoder, then streaming works
fine. I can hear the live audio(when I speak on sender's Microphone) into
receiver's speakerphone:
commands I am running in this case:
RECEIVER:
gst-launch udpsrc port=3004 caps="application/x-rtp" ! rtppcmadepay ! alawdec
! alsasink
SENDER:
gst-launch autoaudiosrc ! audioconvert ! audioresample ! alawenc ! rtppcmapay
! udpsink host=192.168.1.104 port=3004
This seems to be an issue in the pipeline?
here is the full error I am getting at the receiver
///////////////
root#am335x-evm:~/EVM4# gst-launch udpsrc port=3004 caps="application/x-rtp" !
rtpg726depay ! ffdec_g726 ! alsasink
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
ERROR: from element /GstPipeline:pipeline0/GstUDPSrc:udpsrc0: Internal data
flow error.
Additional debug info:
gstbasesrc.c(2625): gst_base_src_loop ():
/GstPipeline:pipeline0/GstUDPSrc:udpsrc0:
streaming task paused, reason not-negotiated (-4)
Execution ended after 20828810227 ns.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
I need to set up a live audio streaming server with gstreamer. Server should be sending live audio to client and at the client side, vlc player should be used to play the incoming stream. I am using the following code
VIDEO_CAPS="application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)H264"
gst-launch -v udpsrc caps=$VIDEO_CAPS port=4444 \
! gstrtpbin .recv_rtp_sink_0 \
! rtph264depay ! ffdec_h264 ! xvimagesink
then gstreamer reports like:
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Please help me with steps for setting up a server using gstreamer a client for performing live streaming
Try reading manual on streaming with VLC here.
Or just:
cvlc rtp://#:4444
Update:
Due to my bad reading skills I slightly misunderstood the question.
Here is how to set up a server:
gst-launch -v pulsesrc ! audioconvert ! audioresample \
! speexenc ! rtpspeexpay \
! udpsink host=224.1.1.1 port=4444 auto-multicast=true
or use multiudpsink to send to multiple clients.