简体   繁体   中英

ffmpeg equivalent for sox -t ima

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

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM