【发布时间】:2021-02-03 22:59:35
【问题描述】:
我有来自 rtmp 服务器的原始数据,像素格式为 yuv420p
我使用管道来读取数据。但我不知道如何将原始数据解码为图像。
command = ['ffmpeg']
command.extend(["-loglevel", "fatal", "-i", 'rtmp://localhost/live/stream', "-f", "flv", "-pix_fmt" , 'yuv420p', '-vcodec', 'h264', "-"])
self.process = subprocess.Popen(command, stderr=subprocess.PIPE ,stdout = subprocess.PIPE)
self.output = self.process.stdout
self.fs = width*height*3 // 2
while True:
data = self.output.read(self.fs)
我已经尝试像这样解码enter link description here
但结果是enter image description here
谁能帮我解决这个问题?
【问题讨论】: