快轉到主要內容

How to use FFmpeg ?

·308 字
Computer-Science FFmpeg
目錄

FFmpeg
#

A complete, cross-platform solution to record, convert and stream audio and video.
- https://ffmpeg.org/


Download
#

You can download it very simply.

 1# Debian / Ubuntu
 2sudo apt-get install ffmpeg
 3 
 4# Arch Linux
 5sudo pacman -S ffmpeg
 6 
 7#REHL / CentOS / Fedora
 8sudo dnf install ffmpeg
 9sudo rpm install ffmpeg
10sudo yum install ffmpeg

Using
#

Change FPS
#

1ffmpeg -i input.avi -filter:v fps=fps=30 output.avi

It’s means change the FPS of file “input.avi” to 30, and output its filename to “output.avi”.

Convert format
#

For default method, you can just using like that:

1ffmpeg -i input.mp4 output.avi

Reduce file size
#

Calculate the bitrate you need by dividing your target size (in bits) by the video length (in seconds). For example for a target size of 1 GB (one gigabyte, which is 8 gigabits) and 10 000 seconds of video (2 h 46 min 40 s), use a bitrate of 800 000 bit/s (800 kbit/s):

1ffmpeg -i input.mp4 -b 800k output.mp4

Additional options that might be worth considering is setting the Constant Rate Factor, which lowers the average bit rate, but retains better quality. Vary the CRF between around 18 and 24 — the lower, the higher the bitrate.

1ffmpeg -i input.mp4 -vcodec libx264 -crf 20 output.mp4

- Vicky Chijwani on StackExchange


By the way, you are able to change the video format to H.265, it’s better than H.264.
And also you can add arugument fps-fps=30 to specify the FPS to 30, so it will be looks like that:

1ffmpeg -i input.mp4 -vcodec libx265 -crf 20 fps-fps=30 output.mp4

More Detail
#

For more detail, please go to watching the documentation of FFmpeg Offical Website.
Here is the link: https://ffmpeg.org/ffmpeg.html


References
#

Alpaca
作者
Alpaca
No one can stop my feet.

相關文章

Ubuntu 更改家目錄語言
·574 字
Computer-Science Ubuntu

簡單幾步變更家目錄的語言

CTF 「hackme」Web Write Up
·17858 字
Computer-Science CTF
Change root password in MySQL 8
·136 字
Computer-Science MySQL

Change the password of root in mysql version 8

Ubuntu 更換 /Home 到新硬碟
·1364 字
Computer-Science Ubuntu Disk

如果發現當初掛載好的空間不夠用了,那麼擴充硬碟上去,然後照著步驟一步步的將檔案們搬家吧。

How to use PPPoE to connect network on Ubuntu?
·353 字
Computer-Science Ubuntu PPPoE

在 Ubuntu 用 PPPoE 連線中華電信固定 IP。

Build a FTP Server with 「vsftpd」
·343 字
Computer-Science FTP

How to build the FTP Server quicly with 「vsftpd」?