Created
February 12, 2023 18:31
-
-
Save valgur/dd37b77f59ebb3483e0b0489b4277534 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
# packets = [H.264 packets as byte arrays] | |
codec = av.CodecContext.create('h264', 'r') | |
for packet in packets: | |
for avpacket in codec.parse(packet): | |
frames = codec.decode(avpacket) | |
print(frames) | |
# Or, can also simply do | |
frames = av.open("blah.h264", 'rb').demux() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment