通过pipe使用ffmpeg推流视频流处理出错

图片说明

command = ['ffmpeg',
               '-use_wallclock_as_timestamps',
               '1',
               '-y',
               '-f', 'rawvideo',
               '-vcodec', 'rawvideo',
               '-pix_fmt', 'bgr24',
               '-s', '640*480',
               '-r', '9',
               '-i', '-',
               '-c:v', 'libx264',
               '-pix_fmt', 'yuv420p',
               '-preset', 'ultrafast',
               '-f', 'hls',
               '-hls_list_size', '9',
               '-hls_time','2',
               '/ts/pla.m3u8']
proc = sp.Popen(command, stdin=sp.PIPE)
···
    ···
vid = cv2.VideoCapture(0)
        ···
return_value, frame = vid.read()       
        ···
pipe_frame = frame[:, :, ::-1]
proc.stdin.write(pipe_frame.tostring())

已解决 处理完的帧cv2.resize为推流-s设置的大小

https://blog.csdn.net/achang21/article/details/77870066