Good evening...
I was trying to find a faster/better scriptable way to hardsub some files I have than using avidemux and then ffmpeg, so I'm trying mencoder. The problem is that I don't understand the reason for this error:
Audio mediainfo for source file:MEncoder 1.0rc4-4.5.2 (C) 2000-2010 MPlayer Team
WARNING: OUTPUT FILE FORMAT IS _AVI_. See -of help.
success: format: 0 data: 0x0 - 0x18c93ddd
[mkv] Track ID 1: video (V_MPEG4/ISO/AVC) "V�deo", -vid 0
[mkv] Track ID 2: audio (A_AAC) "�udio", -aid 0, -alang jpn
[mkv] Track ID 3: subtitles (S_TEXT/ASS) "Legenda", -sid 0, -slang por
[mkv] Will play video track 1.
Matroska file format detected.
VIDEO: [avc1] 1280x720 24bpp 23.976 fps 0.0 kbps ( 0.0 kbyte/s)
[V] filefmt:31 fourcc:0x31637661 size:1280x720 fps:23.976 ftime:=0.0417
Opening video filter: [expand osd=1]
Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
Opening video filter: [dsize=640:360:0]
================================================== ========================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
================================================== ========================
Audio format 0x4134504d is incompatible with '-oac copy', please try '-oac pcm' instead or use '-fafmttag' to override it.
My command line is: (with or without -lavfopts format=mp4 the result is the same)Audio
ID : 2
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : LC
Codec ID : A_AAC
Duration : 23mn 41s
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 48.0 KHz
Compression mode : Lossy
Title : �udio
Language : Japanese
mencoder -endpos 20 -vf ass -vf dsize=640:360:0 -embeddedfonts -noskip -oac copy -ovc lavc -lavfopts format=mp4 -lavcopts vcodec=mpeg4:vqmin=2:vqmax=5:vbitrate=1000000 file.mkv -o teste.mp4
If I force an aac reencode it works, how come it can't be copied? Also I don't know how to use the -fafmttag to force aac...
OBS: Command line used to test the aac reencode:
mencoder -endpos 20 -vf ass -vf dsize=640:360:0 -embeddedfonts -noskip -oac faac -faacopts quality=800 -ovc lavc -lavfopts format=mp4 -lavcopts vcodec=mpeg4:vqmin=2:vqmax=5:vbitrate=1000000 file.mkv -o teste.mp4
I appreciate yout attention.
+ Reply to Thread
Results 1 to 7 of 7
-
Last edited by rzippert; 23rd Jul 2011 at 22:50.
-
AAC is a Variable Bit-Rate audio format. Even though the AVI container does support VBR audio, the Mencoder authors still live in the VfW-compatibility era.
As for the issue with the MP4 container, I'm unable to explain that.
Try re-encoding only the video with mencoder,
then remux with the original audio through mp4creator or mp4box. -
Unfortunately these are windows tools...
Both mp4box and mp4creator were originally written for Linux,
anyone can compile their publicly-available source-code. -
Oh... I clicked on the links from this forum and it says windows only there... o.o
-
Well... MP4Box worked for me. I'm gonna leave the command lines I'm using if someone comes by searching for such alternative:
I'm encoding for my cell phone (Nokia 5530), a Symbian phone, however this might work with any other smartphone without much changing. The video is not absolutely perfect but very nice at this bitrate.
First used mencoder to convert the video stream and hardsub it:
Code:mencoder -vf ass,dsize=640:360:0,scale=-3:360 -embeddedfonts -noskip -nosound -ovc lavc -lavcopts vcodec=mpeg4:vqmin=2:vqmax=10:vbitrate=1000000 input.mkv -o output.avi
Code:mkvextract tracks input.mkv 2:output.aac
Code:MP4Box -add output.aac final.mp4 MP4Box -add output.avi final.mp4
If I find any more info on these issues I'll reply here again. Many thanks for the help until now. -
You've probably already discovered that using FFMPEG for this is straightforward. For example...
ffmpeg -i "rtmp://sdwfchwqitj2v.cloudfront.net:443/cfx/st/mp4:PBS_CP_NOVA/NOVA3904_web16x9__866478.mp4" -acodec copy -vcodec copy "c:\users\username\desktop\Nova.flv"
...works just fine. You can set the output file to be ~/Leonardo.mp4 and most processors can handle the remuxing in real time (but you can't use VLC to monitor the file as it's being written since the container metadata will be incomplete).
You won't be so lucky with MENCODER because it wants to output only to .avi files. If you want it to output to any other container type, you have to instruct MENCODER to go through libavcodec using -of lavf ...then libav will determine the container you want through the extension of your output filename. However, once libav hands the ball back to MENCODER, it still assumes you are trying to fit an .aac audio stream into an .avi container--that's why you get the message...
mencoder "rtmp://sdwfchwqitj2v.cloudfront.net:443/cfx/st/mp4:PBS_CP_NOVA/NOVA3904_web16x9__866478.mp4" -of lavf -oac copy -fafmttag 0x706D \ -ovc copy -o "c:\users\username\desktop\Leonardo.flv"
The force audio format tag command allows you to output .aac into the container of your choice, whether it's .mp4 or .mkv; my example uses .flv because the resulting output file can be monitored in real time.
IMHO, this issue is insufficiently documented. The MENCODER manpage at http://www.mplayerhq.hu/DOCS/HTML/en/menc-feat-streamcopy.html is of very little help.
EDIT: According to http://www.mplayerhq.hu/DOCS/codecs-status.html#ac, 0x706D is one of the FOURCC codes for FFmpeg AAC (MPEG-2/MPEG-4 Audio) Codec.Last edited by sandw1ch; 2nd Feb 2014 at 21:40.
Similar Threads
-
MP4 w/ AAC ---> MP4 w/Compatible Audio
By NotSoEasy in forum Newbie / General discussionsReplies: 3Last Post: 26th Aug 2011, 15:41 -
MP4 (x264 / AAC / 720x480) to MP4 (x264 / AAC / iPod res)
By GrayStrickland in forum Video ConversionReplies: 2Last Post: 15th Jun 2009, 10:20 -
AAC in MENCODER
By banon in forum LinuxReplies: 2Last Post: 3rd Oct 2008, 07:27 -
MEncoder errors when copying mpeg2 file
By orev in forum Video ConversionReplies: 2Last Post: 22nd Feb 2008, 13:51 -
h264/AAC mkv -> h264/AAC mp4?
By joshwa in forum Video ConversionReplies: 7Last Post: 4th Jan 2008, 11:08