Video sequences with Flickering
I am implementing a tool for flicker r开发者_如何学Pythonemoval from Video. To test the tool, I am looking to get some Video Sequences(Any video format - MPEG4,H263,MPEG2,H264,Raw YUV) which have noticable amount of flickering present in them. I searched, but could not find any such videos.
BTW are there known Video post processing tools which allow flicker removal?
Any pointers would help.
thank you. -AD
If you have a YUV-sequence, it would be quite simple to add artificial flickering at a certain period (50 Hz, 60 Hz or whatever) by either insert a white frame at the period in question or you can fiddle with the chroma-plane making the frame in question lighter.
Test sequences can be found here. yuv test-sequences
BTW. Normally mobile phones have built in flicker removal that works quite well that operates at a multiple of the net frequency. Slow motion video record at a frame rate not an multiple of say 25 or 30 Hz is something that some camera modules fails to compensate for when recording @ say VGA 100 fps.
Here is a python function to get you started that splits a YUV 4:2:0 into frames and stores each frame as a separate file.
def split(fname):
src_yuv = open(fname, 'rb')
cif = 352*288*1.5 # YUV 4:2:0 change to reflect your input!
# Get file size in bytes
src_yuv_size = os.stat(fname)[6]
nr_files = src_yuv_size / cif
filecnt = 0
while True:
buf = src_yuv.read(cif) # read qcif number of bytes
if buf:
s = "frame" + "%s" % filecnt + ".yuv"
dst_yuv = open(s, 'wb')
dst_yuv.write(buf) # write read data into new file
print "writing frame", filecnt
dst_yuv.close()
filecnt = filecnt + 1
else:
break
src_yuv.close()
精彩评论