I have raw data from rtmp server with pixel format yuv420p
I use pipe to read data. But I don't know how to decode raw data to image.
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)
I have try decode like this enter link description here
But result is enter image description here
Can anyone help me with this problem ?
