YUV4MPEG2 (.y4m) Reader/Writer
tested with python-2.7, python-3.3 and python3.4
importsysimporty4mdefprocess_frame(frame):
# do something with the framepassif__name__=='__main__':
parser=y4m.Reader(process_frame, verbose=True)
# simulate chunk of datainfd=sys.stdinifsys.hexversion>=0x03000000: # Python >= 3infd=sys.stdin.bufferwithinfdasf:
whileTrue:
data=f.read(1024)
ifnotdata:
breakparser.decode(data)