Failed to save pcm sound in .mp4 container file

Can I save a pcm audio file to a .mp4 file?

I used the ffmpeg command "ffmpeg -i tempA.wav -acodec copy temp.mp4", but could not save it in the mp4 container file.

Input # 0, wav, from 'tempA.wav':

Duration: 00: 01: 36.51, bit: 128 kb / s

Stream #0.0: Audio: pcm_s16le, 8000 Hz, 1 channels, s16, 128 kb/s 

[mp4 @ 0x7d70e0] Tag [1] [0] [0] [0] / 0x00000001 is not compatible with the output codec id '65536'

Output # 0, mp4, 'temp.mp4':

 Stream #0.0: Audio: pcm_s16le, 8000 Hz, 1 channels, 128 kb/s 

Stream Display:

Stream # 0.0 → # 0.0

Failed to write header for output file # 0 (incorrect codec parameters?)

Where when converting to .AVI (ffmpeg -i tempA.wav -acodec copy temp.avi) & amp; .MOV (ffmpeg -i tempA.wav -acodec copy temp.mov) file formats work great.

+6
source share
1 answer

I don't think the mp4 container format supports raw pcm audio. You will have to use either avi or mov. See the wikipedia link for a supported audio format for the mp4 container.

http://en.wikipedia.org/wiki/Comparison_of_container_formats

Also follow the link to the doom9 forum.

http://forum.doom9.org/archive/index.php/t-140877.html

Official page

http://mpeg.chiariglione.org/standards/mpeg-4/audio

+6
source

Source: https://habr.com/ru/post/949458/


All Articles