Can't get audio over GStreamer udpsrc element - gstreamer

I'm trying to play audio (WAV) file using Gstreamer udpsrc element with no success. Playing audio from a file works just fine:
gst-launch-1.0 -v filesrc location=sp5.wav ! wavparse ! audioconvert ! volume volume=1 ! autoaudiosink
But when running this in one terminal:
gst-launch-1.0 -v udpsrc port=5200 ! wavparse ! audioconvert ! volume volume=1 ! autoaudiosink
and this in another:
$ gst-launch-1.0 -v filesrc location=sp5.wav ! udpsink host=localhost port=5200
can't get any audio out (and Wireshark shows packets are going across). Trying the last command from a different PC didn't make any difference.
Running Gstreamer version 1.14.4.
Am i missing something obvious?

Related

OpenCV 4.2.0 C++ - H264 Encoding and Streaming

Currently, i'm using OpenCV 4.2 C++ in order to encode and stream outputs from a Allied Vision Manta camera.
I already can grabe a frame, compress with MJPEG and the stream to other pipeline using OpenCV and GStreamer.
However, i need to try with H.264 (and later with H.265) but it's not working. The pipelines created are these in VideoWriter function are the follow:
1 - "appsrc ! queue ! videoconvert ! x264enc ! rtph264pay ! udpsink host=127.0.0.1 port=5015";
2 - "appsrc ! autovideoconvert ! videoconvert ! x264enc ! rtph264pay ! udpsink host=127.0.0.1 port=5015";
With the 1st pipe, i get:
[ WARN:0] global /opt/opencv/modules/videoio/src/cap_gstreamer.cpp (1759) handleMessage OpenCV | GStreamer warning: Embedded video playback halted; module x264enc0 reported: Can not initialize x264 encoder.
[ WARN:0] global /opt/opencv/modules/videoio/src/cap_gstreamer.cpp (1665) writeFrame OpenCV | GStreamer warning: Error pushing buffer to GStreamer pipeline
With the 2nd pipe, I get:
libva info: VA-API version 0.39.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/vmwgfx_drv_video.so
libva info: va_openDriver() returns -1
The others arguments of VideoWritter are:
cv::CAP_GSTREAMER, 0, 5, Size(1080, 720), true
The input pixel format is BGR, because i need to grab the frames with BayerRG8, and then convert to BGR to minimize the traffic.
The receiver is done with
udpsrc port=5015 ! application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264,framerate=15/1 ! rtph264depay ! decodebin ! videoconvert ! appsink
One detail that i don't know if it's important or not, i'm doing this in the VirtualBox.

Gstreamer: error when decoding video stream

Hello I am trying to encode and decode a "live" video using the webcam of and windows pc. The gstreamer version that I am currently using is 1.15.1
For the encoding line I use:
gst-launch-1.0 ksvideosrc ! \
'video/x-raw, width=640, height=480, framerate=30/1' ! \
videoconvert ! \
x264enc pass=qual quantizer=20 tune=zerolatency ! \
rtph264pay ! \
filesink location=D:\\cam.ts
This make a file on the D drive, but when is try to decode it I get an error.
line used:
gst-launch-1.0 filesrc location=D:\\cam.ts ! \
rtph264depay ! \
avdec_h264 ! \
videoconvert ! \
autovideosink sync=false
This is the answer Gstreamer gives me
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
ERROR: from element /GstPipeline:pipeline0/GstFileSrc:filesrc0: Internal data stream error.
Additional debug info:
../libs/gst/base/gstbasesrc.c(3064): gst_base_src_loop ():
/GstPipeline:pipeline0/GstFileSrc:filesrc0:
streaming stopped, reason error (-5)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...

gstreamer WARNING: erroneous pipeline

I am currently getting the following error
WARNING: erroneous pipeline: no element "Qtdemux" when I run the following command
gst-launch-1.0 -v filesrc location=~/Desktop/Dog.mp4 ! Qtdemux ! h264parse ! ffdec_h264 ! ffmpegcolorspace ! x264enc ! rtph264pay ! udpsink host=127.0.0.1 port=5000
I have tried making sure I have gstreamer-plugin-good and get the following response
gstreamer1.0-plugins-good is already the newest version (1.8.3-1ubuntu0.4).
However when I look at gst-inspect-1.0 Qtdemux I get the following response No such element or plugin 'Qtdemux'.
Any thoughts on what may be the problem I am facing?
It is qtdemux, with a samll q.

How to segment ts format file

I'm working on some HLS app with latest version(1.2.0) of GStreamer on Ubuntu 13.10
and be troubled by hlssink plugin.
While getting segments from a ts file, the cmd as follow :
gst-launch-1.0 filesrc location=test.ts ! tsdemux name=demuxer ! multiqueue name=mq ! 'video/x-h264,stream-format=byte-stream,alignment=nal' ! mpegtsmux name=mux ! hlssink mq. ! 'audio/mpeg,mpegversion=2,stream-format=adts' ! mux.
I found it dumps the segments ts files with wrong type, and no player can play back those files.
But when I demux from mp4 format, it works :
gst-launch-1.0 filesrc location=test.mp4 ! qtdemux name=demuxer demuxer. ! multiqueue name=mq ! h264parse ! mpegtsmux name=mux ! hlssink demuxer. ! mq. mq. ! aacparse ! mux.
really troubled a lot by this. Can anyone help me?

gstreamer videotestsrc rtp not working

I have been trying to get gstreamer rtp working on my osx lion I have following:
sender:
gst-launch-1.0 videotestsrc ! avenc_mpeg4 ! rtpmp4vpay ! udpsink -vvv
receiver:
gst-launch-1.0 udpsrc caps="application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)MP4V-ES, profile-level-id=(string)1, config=(string)000001b001000001b58913000001000000012000c48d8800f50a041e1463000001b24c61766335332e33352e30, payload=(int)96, ssrc=(uint)1613325455, timestamp-offset=(uint)3778351903, seqnum-offset=(uint)5013" ! rtpmp4vdepay ! avdec_mpeg4 ! autovideosink
but all i get is a green screen on the receiver. Am i setting up my pipelines incorrectly?
I tried using the tcpserversink and tcpclientsrc as follows:
gst-launch-1.0 videotesavenc_mpeg4 ! rtpmp4vpay config-interval=2 ! tcpserversink port=5555 -vvv --gst-debug=3
gst-launch-1.0 tcpclientsrc port=5555 ! "application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)MP4V-ES, profile-level-id=(string)1, config=(string)000001b001000001b58913000001000000012000c48d8800f50a041e1463000001b24c61766335332e33352e30, payload=(int)96, ssrc=(uint)970028597, timestamp-offset=(uint)2609711508, seqnum-offset=(uint)59228" ! rtpmp4vdepay ! decodebin ! videoconvert ! autovideosink --gst-debug=3 -vvv
which results in a flickering test source and the following error repeated on the client side:
0:00:06.213137000 10134 0x7fab6b051680 ERROR libav :0:: Error at MB: 311
0:00:06.214311000 10134 0x7fab6b051680 ERROR libav :0:: ac-tex damaged at 19 14
can someone construct a test pipeline to output the videotestsrc to mpeg4 video with both a sender and receiver please??
Try setting "host" for the udpsink like this:
gst-launch-1.0 videotestsrc ! avenc_mpeg4 ! rtpmp4vpay ! udpsink host=127.0.0.1 -vvv