ffmpeg equivalent for sox -t ima

255 views Asked by At

I am trying to use ffmpeg to combine 1 audio file (ADPCM) and 1 video file (h264) into single mp4. Video by file conversion works fine but ffmpeg chokes on guessing audio input. I can't figure out how to tell ffmpeg which params to use to decode raw audio file.

Currently I first run sox to convert raw audio to wav:

sox -t ima -r 8000 audio.raw audio.wav

... then feed audio.wav from sox as ffmpeg input

ffmpeg -i video.raw -i audio.wav movie.mp4

I am trying to avoid sox step and use audio.raw in ffmpeg.

Thank you

1

There are 1 answers

0
seeker On

Since you have headless audio, you should tell ffmpeg about the sample format and (optionally) sample rate, audio channels, e.g.:

ffmpeg -i video.raw -f s16le -ar 22050 -ac 1 -i audio.raw movie.mp4

To check supported PCM formats you may use this command:

ffmpeg -formats 2>&1 | grep -i pcm