I tried using How to to play videos from the web using Opencv and python and Is it possible to stream video from https:// (e.g. YouTube) into python with OpenCV? But didnt work
This below worked
os.system('mpv some_url')
This uses mpv to play video from url but I want to use youtube-dl to do this. I know mpv uses YouTube-dl to play the video from url but when using yt-dl it only downloads the video.
I want to watch video without downloading (like mpv).Also open to use other modules. No vlc or mpv(as I have reasons not to use them) .
Here's my ytdl code which downloads the video
from __future__ import unicode_literals
import youtube_dl
ydl_opts = {}
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
ydl.download(['https://www.youtube.com/watch?v=BaW_jenozKc'])