1 import sys                                                               
 2 from pathlib import Path
 3 from numpy import fromfile, uint8   # pip install numpy
 4 
 5 rootDir = Path(sys.argv[0]).resolve().parent  # 脚本文件的父文件夹的绝对路径 6 
 7 for f in rootDir.rglob("**/*.mp4"):
 8     read = fromfile(f, dtype=uint8)
 9     if all(read[0:3] == [255, 255, 255]):
10         outfile = f"{str(f.name)}"
11         read[3:].tofile(rootDir / outfile)
12         print(outfile)

使用也很简单,将该程序放到需要转换的文件的目录,执行python fileName.py,这里假设你的文件名为fileName,如果不同,请自行修改。

最后,还需要重命名文件:

mv 463263657_2_0.mp4   ../463263657现代控制原理/2/463263657_2_0.mp4
mv 463263657_3_0.mp4   ../463263657现代控制原理/3/463263657_3_0.mp4
mv 463263657_4_0.mp4   ../463263657现代控制原理/4/463263657_4_0.mp4
mv 463263657_5_0.mp4   ../463263657现代控制原理/5/463263657_5_0.mp4
mv 463263657_6_0.mp4   ../463263657现代控制原理/6/463263657_6_0.mp4
mv 463263657_7_0.mp4   ../463263657现代控制原理/7/463263657_7_0.mp4
mv 463263657_8_0.mp4   ../463263657现代控制原理/8/463263657_8_0.mp4
mv 463263657_9_0.mp4   ../463263657现代控制原理/9/463263657_9_0.mp4

mv 463263657_10_0.mp4  ../463263657现代控制原理/10/463263657_10_0.mp4
mv 463263657_11_0.mp4  ../463263657现代控制原理/11/463263657_11_0.mp4
mv 463263657_12_0.mp4  ../463263657现代控制原理/12/463263657_12_0.mp4
mv 463263657_13_0.mp4  ../463263657现代控制原理/13/463263657_13_0.mp4
mv 463263657_14_0.mp4  ../463263657现代控制原理/14/463263657_14_0.mp4
mv 463263657_15_0.mp4  ../463263657现代控制原理/15/463263657_15_0.mp4
mv 463263657_16_0.mp4  ../463263657现代控制原理/16/463263657_16_0.mp4
mv 463263657_17_0.mp4  ../463263657现代控制原理/17/463263657_17_0.mp4
mv 463263657_18_0.mp4  ../463263657现代控制原理/18/463263657_18_0.mp4
mv 463263657_19_0.mp4  ../463263657现代控制原理/19/463263657_19_0.mp4
mv 463263657_20_0.mp4  ../463263657现代控制原理/20/463263657_20_0.mp4

mv 463263657_21_0.mp4  ../463263657现代控制原理/21/463263657_21_0.mp4
mv 463263657_22_0.mp4  ../463263657现代控制原理/22/463263657_22_0.mp4
mv 463263657_23_0.mp4  ../463263657现代控制原理/23/463263657_23_0.mp4
mv 463263657_24_0.mp4  ../463263657现代控制原理/24/463263657_24_0.mp4
mv 463263657_25_0.mp4  ../463263657现代控制原理/25/463263657_25_0.mp4
mv 463263657_26_0.mp4  ../463263657现代控制原理/26/463263657_26_0.mp4
mv 463263657_27_0.mp4  ../463263657现代控制原理/27/463263657_27_0.mp4
mv 463263657_28_0.mp4  ../463263657现代控制原理/28/463263657_28_0.mp4
mv 463263657_29_0.mp4  ../463263657现代控制原理/29/463263657_29_0.mp4
mv 463263657_30_0.mp4  ../463263657现代控制原理/30/463263657_30_0.mp4

mv 463263657_31_0.mp4  ../463263657现代控制原理/31/463263657_31_0.mp4
mv 463263657_32_0.mp4  ../463263657现代控制原理/32/463263657_32_0.mp4
mv 463263657_33_0.mp4  ../463263657现代控制原理/33/463263657_33_0.mp4
mv 463263657_34_0.mp4  ../463263657现代控制原理/34/463263657_34_0.mp4
mv 463263657_35_0.mp4  ../463263657现代控制原理/35/463263657_35_0.mp4
mv 463263657_36_0.mp4  ../463263657现代控制原理/36/463263657_36_0.mp4
mv 463263657_37_0.mp4  ../463263657现代控制原理/37/463263657_37_0.mp4
mv 463263657_38_0.mp4  ../463263657现代控制原理/38/463263657_38_0.mp4
mv 463263657_39_0.mp4  ../463263657现代控制原理/39/463263657_39_0.mp4
mv 463263657_40_0.mp4  ../463263657现代控制原理/40/463263657_40_0.mp4

mv 463263657_41_0.mp4  ../463263657现代控制原理/41/463263657_41_0.mp4
mv 463263657_42_0.mp4  ../463263657现代控制原理/42/463263657_42_0.mp4
mv 463263657_43_0.mp4  ../463263657现代控制原理/43/463263657_43_0.mp4
mv 463263657_44_0.mp4  ../463263657现代控制原理/44/463263657_44_0.mp4
mv 463263657_45_0.mp4  ../463263657现代控制原理/45/463263657_45_0.mp4
mv 463263657_46_0.mp4  ../463263657现代控制原理/46/463263657_46_0.mp4
mv 463263657_47_0.mp4  ../463263657现代控制原理/47/463263657_47_0.mp4
mv 463263657_48_0.mp4  ../463263657现代控制原理/48/463263657_48_0.mp4
mv 463263657_49_0.mp4  ../463263657现代控制原理/49/463263657_49_0.mp4
mv 463263657_50_0.mp4  ../463263657现代控制原理/50/463263657_50_0.mp4

mv 463263657_51_0.mp4  ../463263657现代控制原理/51/463263657_51_0.mp4
mv 463263657_52_0.mp4  ../463263657现代控制原理/52/463263657_52_0.mp4
mv 463263657_53_0.mp4  ../463263657现代控制原理/53/463263657_53_0.mp4
mv 463263657_54_0.mp4  ../463263657现代控制原理/54/463263657_54_0.mp4
mv 463263657_55_0.mp4  ../463263657现代控制原理/55/463263657_55_0.mp4
mv 463263657_56_0.mp4  ../463263657现代控制原理/56/463263657_56_0.mp4
mv 463263657_57_0.mp4  ../463263657现代控制原理/57/463263657_57_0.mp4
mv 463263657_58_0.mp4  ../463263657现代控制原理/58/463263657_58_0.mp4
mv 463263657_59_0.mp4  ../463263657现代控制原理/59/463263657_59_0.mp4
mv 463263657_60_0.mp4  ../463263657现代控制原理/60/463263657_60_0.mp4

mv 463263657_61_0.mp4  ../463263657现代控制原理/61/463263657_61_0.mp4
mv 463263657_62_0.mp4  ../463263657现代控制原理/62/463263657_62_0.mp4
mv 463263657_63_0.mp4  ../463263657现代控制原理/63/463263657_63_0.mp4
mv 463263657_64_0.mp4  ../463263657现代控制原理/64/463263657_64_0.mp4
mv 463263657_65_0.mp4  ../463263657现代控制原理/65/463263657_65_0.mp4
mv 463263657_66_0.mp4  ../463263657现代控制原理/66/463263657_66_0.mp4
mv 463263657_67_0.mp4  ../463263657现代控制原理/67/463263657_67_0.mp4
mv 463263657_68_0.mp4  ../463263657现代控制原理/68/463263657_68_0.mp4
mv 463263657_69_0.mp4  ../463263657现代控制原理/69/463263657_69_0.mp4
mv 463263657_70_0.mp4  ../463263657现代控制原理/70/463263657_70_0.mp4

mv 463263657_71_0.mp4  ../463263657现代控制原理/71/463263657_71_0.mp4
mv 463263657_72_0.mp4  ../463263657现代控制原理/72/463263657_72_0.mp4
mv 463263657_73_0.mp4  ../463263657现代控制原理/73/463263657_73_0.mp4
mv 463263657_74_0.mp4  ../463263657现代控制原理/74/463263657_74_0.mp4
mv 463263657_75_0.mp4  ../463263657现代控制原理/75/463263657_75_0.mp4
mv 463263657_76_0.mp4  ../463263657现代控制原理/76/463263657_76_0.mp4
mv 463263657_77_0.mp4  ../463263657现代控制原理/77/463263657_77_0.mp4
mv 463263657_78_0.mp4  ../463263657现代控制原理/78/463263657_78_0.mp4
mv 463263657_79_0.mp4  ../463263657现代控制原理/79/463263657_79_0.mp4

 

人就像是被蒙着眼推磨的驴子,生活就像一条鞭子;当鞭子抽到你背上时,你就只能一直往前走,虽然连你也不知道要走到什么时候为止,便一直这么坚持着。