[FFmpeg-user] Grabbing livestream from youtube is freezing

Krzysztof Kowalczyk krzysiek264 at gmail.com
Mon Feb 18 16:36:46 EET 2019


Hello,
I'm trying to grab live stream from youtube to process it with opencv in
python, in order to do so I run subprocess './ffmpeg.exe -i
*Stream_Url_GoesHere* -f image2pipe -pix_fmt bgr24 -vcodec rawvideo -' and
read decoded image from pipe. This works, however, m3u8 playlist on youtube
consists of segments scattered over multiple hosts, and every few seconds I
get about half sec long freeze and similar message:

[hls,applehttp @ 0000018ab246bb00] Opening '
https://r4---sn-f5f7lne7.googlevideo.com/videoplayback/id/VQOzkTEPCMw.1/itag/95/source/yt_live_broadcast/requiressl/yes/ratebypass/yes/live/1/cmbypass/yes/goi/160/sgoap/gir%3Dyes%3Bitag%3D140/sgovp/gir%3Dyes%3Bitag%3D136/hls_chunk_host/r4---sn-f5f7lne7.googlevideo.com/gcr/pl/ei/S8FqXOZYgdzsBL6fmMgF/playlist_type/DVR/initcwndbps/3440/mm/32/mn/sn-f5f7lne7/ms/lv/mv/m/pl/23/keepalive/yes/mt/1550500052/disable_polymer/true/ip/*expunged_ip*/ipbits/0/expire/1550521771/sparams/ip,ipbits,expire,id,itag,source,requiressl,ratebypass,live,cmbypass,goi,sgoap,sgovp,hls_chunk_host,gcr,ei,playlist_type,initcwndbps,mm,mn,ms,mv,pl/signature/018FC8B75774B6DE47EE7401CC6A969E586AAF8E.95E0C3703108477C588900B3865634C86254F719/key/dg_yt0/playlist/index.m3u8/sq/325312/goap/clen%3D81218%3Blmt%3D1550500178878060/govp/clen%3D185986%3Blmt%3D1550500178878060/dur/5.000/file/seg.ts'
for reading

So is there any way to fix it out other than implementing my own HLS
grabber with some buffering to smooth it out?


More information about the ffmpeg-user mailing list