惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

AI
AI
TaoSecurity Blog
TaoSecurity Blog
H
Heimdal Security Blog
Help Net Security
Help Net Security
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Microsoft Azure Blog
Microsoft Azure Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Google DeepMind News
Google DeepMind News
爱范儿
爱范儿
The Cloudflare Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
人人都是产品经理
人人都是产品经理
大猫的无限游戏
大猫的无限游戏
N
News | PayPal Newsroom
V2EX - 技术
V2EX - 技术
博客园 - 【当耐特】
D
Darknet – Hacking Tools, Hacker News & Cyber Security
S
Secure Thoughts
C
CERT Recently Published Vulnerability Notes
罗磊的独立博客
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
P
Privacy & Cybersecurity Law Blog
有赞技术团队
有赞技术团队
S
Schneier on Security
S
SegmentFault 最新的问题
Google Online Security Blog
Google Online Security Blog
H
Hacker News: Front Page
The Last Watchdog
The Last Watchdog
Schneier on Security
Schneier on Security
PCI Perspectives
PCI Perspectives
IT之家
IT之家
Project Zero
Project Zero
博客园 - 司徒正美
P
Privacy International News Feed
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Jina AI
Jina AI
Security Latest
Security Latest
Hacker News - Newest:
Hacker News - Newest: "LLM"
腾讯CDC
C
CXSECURITY Database RSS Feed - CXSecurity.com
阮一峰的网络日志
阮一峰的网络日志
C
Check Point Blog
aimingoo的专栏
aimingoo的专栏
V
Vulnerabilities – Threatpost
W
WeLiveSecurity
NISL@THU
NISL@THU
Webroot Blog
Webroot Blog
N
Netflix TechBlog - Medium
L
Lohrmann on Cybersecurity

Lan小站-嗯,不错! - 综合笔记

Chrome 下载 http 进度 卡住 python-3.9.10-slim-buster Docker 镜像 安装mysqlclient 报错raise OSError("{} not found".format(_mysql_config_path)) OSError: mysql_config not found 八股文题库 - Lan小站-嗯,不错! 【油猴】将github项目在网页版vs code打开,Show Code To Visual Studio 绕过某博客查看文章验证码,关注公众号得验证码 - Lan小站-嗯,不错! Git 常用指令笔记,pycharm+gitlab,保姆级笔记 - Lan小站-嗯,不错! AttributeError: module 'asyncio' has no attribute 'to_thread' invalid request block size: 6030 (max 4096)...skip 爱普生l310打印机 打印不出蓝色和黄色 但是有墨水 - Lan小站-嗯,不错!
ffmpeg批量压缩视频 python - Lan小站-嗯,不错!
Lan · 2022-11-20 · via Lan小站-嗯,不错! - 综合笔记
import os


base_path = './input'
out_path = './output'

if not os.path.exists(base_path):
    print('请将要转码的视频放置在{}文件夹下面!'.format(base_path))
    os.mkdir(base_path)

if not os.path.exists(out_path):
    print('请将要转码的视频放置在{}文件夹下面!'.format(out_path))
    os.makedirs(out_path)

suffix = ('mov', 'mp4', 'mpeg', 'avi', 'flv', 'mkv')

#max_proc = int(input('请输入最大工作进程数量(建议为2~4) >> '))
#del_flag = input("处理完成后是否删除源文件?(y/n) >> ").lower()

del_flag = False


def run_func(path):
    name = path.split('\\')[-1]
    pid = os.getpid()
    os.system("ffmpeg -i ./input/{} -s 1920x1080  -b:v 1M  -r 20 ./output/{}".format(name, name))
    print('exit')

for root, dirs, files in os.walk(base_path, topdown=False):
    for name in files:
        if name.lower().endswith(suffix):
            p = os.path.join(root, name)
            run_func(p)

print('处理完成!')

将需要压缩的视频放到./input文件夹下,创建一个output文件夹。
www.lanol.cn