首页 > 编程语言 >python解决b 视频加密

python解决b 视频加密

时间:2022-09-24 09:00:18浏览次数:46  
标签:视频 加密 outfile python read rootDir import 255

代码很简单:

 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,如果不同,请自行修改。

标签:视频,加密,outfile,python,read,rootDir,import,255
From: https://www.cnblogs.com/guochaoxxl/p/16724905.html

相关文章

  • Python Operator Precedence – Learn how to perform operations in Python
    PythonOperatorPrecedence–LearnhowtoperformoperationsinPythonherearemanydifferenttypesofoperators.Whenevaluatingcomplexexpressionslike5+......
  • Why is exponentiation applied right to left? Python
    Whyisexponentiationappliedrighttoleft?回答1The**operatorfollowsnormalmathematicalconventions;itisright-associative:Intheusualcomputersc......
  • Google开发者大会最全视频资源
    最全的视频资源在官网,但同时,leetcode整理的个人觉得更加的棒! 特别企划|力扣带你逛谷歌开发者大会  Google开发者大会更大力的断推跨平台技术这几年总有些跑偏的......
  • Maximum and Minimum values for ints Python
    https://docs.python.org/3/library/sys.html#sys.int_infosys.int_infoAnamedtuplethatholdsinformationaboutPython’sinternalrepresentationofintegers......
  • What do these operators mean (** , ^ , %, //)? [closed] Python
    Whatdotheseoperatorsmean(**,^,%,//)?[closed] 回答1**:exponentiation  指数^:exclusive-or(bitwise) 异或%:modulus//:dividewithinte......
  • 学习笔记:python (2)
    python学习1.列表形式如下:names=['liuyufan','yebenhao','luyuhang']调用列表中的内容:names=['liuyufan','yebenhao','luyuhang']print=name[0]#输出li......
  • 学习笔记:python(1)
    python学习1.HelloWorldprint("HelloWorld!")注意与c语言不同输出函数为print而不是printf2.数据类型(1)字符串:可用“”表示!注意例:“asdhas”中“a”是第0个字符......
  • 入门Python,看完这篇就行了!
    转载请注明出处❤️作者:测试蔡坨坨原文链接:caituotuo.top/3bbc3146.html你好,我是测试蔡坨坨。众所周知,Python语法简洁、功能强大,通过简单的代码就能实现很多实用、有趣......
  • 视频结构化 AI 推理流程
    「视频结构化」是一种AI落地的工程化实现,目的是把AI模型推理流程能够一般化。它输入视频,输出结构化数据,将结果给到业务系统去形成某些行业的解决方案。换个角度,如果你......
  • python入门第三课
    pycharm下载与使用JETBRAINS官网:https://www.jetbrains.com/pycharm/1.免费版功能太少(community)我们尽量使用收费版(professional)30天试用。选择版本就选一......