[MEncoder-users] is this a good workflow?

Rick C. rickcorteza at gmail.com
Tue May 11 16:30:21 CEST 2010


On May 11, 2010, at 1:21 PM, Andrew Berg wrote:

> On 5/10/2010 9:39 AM, Rick C. wrote:
>> Hi again,
>> 
>> I'm looking for any input regarding this workflow:
>> 
>> 1.  extract the audio from original file:  mencoder original_file.mpg -of rawaudio -oac mp3lame -ovc copy -o audio.mp3
>> 2.  will convert audio.mp3 to audio.m4a outside of mencoder to avoid using libfaac
>> 3.  joining everything back together:  mencoder original_file.mpg -audiofile audio.m4a -oac copy -fafmttag 0x706D -ovc lavc -lavcopts vglobal=1:vcodec=mpeg4 -of lavf -lavfopts format=ipod -o new_file.m4v
>> 
>> This seems to work but is maybe a horrible way to do this and that's why I was looking for some input.  Any advice is much appreciated thanks,
>> 
>> rc
> I prefer to use Nero's AAC encoder and something like the following will
> work for any command-line audio encoder:
> 
> mencoder input.mpg -of avi -oac copy -ovc lavc -lavcopts
> vglobal=1:vcodec=mpeg4 -vf harddup -o temp.avi
> ffmpeg -i temp.avi -f wav - | neroaacenc -ignorelength -q 0.3 -if - -of
> temp.m4a
> mp4box -aviraw video temp.avi
> mp4box -add temp_video.h264:fps=29.97 -add temp.m4a -new output.mp4
> 
> You may have to tweak the last command a bit to get it to handle MPEG-4
> video properly (I never use MPEG-4; I prefer AVC). The advantage to this
> approach over Grozdan's is that you don't need named pipes (which AFAIK
> are either difficult or impossible to make on Windows or other
> non-UNIX-based systems) and there is no need for mplayer (which always
> messes up my terminal on a server I use that doesn't have X, even when
> it doesn't try to play video). It also seems cleaner, but that's really
> more of an opinion. BTW, -oac copy works just fine as long as you're
> processing the video and you use the harddup filter (unless of course
> mencoder can't mux the stream; e.g. LPCM must be converted to another
> format).

Thank you for all the input.  I was hoping I could do everything with the mencoder executable only but maybe that's not the case?  Here is where I'm at so far:

mencoder input.mpg -of avi -oac copy -ovc lavc -lavcopts vglobal=1:vcodec=mpeg4 -vf harddup -o temp.avi  (following Andrew's suggestion)

then trying to avoid the ffmpeg/mplayer executable:

mp4box -aviraw video temp.avi  (output = temp.FMP4)
mp4box -aviraw audio temp.avi  (output = temp.raw then converted to aac in separate encoder = temp.m4a)

then trying to put it all back together:

mp4box -add temp.FMP4 -add temp.m4a -new output.mp4  (keeps giving me error Corrupted data in file/stream temp.FMP4)

First I'm not quite sure about the corrupted data error?  And I just thought I would post back with what I'm doing and I probably didn't make it clear enough before I'm trying to stick with the mencoder executable as much as I can.  It's probably worth mentioning I'm using Mac and I had a little trouble trying to get mp4box for Mac so I don't know if that's an issue going forward.  The aac I can convert on the Mac I can't use Nero.  Thanks again for the help and any additional input is much appreciated.

rc













More information about the MEncoder-users mailing list