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

推荐订阅源

博客园 - 【当耐特】
Help Net Security
Help Net Security
P
Proofpoint News Feed
J
Java Code Geeks
爱范儿
爱范儿
Last Week in AI
Last Week in AI
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
F
Full Disclosure
Google DeepMind News
Google DeepMind News
H
Help Net Security
G
Google Developers Blog
Jina AI
Jina AI
Vercel News
Vercel News
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
L
Lohrmann on Cybersecurity
S
Schneier on Security
Microsoft Azure Blog
Microsoft Azure Blog
IT之家
IT之家
Security Archives - TechRepublic
Security Archives - TechRepublic
阮一峰的网络日志
阮一峰的网络日志
N
News and Events Feed by Topic
GbyAI
GbyAI
B
Blog
O
OpenAI News
博客园_首页
Cisco Talos Blog
Cisco Talos Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Hacker News: Ask HN
Hacker News: Ask HN
TaoSecurity Blog
TaoSecurity Blog
腾讯CDC
MongoDB | Blog
MongoDB | Blog
M
MIT News - Artificial intelligence
C
Cybersecurity and Infrastructure Security Agency CISA
Cyberwarzone
Cyberwarzone
Webroot Blog
Webroot Blog
Simon Willison's Weblog
Simon Willison's Weblog
Y
Y Combinator Blog
C
Cisco Blogs
A
Arctic Wolf
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
T
The Exploit Database - CXSecurity.com
Security Latest
Security Latest
AI
AI
W
WeLiveSecurity
aimingoo的专栏
aimingoo的专栏
The Register - Security
The Register - Security
Project Zero
Project Zero
H
Hackread – Cybersecurity News, Data Breaches, AI and More
N
Netflix TechBlog - Medium
Blog — PlanetScale
Blog — PlanetScale

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