Audio Transcoding
The topic provides examples for transcoding an audio file.
The following code block shows the example in different scenarios.
- Transcode from WAV to AAC:
ffmpeg -i test1-16k-32b.wav -acodec aac test1-16k-32b.aac
- Transcode from WAV to MP3:
ffmpeg -i test1-16k-32b.wav -acodec libmp3lame test1-16k-32b.mp3
- Transcode from WAV to OGG Vorbis:
ffmpeg -i test1-16k-32b.wav -acodec libvorbis test1-16k-32b.ogg
- Transcode from WAV to FLAC:
ffmpeg -i test1-16k-32b.wav -acodec flac test1-16k-32b.flac
- Transcode from sample rate 16 K to 32 K:
ffmpeg -i test1-16k-32b.mp3 -ar 32000 output-test1-32k-32b.mp3
- Transcode from 2-channel to 1-channel:
ffmpeg -i test1-16k-32b.mp3 -ac 1 output-test1-16k-32b-ac1.mp3
- Transcode bit rate:
ffmpeg -i test1-16k-32b.mp3 -ab 128k output-test1-16k-32b-ab128k.mp3