Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to store pcm audio in .mp4 container file

Is it possible to store a pcm audio file into .mp4 file?

I used ffmpeg command "ffmpeg -i tempA.wav -acodec copy temp.mp4" but unable to store it in mp4 container file.

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

Duration: 00:01:36.51, bitrate: 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 incompatible with output codec id '65536'

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

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

Stream mapping:

Stream #0.0 -> #0.0

Could not write header for output file #0 (incorrect codec parameters ?)

Where in converting to .AVI (ffmpeg -i tempA.wav -acodec copy temp.avi) & .MOV (ffmpeg -i tempA.wav -acodec copy temp.mov) file formats works perfectly fine.

like image 386
mrsatish Avatar asked Jul 15 '13 10:07

mrsatish


People also ask

Can MP4 contain PCM?

PCM is not a supported audio codec in MP4 containers.

How do I save a PCM file?

Select menu item File > Export > Export Audio...; in the "Export File" dialog choose WAV (Microsoft) signed 16-bit PCM in the "Save as type" dropdown, then enter a file. Click OK then click Save. If the Metadata Editor pops up at any stage, click OK. Metadata tags are not needed for WAV files in mobile phones.

What audio format does MP4 use?

MP4 can contain video and audio streams. The video streams can be encoded in the MPEG-1, MPEG-2, MPEG-4 and H. 264/AVC standards. The audio streams can be (HE)-AAC, MPEG-1 Audio Layer 1-2-3, CELP, TwinVQ, Vorbis or Apple Lossless.


1 Answers

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

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

Also follow doom9 forum link.

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

Official page

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

like image 110
praks411 Avatar answered Sep 17 '22 20:09

praks411