Log in

View Full Version : Mencoder - Possible To Do No Video Encode (just AC3)


video_magic
8th July 2005, 01:39
Hello, I tried to use the ac3 encoding with Mencoder, but I get an error which states requirement for a video stream. I read through the Document page that came with the mplayer/mencoder package, and in my commandline I thought I had included the correct options to encode just a single pcm stereo 16bit 48000 wave file to ac3.
As you can see I specified novideo & chose output format of rawaudio which the Doc states is used for a single audio stream only.

I made a single line bat file named ac3menc as follows: (the line will probably wrap in my post)

C:\asblah\mplayerCVSofficial\mencoder -novideo d:\jamesrandi\toprocess\jrprincetonstereo48.wav -of rawaudio -oac lavc -lavcopts acodec=ac3:abitrate=160: -o d:\jamesrandi\toprocess\jrprin.ac3


C:\asblah>ac3menc

C:\asblah>C:\asblah\mplayerCVSofficial\mencoder -novideo d:\jamesrandi\toprocess
\jrprincetonstereo48.wav -of rawaudio -oac lavc -lavcopts acodec=ac3:abitrate=16
0: -o d:\jamesrandi\toprocess\jrprin.ac3
MEncoder dev-CVS-050626-17:02-3.4.2 (C) 2000-2005 MPlayer Team
CPU: Intel Celeron 2/Pentium III Tualatin (Family: 6, Stepping: 1)
Detected cache-line size is 32 bytes
CPUflags: Type: 6 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 0 SSE2: 0
Compiled with runtime CPU detection - WARNING - this is not optimal!
To get best performance, recompile MPlayer with --disable-runtime-cpudetection.
File not found: 'frameno.avi'
Failed to open frameno.avi
success: format: 0 data: 0x0 - 0x59cb44d0
Audio file detected.
Video stream is mandatory!

Exiting...


:( Please help me use this program to create an ac3, For now I have used Belight but I would like to know for my own curiousness as I spent a long time trying to make it work, how to do it. Thanks

KpeX
8th July 2005, 01:55
In my experience with mencoder it doesn't do well for audio encoding only. Luckily this is easy to do with ffmpeg, which uses libavcodec as well. For example: ffmpeg -i input.wav -acodec ac3 -ac 2 -ab 160 output.ac3 There are a number of ffmpeg compiles available in the usual places, or it's fairly easy to compile it yourself with mingw.

video_magic
8th July 2005, 02:30
Aha, thanks KpeX, :)
I will check out a Celtic Druid ffmpeg compile

video_magic
28th July 2005, 19:46
I had left the problem and have been using FFMpeg fine, but I didn't like to have it at the back of my mind :D so I finally solved it and thought I would post how to do it.

This is using a 26th July compile from Sherpya.

Basically, forget about specifying -novideo or anything like that or even suggesting to mencoder that you don't want to encode any video :D
I had to mux my source wave file, together with it's corresponding video into an avi, using virtualdub. Then use the line below (in a Batch file). The video seems to be copying and it works away but it actually gets copied to 'nowhere'. I get just an ac3 out of it as I had wanted. The copy video thing is just to keep Mencoder happy.

C:\asblah\mncp3\mencoder "D:\atmp\pat\clipped\pat2forac3.avi" -ovc copy -oac lavc -lavcopts acodec=ac3:abitrate=192: -of rawaudio -o d:\atmp\pat2forac3.ac3

The program is great! but trying to figure out things like audio only encoding was down to trial and error more than anything.

EDIT: I had also had BeSweet suggested to me for encoding AC3 but this page:
http://www.videohelp.com/forum/userguides/129419.php

questions how compliant it is for DVD Authoring. Anyone expert know, that page is a couple of years old.