Receive H264 socket video stream on RPi 3/Zero using OMXPlayer - Raspberry Pi Forums
hi there,
have existing python code receive h264 socket video stream mobile rpi3 using ffmpeg. code receiving video on python looks below. since rpi 0 w slow on ffmpeg, trying play using omxplayer. wondering if share light play h264 using omxplayer on rpi 0 w. not find useful material online. appreciate support...thank you!
have existing python code receive h264 socket video stream mobile rpi3 using ffmpeg. code receiving video on python looks below. since rpi 0 w slow on ffmpeg, trying play using omxplayer. wondering if share light play h264 using omxplayer on rpi 0 w. not find useful material online. appreciate support...thank you!
code: select all
f = open('video.raw', 'wb') p = popen(['ffplay', '-framerate', '30', '-'], stdin=pipe, stdout=pipe) #p = popen(['gst-launch-1.0', 'fdsrc', '!', 'h264parse', '!', 'avdec_h264', '!', 'autovideosink'], stdin=pipe, stdout=pipe) skiped_metadata = false while true: data = self.request.recv(buffersize) if data == none or len(data) <= 0: break if not skiped_metadata: print "client connected, addr: ", self.client_address[0] if data.find('\r\n\r\n') > 0: last_ctrl = data.find('\r\n\r\n') + 4 print 'recv control data: ', data[0:last_ctrl] if len(data) > last_ctrl: p.stdin.write(data[last_ctrl:]) if save_to_file: f.write(data[last_ctrl:]) skiped_metadata = true else: p.stdin.write(data) if save_to_file: f.write(data) p.kill() if save_to_file: f.close()
raspberrypi
Comments
Post a Comment