目的縮小MP3檔案大小
雙聲道改單聲道
範例為音訊位元速率(bitrate) 從 160 kb/s 降為 64 kb/s
指令語法
ffmpeg -i <160k stereo filename>.mp3 -ac 1 -b:a 64k <output 64k mono filename>.mp3
-ac <channels> 設定音訊頻道數(set number of audio channels)
1 表示單聲道(mono)
2 表示雙聲道(stereo)
-b:a <bitrate> 音訊位元速率(bitrate)
小結
檔案大小縮小約為原來的 39.88%
~$ python
Python 3.9.6 (default, Jun 29 2021, 04:45:03)
..
>>> round(80973 / 203040 * 100,2)
39.88
執行指令範例
$ ffmpeg -i 1_setup_160k_stereo.mp3 -ac 1 -b:a 64k 1_setup_64k_mono.mp3
...
$ ffmpeg -i 1_setup_160k_stereo.mp3
Input #0, mp3, from '1_setup_160k_stereo.mp3':
Duration: 00:00:10.12, start: 0.069063, bitrate: 160 kb/s
Stream #0:0: Audio: mp3, 16000 Hz, stereo, fltp, 160 kb/s
Metadata:
encoder : LAME3.98r
$ ffmpeg -i 1_setup_64k_mono.mp3
Input #0, mp3, from 1_setup_64k_mono.mp3':
Metadata:
encoder : Lavf58.45.100
Duration: 00:00:10.08, start: 0.069063, bitrate: 64 kb/s
Stream #0:0: Audio: mp3, 16000 Hz, mono, fltp, 64 kb/s
$ ls -la 1_setup*
-rw-r--r--@ 1 tester staff 203040 Jul 24 18:38 1_setup_160k_stereo.mp3
-rw-r--r--@ 1 tester staff 80973 Jul 24 18:43 1_setup_64k_mono.mp3
沒有留言:
張貼留言