PDA

View Full Version : Uncompressed PCM and mencoder


kitanai
26th August 2007, 23:41
I am trying to convert some movies I recorded with my Canon A620 camera (yeah, shame on me...) into xvid. The original files are encoded with MJPEG, accompanied by an uncompressed PCM audio track. At least that's what mplayer tells me.

Encoding the video part is a piece of cake, but audio is giving me a headache: I can't use the demuxed audio file (mplayer/virtualdub) with any application (winamp, lame, etc.), it's always overamplified. A conversion by lame ends up in pure noise :confused:

Muxing the re-encoded video with the original audio track doesn't work, either. mencoder keeps telling me: mencoder -oac copy -ovc copy -o out.avi -audiofile in.wav video.avi
[...]
AVI_NI: No audio stream found -> no sound.I suspect this uncompressed PCM thing to be the problem. Therefore my post in "audio encoding". I'd appreciate a hint... Many Thanks! :)

[edit] -------------------------------------------
I thought I'd give you some more details about the source file:AVI file format detected.
VIDEO: [MJPG] 640x480 24bpp 30.000 fps 15053.2 kbps (1837.6 kbyte/s)
[V] filefmt:3 fourcc:0x47504A4D size:640x480 fps:30.00 ftime:=0.0333
==========================================================================
Opening audio decoder: [pcm] Uncompressed PCM audio decoder
AUDIO: 11024 Hz, 1 ch, u8, 88.2 kbit/100.00% (ratio: 11024->11024)
Selected audio codec: [pcm] afm: pcm (Uncompressed PCM)
==========================================================================
videocodec: framecopy (640x480 24bpp fourcc=47504a4d)
Cannot set LAME options, check bitrate/samplerate, some very low bitrates
(<32) need lower samplerates (i.e. -srate 8000).
If everything else fails, try a preset.
Exiting...

madshi
27th August 2007, 22:25
You can try using "sox" to convert the PCM into a WAV file. You'll have to tell sox which parameters your PCM file has (number of channels, khz, big/little endian etc). Check the WAV with Audacity. Try signed/unsigned. Try big/little endian. One combination of flags should work. Usually PCM is big endian and signed, I believe.

kitanai
28th August 2007, 02:07
Thanks a lot for your help! Works like a charm :)

Took my a while to figure out the correct import settings for raw data in Audacity, but I managed to come up with a command line for SoX:sox -V -r 11024 -u -b -c 1 in.raw -r 11024 -s -w -c 1 out.wavIt may not be pretty, but now I can finally convert all my video files in batch mode, yehaa! :thanks: