Open youtube video/livestream in deepstream/gstreamer

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU) RTX2090
• DeepStream Version 6.0.1
• TensorRT Version Docker container:
• NVIDIA GPU Driver Version (valid for GPU only) 510.60.02
• Issue Type( questions, new requirements, bugs) Question

I’m trying to open a youtube video to be able to run it using deepstream python bindings.
I’ve managed to use yt-dlp to open up a youtube-video and play it correctly with the following command:

gst-launch-1.0 souphttpsrc is-live=true location="$(yt-dlp --format “best[ext=mp4][protocol=https]” --get-url THE WITCHER | MAIN TRAILER | NETFLIX - YouTube)" !
decodebin !
videoconvert !
nvvideoconvert !
‘video/x-raw’, format=NV12 !

which plays perfectly.

But when I write my python code I can’t get it to work.

source = Gst.ElementFactory.make(‘souphttpsrc’, ‘souphttpsrc_0’)
source.set_property(‘is-live’, live)
loc_str = “$(yt-dlp --format “best[ext=mp4][protocol=https]” --get-url THE WITCHER | MAIN TRAILER | NETFLIX - YouTube)”
source.set_property(“location”, loc_str)

My guess is that the expression: $(yt-dlp --format “best[ext=mp4][protocol=https]” --get-url THE WITCHER | MAIN TRAILER | NETFLIX - YouTube)

is expanded to a link. I can view it in the terminal

echo $(yt-dlp --format “best[ext=mp4][protocol=https]” --get-url THE WITCHER | MAIN TRAILER | NETFLIX - YouTube)

but even if I copy and paste to use that link instead my program fails and tells me that the link does not work.

Does anyone have an idea of how to go make it work?

best regards/

It is the gst-python problem. Please report to gstreamer community.

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