0

I need to convert an audio stream's format. For example: suppose audio stream format is 16 bit Little endian, I want to convert it to 16 bit Big endian.

How can I do this?

0

It should be something like this:

$ ffmpeg -i input-file.wav -acodec pcm_f32le -ar 96000 output-file.wav

And you have plenty plenty of choices if you use PCM, other codecs may be constrained to certain profiles.

$ ffmpeg -formats 2>/dev/null | grep endian
 DE f32be           PCM 32 bit floating-point big-endian format
 DE f32le           PCM 32 bit floating-point little-endian format
 DE f64be           PCM 64 bit floating-point big-endian format
 DE f64le           PCM 64 bit floating-point little-endian format
 DE s16be           PCM signed 16 bit big-endian format
 DE s16le           PCM signed 16 bit little-endian format
 DE s24be           PCM signed 24 bit big-endian format
 DE s24le           PCM signed 24 bit little-endian format
 DE s32be           PCM signed 32 bit big-endian format
 DE s32le           PCM signed 32 bit little-endian format
 DE u16be           PCM unsigned 16 bit big-endian format
 DE u16le           PCM unsigned 16 bit little-endian format
 DE u24be           PCM unsigned 24 bit big-endian format
 DE u24le           PCM unsigned 24 bit little-endian format
 DE u32be           PCM unsigned 32 bit big-endian format
 DE u32le           PCM unsigned 32 bit little-endian format

$ ffmpeg -codecs 2>/dev/null | grep endian
 D A D  pcm_bluray      PCM signed 16|20|24-bit big-endian for Blu-ray media
 D A D  pcm_dvd         PCM signed 20|24-bit big-endian
 D A D  pcm_f32be       PCM 32-bit floating point big-endian
 D A D  pcm_f32le       PCM 32-bit floating point little-endian
 D A D  pcm_f64be       PCM 64-bit floating point big-endian
 D A D  pcm_f64le       PCM 64-bit floating point little-endian
 D A D  pcm_lxf         PCM signed 20-bit little-endian planar
 D A D  pcm_s16be       PCM signed 16-bit big-endian
 D A D  pcm_s16le       PCM signed 16-bit little-endian
 D A D  pcm_s16le_planar PCM 16-bit little-endian planar
 D A D  pcm_s24be       PCM signed 24-bit big-endian
 D A D  pcm_s24le       PCM signed 24-bit little-endian
 D A D  pcm_s32be       PCM signed 32-bit big-endian
 D A D  pcm_s32le       PCM signed 32-bit little-endian
 D A D  pcm_u16be       PCM unsigned 16-bit big-endian
 D A D  pcm_u16le       PCM unsigned 16-bit little-endian
 D A D  pcm_u24be       PCM unsigned 24-bit big-endian
 D A D  pcm_u24le       PCM unsigned 24-bit little-endian
 D A D  pcm_u32be       PCM unsigned 32-bit big-endian
 D A D  pcm_u32le       PCM unsigned 32-bit little-endian

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.