You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Python: YouTube livestream not working with Streamlink #193
Traceback (most recent call last):
File "D:/VideoFeedProcessing/VideoFeed/main.py", line 226, in
out = cv.VideoWriter('_output.avi', fourcc, 15, (ori_wid, ori_hei))
TypeError: must be real number, not tuple
[tcp @ 000001601c64fbc0] Connection to tcp://manifest.googlevideo.com:443 failed: Error number -138 occurred
@fspider This issue is not related to opencv-python as it not provide support for directly playing live-streaming youtube videos URLs. You can try another vidgear python video processing library for this purpose and the complete example code can be found here. Goodluck.
Activity
Sushanti99 commentedon May 31, 2019
Hello @devanshusharma19
This code works perfectly for me on Windows.
You can try manually fixing the height and width of the frame on Ubuntu I guess.
native-api commentedon Jun 23, 2019
Looks like a duplicate of #204
fspider commentedon Nov 22, 2019
Hello
With some youtube videos,this code works.
But this code not works with youtube live stream.
https://www.youtube.com/watch?v=17Deeq8N2e4
https://www.youtube.com/watch?v=1y5dcfnv-Ss
https://www.youtube.com/watch?v=tbLXWVhu8-Q
Method
vPafy = pafy.new(videoUrl)
play = vPafy.getbest(preftype="mp4")
return play.url
Method
streams = streamlink.streams(videoUrl)
return streams["best"].url
All 2 Method not works.
The error screen like this
[ERROR:0] global C:\projects\opencv-python\opencv\modules\videoio\src\cap.cpp (116) cv::VideoCapture::open VIDEOIO(CV_IMAGES): raised OpenCV exception:
OpenCV(4.1.1) C:\projects\opencv-python\opencv\modules\videoio\src\cap_images.cpp:235: error: (-5:Bad argument) CAP_IMAGES: error, expected '0?[1-9][du]' pattern, got: https://manifest.googlevideo.com/api/manifest/hls_playlist/expire/1574433696/ei/QJ_XXfqBHNOTgQOBqpGwBw/ip/222.112.215.2/id/1EiC9bvVGnk.1/itag/96/source/yt_live_broadcast/requiressl/yes/ratebypass/yes/live/1/goi/160/sgoap/gir%3Dyes%3Bitag%3D140/sgovp/gir%3Dyes%3Bitag%3D137/hls_chunk_host/r5---sn-3u-bh2ll.googlevideo.com/playlist_type/DVR/initcwndbps/7760/mm/44/mn/sn-3u-bh2ll/ms/lva/mv/m/mvi/4/pl/23/dover/11/keepalive/yes/fexp/23842630/mt/1574412027/sparams/expire,ei,ip,id,itag,source,requiressl,ratebypass,live,goi,sgoap,sgovp,playlist_type/sig/ALgxI2wwRAIgG6xA4SgrD4PZGAfyup1jpL003-U3CQomrURDSKrCbZQCIElX0iQYvSGuZK-aoDsbY9Zv6SVTCNHOXGoUXhPCj0bN/lsparams/hls_chunk_host,initcwndbps,mm,mn,ms,mv,mvi,pl/lsig/AHylml4wRQIhAO1AS0iv1JaOu9igx-i3uGV-52UNCvd1Kd4Fu9SSC6OqAiAVjNjYYdr37w4Id111zdRsu8csAkIAfynBOk4SEO9f3w%3D%3D/playlist/index.m3u8 in function 'cv::icvExtractPattern'
Traceback (most recent call last):
File "D:/VideoFeedProcessing/VideoFeed/main.py", line 226, in
out = cv.VideoWriter('_output.avi', fourcc, 15, (ori_wid, ori_hei))
TypeError: must be real number, not tuple
[tcp @ 000001601c64fbc0] Connection to tcp://manifest.googlevideo.com:443 failed: Error number -138 occurred
abhiTronix commentedon Nov 22, 2019
@fspider This issue is not related to opencv-python as it not provide support for directly playing live-streaming youtube videos URLs. You can try another vidgear python video processing library for this purpose and the complete example code can be found here. Goodluck.