当前位置:网站首页>FFmepg使用指南
FFmepg使用指南
2022-07-05 04:05:00 【学如逆水行舟,不进则退3038】
1、//Ubuntu下安装ffmpeg
sudo apt update
sudo apt install ffmpeg
//验证安装,请使用以下ffmpeg -version命令,该命令显示FFmpeg版本
ffmpeg -version
2、要打印所有可用的FFmpeg的编码器和解码器
请输入:
ffmpeg -encoders (一般使用来重新编码)
ffmpeg -decoders
//查询ffmpeg支持哪些容器格式
ffmpeg -formats
//查询ffmpeg支持哪些编解码格式及编解码器名
ffmpeg -codecs
//基本转换
使用转换音频和视频文件时ffmpeg,不必指定输入和输出格式。自动检测到输入文件格式,并从文件扩展名中猜测输出格式。
将视频文件从mp4转换为webm:
ffmpeg -i input.mp4 output.webm
将音频文件从mp3转换为ogg:
ffmpeg -i input.mp3 output.ogg
一个视频的编码是MPEG4,想用H264编码
ffmpeg -i input.mp4 -vcodec h264(or libx264) H264_output.mp4 //input.mp4是指要转换视频的地址;output.mp4是转化后视频的存放路径
ffmpeg -i input.mp4 -vcodec libx265 H265_output.mp4
ffmpeg -i input.3gp -vcodec h263 H263_output.3gp //H263
ffmpeg -i input.webm -vcodec libvpx-vp9 vp9_output.webm
ffmpeg -i input.webm -vcodec libvpx vp8_output.webm
反也一样
ffmpeg -i input.mp4 -vcodec mpeg4 output.mp4
//帧率转化 60帧
ffmpeg -i 123.mp4 -r 60 456.mp4
//ffmpeg-修改分辨率
ffmpeg -i video_1920.mp4 -vf scale=640:360 video_640.mp4 -hide_banner
ffmpeg -i 4K_120fps_2160-3840.mp4 -vf scale=4096:2160 4k_120fps_4096-3840.mp4 -hide_banner
3、ffmpeg提取mp4文件中的音频,保存为wav文件
(1)ffmpeg -i 123.mp4 -acodec pcm_s16le -f s16le -ac 1 -ar 16000 -f wav 123.wav
这样就生成了一个wav文件,指定其为16位、单声道、采样率为16k。
其中 -f wav 是必不可少的,没了它,生成的就是pcm数据,而非wav,这里尤其要注意。
(2)如果只想获得原始的pcm文件,可以用下面的命令:
ffmpeg -i 123.mp4 -acodec pcm_s16le -f s16le -ac 1 -ar 16000 123.pcm
(3)ffmpeg 从视频中提取WAV格式的音频:
ffmpeg -i .[迅雷下载xunbo.cc]爱情公寓第二季EP20.rmvb -f wav -ar 16000 2-20.wav
4、ffmpeg将其他格式的音频转化为wav格式:
ffmpeg -i 'THE_CROODS__A_NEW_AGE.AC3 5.1声道.mka' -acodec pcm_s16le -f s16le -ac 6 -ar 48000 -f wav 123.wav
边栏推荐
- mysql的七种join连接查询
- @Transactional 注解导致跨库查询失效的问题
- 企业级:Spire.Office for .NET:Platinum|7.7.x
- UI自動化測試從此告別手動下載瀏覽器驅動
- Get to know MySQL connection query for the first time
- Resolved (sqlalchemy+pandas.read_sql) attributeerror: 'engine' object has no attribute 'execution_ options‘
- [brush questions] BFS topic selection
- 反絮凝剂-氨碘肽滴眼液
- Behavior perception system
- Threejs loads the city obj model, loads the character gltf model, and tweetjs realizes the movement of characters according to the planned route
猜你喜欢
“金九银十”是找工作的最佳时期吗?那倒未必
10种寻址方式之间的区别
快手、抖音、视频号交战内容付费
Online text line fixed length fill tool
Rome chain analysis
[array]566 Reshape the matrix - simple
C语言课设:影院售票管理系统
How to solve the problem that easycvr changes the recording storage path and does not generate recording files?
IronXL for .NET 2022.6
[understand series after reading] 6000 words teach you to realize interface automation from 0 to 1
随机推荐
【看完就懂系列】一文6000字教你从0到1实现接口自动化
Is there a sudden failure on the line? How to make emergency diagnosis, troubleshooting and recovery
EasyCVR平台出现WebRTC协议视频播放不了是什么原因?
Soul 3: what is interface testing, how to play interface testing, and how to play interface automation testing?
PlasticSCM 企业版Crack
How to solve the problem that easycvr changes the recording storage path and does not generate recording files?
测试开发是什么?为什么现在那么多公司都要招聘测试开发?
如何实现实时音视频聊天功能
[数组]566. 重塑矩阵-简单
WGS84 coordinate system, web Mercator, gcj02 coordinate system, bd09 coordinate system - brief introduction to common coordinate systems
[C language] address book - dynamic and static implementation
Use threejs to create geometry, dynamically add geometry, delete geometry, and add coordinate axes
Deep learning - LSTM Foundation
Use object composition in preference to class inheritance
Threejs Internet of things, 3D visualization of farms (I)
This article takes you to understand the relationship between the past and present of Bi and the digital transformation of enterprises
The new project Galaxy token just announced by coinlist is gal
Laravel8 export excel file
Wechat applet development process (with mind map)
Open graph protocol