The Obs Studio media source doesn't support playing youtube urls, until now i have invented a brand new method using ffmpeg named pipes that allows you to play youtube videos using the obs media source
The new technique use a script called relay that also allows you to specify a start and end point of a youtube video to play using the sexagesimal time format.
For example you can start playing a youtube video at 5 minutes for 30 seconds with this command
tsp relay -i 'url' -s 00:05:00 -t 00:00:30
the stream doesnt start until you switch to the media scene and automatically closes when you change to another scene
You can also create a queue of youtube videos or clips from youtube videos to play, there is a version of the script called relay-local that works with local videos
Only one scene and media source is required for this technique so instead of using 20 scenes for 20 video clips you can just use one scene
replay script features:
Play a whole youtube video
Play a clip of a youtube video with a start and end time
The stream doesnt start playing until you switch to the media scene
The stream stops when you switch to another scene
Create a queue a youtube videos or clips from a youtube video
Play a local file or a clips of a local file
Create a queue of local files of clips of local files
Only uses one scene and one media source
Works on the command line or using emacs
relay script
https://raw.githubusercontent.com/Nap...
relay-local script
https://raw.githubusercontent.com/Nap...
sexagesimal-time
https://raw.githubusercontent.com/Nap...
emacs obs relay notes
https://github.com/NapoleonWils0n/cer...
obs media source
https://obsproject.com/kb/media-sources
Note:
This technique doesnt work in Window because windows doesnt support
named pipes, the flatpak version of obs also doesnt work because flatpak
cant work with the system resources and use the named pipe. So you need to install the non-flatpak version of obs from your distros repo