Alan Lee
Alan Lee

Reputation: 81

Gstreamer unable to play audio through rtspsrc

I am having trouble to play the audio from the rtsp server, i have no problem for the video playback, but some error occurred while i tried to play audio, the following is the command used to play video:

C:\gstreamer\1.0\x86_64\bin>gst-launch-1.0 rtspsrc location=rtsp://192.168.2.116/axis-media/media.amp latency=0 !decodebin ! autovideosink

however, when i change the autovideosink to autoaudiosink, which as in follow:

C:\gstreamer\1.0\x86_64\bin>gst-launch-1.0 rtspsrc location=rtsp://192.168.2.116/axis-media/media.amp latency=0 !decodebin ! autoaudiosink

i get the errors below:

ERROR: from element /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0/GstUDPSrc:udpsrc1: Internal data flow error.
Additional debug info:
gstbasesrc.c(2933): gst_base_src_loop (): /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0/GstUDPSrc:udpsrc1:
streaming task paused, reason not-linked (-1)

I am new to both stackoverflow and Gstreamer, any helps from you would be much appreciated

Upvotes: 2

Views: 2968

Answers (2)

Alan Lee
Alan Lee

Reputation: 81

Thanks to thiagoss's reply , I have my first success on playing both video and audio using the following pipeline:

gst-launch-1.0 rtspsrc location=rtsp://192.168.2.116/axis-media/media.amp latency=0 name=src src. ! decodebin ! videoconvert ! autovideosink src. ! decodebin ! audioconvert ! autoaudiosink

Upvotes: 2

thiagoss
thiagoss

Reputation: 2094

IIRC rtspsrc will output one pad for each stream (video and audio might be separate) so you could be linking your video output to an audiosink.

You can run with -v to see the caps on each pad and verify this. Then you can properly link by using pad names in gst-launch-1.0:

Something like:

gst-launch-1.0 rtspsrc location=rtsp://192.168.2.116/axis-media/media.amp latency=0 name=src src.stream_0 !decodebin ! autovideosink

Check the correct stream_%u number to use for each stream to have it linked correctly.

You can also just be missing a videoconvert before the videosink. I'd also test that.

Upvotes: 1

Related Questions