0
Follow
0
View

How does Scrcpy screen send H.264 stream packet decode into picture

d20130101 注册会员
2023-01-25 19:04

Big brother, your money is too little, to write all to you, not easy, can back to you are good, to tell the truth. Look, nobody else wants to. Understand each other lol

hbt734542744 注册会员
2023-01-25 19:03

Transfer h.264 bare code to image implementation code. Hope to adopt

import av
import sys
 
def h264ToJpg_demo():
    inputFileName = "input.h264"
    container = av.open(inputFileName)
    print("container:", container)
    print("container.streams:", container.streams)
    print("container.format:", container.format)
 
    for frame in container.decode(video = 0):
        print("process frame: %04d (width: %d, height: %d)" % (frame.index, frame.width, frame.height))
        frame.to_image().save("output/frame-%04d.jpg" % frame.index)
 
 
def main():
    h264ToJpg_demo()
 
 
if __name__ == "__main__":
    sys.exit(main())
diaowanglu 注册会员
2023-01-25 19:03
< div class = "md_content_show e397 data - v - 3967" = "" >

in CSDN copied again...