how to disable audio (remove stream) from the rtspsrc stream

1,401 views
Skip to first unread message

lionel mazeyrat

unread,
May 22, 2022, 11:15:30 AM5/22/22
to gstreamer-java
I have a program based on webrtcbin example.

private static final String PIPELINE_RTSP
= "rtspsrc location=%s protocols=tcp latency=%d user-id=%s user-pw=%s ! decodebin ! videoconvert name=videoconvert ! queue ! vp8enc %s ! rtpvp8pay"
+ " ! queue ! application/x-rtp,media=video,encoding-name=VP8,payload=97 ! webrtcbin. "
+ " webrtcbin name=webrtcbin bundle-policy=max-bundle";
 
I would like to disable audio from the rtsp stream but I can't figure out how to do this ?

lionel mazeyrat

unread,
May 22, 2022, 12:39:46 PM5/22/22
to gstreamer-java

rtspsrc = gst_bin_get_by_name (GST_BIN (pipeline), "r");
g_signal_connect (rtspsrc, "select-stream", G_CALLBACK (find_backchannel),

perhas with "select-stream" signal. But is it possible with java api ?

Neil C Smith

unread,
May 25, 2022, 7:11:45 AM5/25/22
to gstream...@googlegroups.com
On Sun, 22 May 2022 at 17:39, lionel mazeyrat <lionel....@gmail.com> wrote:
> rtspsrc = gst_bin_get_by_name (GST_BIN (pipeline), "r");
> g_signal_connect (rtspsrc, "select-stream", G_CALLBACK (find_backchannel),
>
> perhas with "select-stream" signal. But is it possible with java api ?

In theory you can use GObject::connect directly, although you'll
probably have to use some lowlevel API too. Look for the uses of
those methods through the library for examples.

Really, we need a better way of mapping to arbitrary signals. I've
done some initial work on this already.

> Le dimanche 22 mai 2022 à 17:15:30 UTC+2, lionel mazeyrat a écrit :
>> private static final String PIPELINE_RTSP
>> = "rtspsrc location=%s protocols=tcp latency=%d user-id=%s user-pw=%s ! decodebin ! videoconvert name=videoconvert ! queue ! vp8enc %s ! rtpvp8pay"
>> + " ! queue ! application/x-rtp,media=video,encoding-name=VP8,payload=97 ! webrtcbin. "
>> + " webrtcbin name=webrtcbin bundle-policy=max-bundle";
>>
>> I would like to disable audio from the rtsp stream but I can't figure out how to do this ?

What actually happens here that you're trying to stop?

Best wishes,

Neil

--
Neil C Smith
Codelerity Ltd.
www.codelerity.com

Codelerity Ltd. is a company registered in England and Wales
Registered company number : 12063669
Registered office address : Office 4 219 Kensington High Street,
Kensington, London, England, W8 6BD

lionel mazeyrat

unread,
May 25, 2022, 7:37:54 AM5/25/22
to gstream...@googlegroups.com
Hi Neil

My pipeline works with somme rtsp stream, but with one stream I have an error I suspect to be relative toan supported audio format. I dont need audio, but only video and l would like to diable audio or exlude it.


--
You received this message because you are subscribed to the Google Groups "gstreamer-java" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gstreamer-jav...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gstreamer-java/CAPxOS5FHpkNJGChbE1_A%3Dr%3DRFyJ4RVExvF41ustXSO3CMmO9sw%40mail.gmail.com.

Neil C Smith

unread,
May 25, 2022, 9:16:18 AM5/25/22
to gstream...@googlegroups.com


On Wed, 25 May 2022, 12:37 lionel mazeyrat, <lionel....@gmail.com> wrote:

My pipeline works with somme rtsp stream, but with one stream I have an error I suspect to be relative toan supported audio format. I dont need audio, but only video and l would like to diable audio or exlude it.

I'm just trying to get a sense of whether you can configure the decodebin to fix your problem. Does setting the caps property on the decodebin to just any video work?

Best wishes,

Neil

lionel mazeyrat

unread,
May 26, 2022, 1:52:30 PM5/26/22
to gstreamer-java
How do you configure decodebin to set caps property for just video ?

lionel mazeyrat

unread,
May 26, 2022, 1:56:58 PM5/26/22
to gstreamer-java
is it for input or outputs of the decodebin ?

Neil C Smith

unread,
May 27, 2022, 5:27:16 AM5/27/22
to gstream...@googlegroups.com
On Thu, 26 May 2022 at 18:52, lionel mazeyrat <lionel....@gmail.com> wrote:
> How do you configure decodebin to set caps property for just video ?

Check the upstream docs, and in particular
https://gstreamer.freedesktop.org/documentation/playback/decodebin.html?gi-language=c#decodebin:caps

lionel mazeyrat

unread,
May 27, 2022, 5:54:34 AM5/27/22
to gstreamer-java
I finally found how to disable audio in rtsp stream with capsfilter caps="application/x-rtp,media=video" and it solved my issue !

rtspsrc location=rtsp://192.168.68.124:554/stream1 protocols=tcp latency=10 user-id=admintapo user-pw=admintapo ! capsfilter caps="application/x-rtp,media=video" ! decodebin ! videoconvert name=videoconvert ! queue ! vp8enc deadline=1 ! rtpvp8pay ! queue ! application/x-rtp,media=video,encoding-name=VP8,payload=97 ! webrtcbin. webrtcbin name=webrtcbin bundle-policy=max-bundle
Reply all
Reply to author
Forward
0 new messages