pipelines for sending/receiving movies (audio+video)

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

pipelines for sending/receiving movies (audio+video)

mapcol
This post was updated on .
I find it really difficult to find a pipelines for streaming movies (both audio and video)

For sender it would be:
uridecodebin ! .................... ! (3 sinks: autovideosink, autoaudiosink (these 2 for reproducing what's being sent), and udpsink)

For receiver it would be:
udpsrc ! ................ ! (3 sinks: autovideosink, autoaudiosink, filesink)

Especially I find it hard to know what enconding and caps to use

I tryied these two pipelines:
SENDER:
videotestsrc ! openh264enc  ! mpegts. audiotestsrc ! avenc_aac ! mpegts.  mpegtsmux name=mpegts  ! udpsink host=127.0.0.1 port=10000
RECEIVER:
udpsrc port=10000 ! tsdemux name=demux demux. ! queue ! h264parse ! openh264dec ! videoconvert ! autovideosink demux. ! queue ! avdec_aac ! audioconvert ! autoaudiosink


but no audio is played, and the video on the receiver-sink is STILL.

Can anyone help me with that?
See my question on StackOverflow
Reply | Threaded
Open this post in threaded view
|

Re: pipelines for sending/receiving movies (audio+video)

Arjen Veenhuizen
This post was updated on .
For one, you are missing a payloader which makes sure that your audio and video packets fit in the MTU. Since you are multiplexing to MPEG2TS, rtpmp2tpay (and rtmp2tdepay) are suitable. Furthermore, you are missing a video and audio parser so we have to add them as well.

The following sender pipeline should work:
gst-launch-1.0 -e -v videotestsrc ! openh264enc  ! h264parse config-interval=1 ! mpegts. audiotestsrc ! avenc_aac ! aacparse ! mpegts.  mpegtsmux name=mpegts  ! rtpmp2tpay ! udpsink host=127.0.0.1 port=10000

Notice the -v command line argument which enables verbose logging output. In the log you will find a line which reads something like: caps="application/x-rtp,....". These are the caps that you need on the receiver side. Furthermore, you need an rtpjitterbuffer to make sure that any out-of-order received udp packets are put back in order.

Your receiver pipeline would look like:

gst-launch-1.0 -e -v udpsrc port=10000 caps="application/x-rtp, ..." ! rtpjitterbuffer ! rtpmp2tdepay ! tsdemux name=demux demux. ! queue ! h264parse ! openh264dec ! videoconvert ! autovideosink demux. ! queue ! aacparse ! avdec_aac ! audioconvert ! autoaudiosink 
Perhaps you do not need the aacparse, so if it fails try the pipeline without it.

(Edit: fixed mark-up)
Reply | Threaded
Open this post in threaded view
|

Re: pipelines for sending/receiving movies (audio+video)

mapcol
Still, If I remove the accparse, the video on the receiver is STILL. No audio reproduced and the video is stuck at a frame.

Sender:
gst-launch-1.0 -e -v uridecodebin uri="file:///C:/Users/markopacak/Videos/fountain.mkv" name=d ! queue ! videoconvert ! openh264enc ! h264parse config-interval=1 ! mpegts. d. ! queue ! audioconvert ! avenc_aac ! mpegts. mpegtsmux name=mpegts ! rtpmp2tpay ! udpsink host=127.0.0.1 port=5578

Receiver:
gst-launch-1.0 -e -v udpsrc port=5578 !"application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)MP2T, payload=(int)33" ! rtpjitterbuffer ! rtpmp2tdepay ! tsdemux name=demux demux. ! queue ! h264parse ! openh264dec ! videoconvert ! autovideosink demux. ! queue ! avdec_aac ! audioconvert ! autoaudiosink

Any idea why this is not working?