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: nvcr.io/nvidia/deepstream:6.0.1-devel
• 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 https://www.youtube.com/watch?v=ndl1W4ltcmg)” !
decodebin !
videoconvert !
nvvideoconvert !
‘video/x-raw’, format=NV12 !
nveglglessink

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 https://www.youtube.com/watch?v=ndl1W4ltcmg)”
source.set_property(“location”, loc_str)

My guess is that the expression: $(yt-dlp --format “best[ext=mp4][protocol=https]” --get-url https://www.youtube.com/watch?v=ndl1W4ltcmg)

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

echo $(yt-dlp --format “best[ext=mp4][protocol=https]” --get-url https://www.youtube.com/watch?v=ndl1W4ltcmg)
https://rr6---sn-5go7yne6.googlevideo.com/videoplayback?expire=1650572950&ei=NmphYqinCt2Uv_IPvYalkAo&ip=185.65.135.251&id=o-AM6KzYWICPTP4AJHJJGaBZoUiWz-GvjCOE-s6ay-rK4-&itag=22&source=youtube&requiressl=yes&mh=eV&mm=31%2C29&mn=sn-5go7yne6%2Csn-5goeen7r&ms=au%2Crdu&mv=m&mvi=6&pl=24&initcwndbps=866250&vprv=1&mime=video%2Fmp4&ratebypass=yes&dur=140.387&lmt=1627500799411486&mt=1650550868&fvip=3&fexp=24001373%2C24007246&c=ANDROID&txp=5532434&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cratebypass%2Cdur%2Clmt&sig=AOq0QJ8wRAIgXxUUD5LcYqDk_BD_WsNbpjU4vNwMn2ulAWA6ZYckbzcCIE0ggFBBGOXQtG2leCfzOoOHjkb56VlKZjFEtP2CKY4X&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRgIhANupfpiYGoTd1LTT5v3F0nJ7Zcajffox2Kfdyl4Am3IpAiEAgruTEnQQGN5TpB8kGKwF0BMiQgPKxn99VBRcLbdKDoI%3D

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/
D

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

https://gstreamer.freedesktop.org/modules/gst-python.html

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