要处理的文件:
此处处理将00的数据干掉。
处理python脚本:
dir_fd = open('abc.yuv','rb+')
tmp_fd = open('tmp.yuv','wb+')
while True:
content = dir_fd.read() # content.int('',)
if content==b'\x00':
continue
if content==b'':
tmp_fd.write("/n")
break
print(content)
tmp_fd.write(content)
tmp_fd.flush()
dir_fd = open('abc.yuv','rb+')
tmp_fd = open('tmp.yuv','wb+')
while True:
content = dir_fd.read() # content.int('',)
if content==b'\x00':
continue
if content==b'':
tmp_fd.write("/n")
break
print(content)
tmp_fd.write(content)
tmp_fd.flush()
处理之后的效果: