import os
import sys
import pprint
from PIL import Image
from av import open
video = open(sys.argv[1])
stream = next(s for s in video.streams if s.type == b'video')
for packet in video.demux(stream):
    for frame in packet.decode():
        frame.to_image().save('sandbox/%04d.jpg' % frame.index)
    if frame_count > 5:
        break

1c737cdc69ed524a6eb87748f80605d0cdbf83c7
<mask token>

<mask token>
for packet in video.demux(stream):
    for frame in packet.decode():
        frame.to_image().save('sandbox/%04d.jpg' % frame.index)
    if frame_count > 5:
        break

<mask token>
video = open(sys.argv[1])
stream = next(s for s in video.streams if s.type == b'video')
for packet in video.demux(stream):
    for frame in packet.decode():
        frame.to_image().save('sandbox/%04d.jpg' % frame.index)
    if frame_count > 5:
        break

import os
import sys
import pprint
from PIL import Image
from av import open
video = open(sys.argv[1])
stream = next(s for s in video.streams if s.type == b'video')
for packet in video.demux(stream):
    for frame in packet.decode():
        frame.to_image().save('sandbox/%04d.jpg' % frame.index)
    if frame_count > 5:
        break
