-
-
Save hiranp/b2eff29f6bf9fdd688483e51c7c3670c to your computer and use it in GitHub Desktop.
Using PyAV and Streamlink to decode Youtube Live HLS streams
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import av | |
import streamlink | |
streams = streamlink.streams('https://www.youtube.com/watch?v=7DtRPJ2crTA') | |
s = streams['720p'] | |
c = av.open(s.url, format='segment') | |
for f in c.decode(video=0): | |
print(f) | |
f.to_image().save('/tmp/frames/frame-%04d.jpg' % f.index) | |
if f.index > 100: | |
break |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment