notedit / gstreamer-webrtc

webrtc streamer based on gstreamer
75 stars 19 forks source link

No video_pad and audio_pad on rtsp source #8

Open HoangTienDuc opened 5 months ago

HoangTienDuc commented 5 months ago

Hi @notedit , thank for your work, your code helps people who are new to streaming like me a big step forward. With source as TestSource, FileSource; your code works perfectly, however with the source being rtsp, the code has a bug as below:

Code:

url = "rtsp://admin:L2A4E56A@192.168.1.34/cam/realmonitor?channel=1&subtype=0"
source  = RTSPSource(url)

# url = "9-7-2023-23-06_1.mp4"
# source = FileSource(url)

pc.add_stream(source)

Bug:

<GstWebRTC.WebRTCSessionDescription object at 0x7f1bb7445b88 (GstWebRTCSessionDescription at 0x7f1ba80076f0)>
v=0
o=- 185096500726403420 0 IN IP4 0.0.0.0
s=-
t=0 0
a=ice-options:trickle
a=msid-semantic:WMS webrtcbin0

<GstWebRTC.WebRTCSessionDescription object at 0x7f1bb7445ca8 (GstWebRTCSessionDescription at 0x7f1ba800beb0)>
v=0
o=- 200726801577984056 0 IN IP4 0.0.0.0
s=-
t=0 0
a=ice-options:trickle
a=msid-semantic:WMS webrtcbin0

Error: gst-stream-error-quark: Internal data stream error. (1): gstbasesrc.c(3055): gst_base_src_loop (): /GstPipeline:webrtc/webrtc+source+RTSPSource:webrtc+source+rtspsource0/GstRTSPSrc:rtspsrc0/GstUDPSrc:udpsrc0:
streaming stopped, reason not-linked (-1)

I see you already have parsebin.connect('pad-added', self._new_parsed_pad) but it doesn't seem to work. Please help me check this issue

Xav1erSue commented 1 month ago

I'v met the same problem, too. Have you solved it yet?