当前位置:网站首页>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
边栏推荐
- Phpmailer reported an error: SMTP error: failed to connect to server: (0)
- How to solve the problem that easycvr changes the recording storage path and does not generate recording files?
- Judge whether the stack order is reasonable according to the stack order
- Basic function learning 02
- Deep learning - LSTM Foundation
- Threejs realizes sky box, panoramic scene, ground grass
- Official announcement! The third cloud native programming challenge is officially launched!
- 阿里云ECS使用cloudfs4oss挂载OSS
- Containerd series - detailed explanation of plugins
- 优先使用对象组合,而不是类继承
猜你喜欢

NEW:Devart dotConnect ADO. NET

Threejs rendering obj+mtl model source code, 3D factory model

测试开发是什么?为什么现在那么多公司都要招聘测试开发?

我就一写代码的,王总整天和我谈格局...

灵魂三问:什么是接口测试,接口测试怎么玩,接口自动化测试怎么玩?

Use threejs to create geometry, dynamically add geometry, delete geometry, and add coordinate axes

已解决(sqlalchemy+pandas.read_sql)AttributeError: ‘Engine‘ object has no attribute ‘execution_options‘

ABP vNext microservice architecture detailed tutorial - distributed permission framework (Part 2)

How is the entered query SQL statement executed?
![[wp]bmzclub writeup of several questions](/img/15/2838b93a605b09d3e2996f6067775c.png)
[wp]bmzclub writeup of several questions
随机推荐
laravel8 导出Excle文件
EasyCVR平台出现WebRTC协议视频播放不了是什么原因?
Deep learning - LSTM Foundation
Official announcement! The third cloud native programming challenge is officially launched!
快手、抖音、视频号交战内容付费
provide/inject
[an Xun cup 2019] not file upload
ActiveReportsJS 3.1 VS ActiveReportsJS 3.0
Why is there a reincarnation of 60 years instead of 120 years in the tiangan dizhi chronology
Online text line fixed length fill tool
阿里云ECS使用cloudfs4oss挂载OSS
The order of LDS links
About the recent experience of writing questions
长度为n的入栈顺序的可能出栈顺序种数
如何实现实时音视频聊天功能
Looking back on 2021, looking forward to 2022 | a year between CSDN and me
BDF application - topology sequence
北京程序员的真实一天!!!!!
[数组]566. 重塑矩阵-简单
花了2晚,拿到了吴恩达@斯坦福大学的机器学习课程证书