Gstreamer pipeline Error: gst-stream-error-quark: Internal data stream error. (1) gstrtspsrc.c(6057): gst_rtspsrc_loop ()

Hi ,

I have the following error while running python gstreamer code,

**Error: gst-stream-error-quark: Internal data stream error. (1) gstrtspsrc.c(6057): gst_rtspsrc_loop (): /GstPipeline:pipeline0/GstRTSPSrc:src:

streaming stopped, reason not-linked (-1)
**

NOTE: The Pipeline is working fine using gst-launch1.0 in terminal

Here is my gstreamer pipeline(Working fine in terminal)
gst-launch-1.0 -v rtspsrc location= ! rtph265depay ! h265parse ! nvv4l2decoder ! nvvidconv ! nv3dsink sync=false

I converted gstreamer pipeline to python code as following,

python code:
import gi
gi.require_version(‘Gst’, ‘1.0’)
from gi.repository import Gst

Gst.init(None)

pipeline = Gst.Pipeline()

Create elements

src = Gst.ElementFactory.make(“rtspsrc”, “src”)
depay = Gst.ElementFactory.make(“rtph265depay”, “depay”)
parse = Gst.ElementFactory.make(“h265parse”, “parse”)
decoder = Gst.ElementFactory.make(“nvv4l2decoder”, “decoder”)
converter = Gst.ElementFactory.make(“nvvidconv”, “converter”)
sink = Gst.ElementFactory.make(“nv3dsink”, “sink”)

Set properties

src.set_property(“location”, “rtsp url”)
src.set_property(“latency”, 200)

Add elements to pipeline

pipeline.add(src)
pipeline.add(depay)
pipeline.add(parse)
pipeline.add(decoder)
pipeline.add(converter)
pipeline.add(sink)

Link elements

src.link(depay)
depay.link(parse)
parse.link(decoder)
decoder.link(converter)
converter.link(sink)

Start pipeline

pipeline.set_state(Gst.State.PLAYING)

Wait until error or EOS

bus = pipeline.get_bus()
msg = bus.timed_pop_filtered(Gst.CLOCK_TIME_NONE, Gst.MessageType.ERROR | Gst.MessageType.EOS)

Stop pipeline

pipeline.set_state(Gst.State.NULL)

Could you please help on this issue?

Specifications:

Nvidia Tegra Orin (NVGPU)/Integrated-graphics
ARMv8 Processor rev1(v8l)*8-processor
cuda_11.4r11.4
Nvidia Agx orin 64bit ubuntu 20.04.6 LTS

Thanks

You’d better use Gst.parse_launch:

import gi
gi.require_version('Gst', '1.0')
from gi.repository import Gst

Gst.init(None)

#Create pipeline from string, it will auto negociate caps
pipeline = Gst.parse_launch('rtspsrc location=rtsp://127.0.0.1:8554/test latency=200 ! rtph265depay ! h265parse ! nvv4l2decoder ! nvvidconv ! nv3dsink')

#Start pipeline
pipeline.set_state(Gst.State.PLAYING)

#Wait until error or EOS
bus = pipeline.get_bus()
msg = bus.timed_pop_filtered(Gst.CLOCK_TIME_NONE, Gst.MessageType.ERROR | Gst.MessageType.EOS)

#Stop pipeline
pipeline.set_state(Gst.State.NULL)

Hi,
Thanks Honey Patouceul for the suggestion.

Please also refer to a similar sample:
Nvv4l2decoder plugin is not shutting down cleanly and leaking memory - #8 by DaneLLL

Thanks Honey_Patouceul , Got it

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.