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

推荐订阅源

W
WeLiveSecurity
T
The Exploit Database - CXSecurity.com
C
CXSECURITY Database RSS Feed - CXSecurity.com
S
Security @ Cisco Blogs
T
Threat Research - Cisco Blogs
TaoSecurity Blog
TaoSecurity Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
腾讯CDC
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
T
The Blog of Author Tim Ferriss
Microsoft Azure Blog
Microsoft Azure Blog
罗磊的独立博客
F
Full Disclosure
博客园 - 【当耐特】
C
CERT Recently Published Vulnerability Notes
Engineering at Meta
Engineering at Meta
Application and Cybersecurity Blog
Application and Cybersecurity Blog
T
Threatpost
I
Intezer
V2EX - 技术
V2EX - 技术
H
Hackread – Cybersecurity News, Data Breaches, AI and More
The Hacker News
The Hacker News
小众软件
小众软件
Google DeepMind News
Google DeepMind News
T
Tailwind CSS Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
B
Blog RSS Feed
Microsoft Security Blog
Microsoft Security Blog
N
News | PayPal Newsroom
MyScale Blog
MyScale Blog
AI
AI
Vercel News
Vercel News
Spread Privacy
Spread Privacy
美团技术团队
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
The GitHub Blog
The GitHub Blog
V
Vulnerabilities – Threatpost
Schneier on Security
Schneier on Security
Cyberwarzone
Cyberwarzone
G
GRAHAM CLULEY
Help Net Security
Help Net Security
Hacker News: Ask HN
Hacker News: Ask HN
Google DeepMind News
Google DeepMind News
MongoDB | Blog
MongoDB | Blog
L
LINUX DO - 热门话题
U
Unit 42
L
LangChain Blog
Recent Announcements
Recent Announcements

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