![](https://seccdn.libravatar.org/avatar/f5225f6b8cbcf825ed261f46eeb3565d.jpg?s=120&d=mm&r=g)
Hi, Having digged net for a second day I am still having trouble converting a bunch of DIVX, XViD and QuickTime *.mov files into H264 (with mencoder) with AAC audio. Anyone please could help? I am trying to use one-line script for one-pass encoding: mencoder -oac faac -ovc x264 $1 -o $1.mp4 However, it produces no sound and throws message: WARNING: OUTPUT FILE FORMAT IS _AVI_. See -of help. I have no clue reason about. mencoder -oac copy -ovc x264 $1 -o $1.mp4 generates valid video file but sound track is being directly copied and remain mp3 What I would like to write a script which scans given directory for *.avi and *.mov files, and converts them to H264/AAC sound using 2-pass encoding (since my script cannot do what is need in 1-pass I even did not tried 2-pass encoding). Anyone could suggest a workable solution? Thanks in advance.
![](https://seccdn.libravatar.org/avatar/e8cc97894d67dac28ae34b6387fad315.jpg?s=120&d=mm&r=g)
On Mon, 2006-09-11 at 23:04 +0300, Andrei Verovski (aka MacGuru) wrote:
Hi,
Having digged net for a second day I am still having trouble converting a bunch of DIVX, XViD and QuickTime *.mov files into H264 (with mencoder) with AAC audio.
Anyone please could help?
I am trying to use one-line script for one-pass encoding: mencoder -oac faac -ovc x264 $1 -o $1.mp4
However, it produces no sound and throws message: WARNING: OUTPUT FILE FORMAT IS _AVI_. See -of help. I have no clue reason about.
mencoder -oac copy -ovc x264 $1 -o $1.mp4 generates valid video file but sound track is being directly copied and remain mp3
What I would like to write a script which scans given directory for *.avi and *.mov files, and converts them to H264/AAC sound using 2-pass encoding (since my script cannot do what is need in 1-pass I even did not tried 2-pass encoding).
Anyone could suggest a workable solution?
Thanks in advance.
Dont think mp4 is a "valid" format, when you follow the instructions you get the following: Available output formats: avi - Microsoft Audio/Video Interleaved mpeg - MPEG-1/2 system stream format lavf - FFmpeg libavformat muxers rawvideo - (video only, one stream only) raw stream, no muxing rawaudio - (audio only, one stream only) raw stream, no muxing I havent used faac audio codec myself, but try some of the opts: faac (-faacopts) br=<bitrate> average bitrate in kbps (mutually exclusive with quality) quality=<1-1000> quality mode, the higher the better (mutually exclusive with br) object=<0-3> object type complexity 1 MAIN (default) 2 LOW 3 SSR 4 LTP (extremely slow) mpeg=<2|4> MPEG version (default: 4) tns Enables temporal noise shaping. cutoff=<0-sampling_rate/2> cutoff frequency (default: sampling_rate/2) raw Stores the bitstream as raw payload with extradata in the container header (default: 0, corresponds to ADTS). Do not set this flag if not explicitly required or you will not be able to remux the audio stream later on. E-Mail disclaimer: http://www.sunspace.co.za/emaildisclaimer.htm
![](https://seccdn.libravatar.org/avatar/f5225f6b8cbcf825ed261f46eeb3565d.jpg?s=120&d=mm&r=g)
On Tuesday 12 September 2006 09:50, Hans van der Merwe wrote:
I havent used faac audio codec myself, but try some of the opts:
faac (-faacopts) br=<bitrate> average bitrate in kbps (mutually exclusive with quality)
quality=<1-1000> quality mode, the higher the better (mutually exclusive with br)
Thanks for suggestion, no sound yet, sorry.
![](https://seccdn.libravatar.org/avatar/e17645ac806dd082f47f9a7000b31451.jpg?s=120&d=mm&r=g)
You need to use "-outf lavf". The muxer will guess the format from the output file name, you can force a format with "-lavfopts format=mp4". For my smartphone, I can encode a 3gpp-compliant .mp4 by specifying "-outf lavf -lavfopts format=3gp". Also note there is a list dedicated to mencoder usage at mplayerhq.hu. Also cf. http://www.mplayerhq.hu/DOCS/HTML/en/menc-feat-handheld-psp.html /Lennart måndag 11 september 2006 22:04 skrev Andrei Verovski (aka MacGuru):
Hi,
Having digged net for a second day I am still having trouble converting a bunch of DIVX, XViD and QuickTime *.mov files into H264 (with mencoder) with AAC audio.
Anyone please could help?
I am trying to use one-line script for one-pass encoding: mencoder -oac faac -ovc x264 $1 -o $1.mp4
However, it produces no sound and throws message: WARNING: OUTPUT FILE FORMAT IS _AVI_. See -of help. I have no clue reason about.
mencoder -oac copy -ovc x264 $1 -o $1.mp4 generates valid video file but sound track is being directly copied and remain mp3
What I would like to write a script which scans given directory for *.avi and *.mov files, and converts them to H264/AAC sound using 2-pass encoding (since my script cannot do what is need in 1-pass I even did not tried 2-pass encoding).
Anyone could suggest a workable solution?
Thanks in advance.
-- !++ ! Lennart Börjeson ! Partner, Developer ! Cinnober Financial Technology AB ! Industrigatan 2A ! S-112 46 STOCKHOLM ! Sverige/Sweden/Schweden/Suède ! mailto:Lennart.Borjeson@cinnober.com ! phone:+46-8-50304717 ! gsm:+46-70-3394717 ! fax:+46-8-50304701 ! http://www.cinnober.com !--
![](https://seccdn.libravatar.org/avatar/f5225f6b8cbcf825ed261f46eeb3565d.jpg?s=120&d=mm&r=g)
On Tuesday 12 September 2006 10:49, Lennart Börjeson wrote:
You need to use "-outf lavf". The muxer will guess the format from the output file name, you can force a format with "-lavfopts format=mp4".
For my smartphone, I can encode a 3gpp-compliant .mp4 by specifying "-outf lavf -lavfopts format=3gp".
Thanks. Its looks like this feature is broken in mencoder This is warning message: ** MUXER_LAVF ***************************************************************** If you wish to use libavformat muxing, you must ensure that your video stream does not contain B frames (out of order decoding) and specify: -lavfopts i_certify_that_my_video_stream_does_not_use_b_frames on the command line. REMEMBER: MEncoder's libavformat muxing is presently broken and will generate INCORRECT files in the presence of B frames. Moreover, due to bugs MPlayer will play these INCORRECT files as if nothing were wrong!
![](https://seccdn.libravatar.org/avatar/e17645ac806dd082f47f9a7000b31451.jpg?s=120&d=mm&r=g)
tisdag 12 september 2006 21:10 skrev Andrei Verovski (aka MacGuru):
On Tuesday 12 September 2006 10:49, Lennart Börjeson wrote:
You need to use "-outf lavf". The muxer will guess the format from the output file name, you can force a format with "-lavfopts format=mp4".
For my smartphone, I can encode a 3gpp-compliant .mp4 by specifying "-outf lavf -lavfopts format=3gp".
Thanks. Its looks like this feature is broken in mencoder
This is warning message:
** MUXER_LAVF ***************************************************************** If you wish to use libavformat muxing, you must ensure that your video stream does not contain B frames (out of order decoding) and specify: -lavfopts i_certify_that_my_video_stream_does_not_use_b_frames on the command line. REMEMBER: MEncoder's libavformat muxing is presently broken and will generate INCORRECT files in the presence of B frames. Moreover, due to bugs MPlayer will play these INCORRECT files as if nothing were wrong!
According to the man page for mencoder (look up the qualifier vmax_b_frames) the default is no B-frames. So, even if the muxer is not yet fully implemented (I'd not go so far as to call it "broken") you can safely use it by specifying the rediculously long option as shown in the warning message, e.g.: -lavfopts format=mp4:i_certify_that_my_video_stream_does_not_use_b_frames or any other combination you need. -- !++ ! Lennart Börjeson ! Partner, Developer ! Cinnober Financial Technology AB ! Industrigatan 2A ! S-112 46 STOCKHOLM ! Sverige/Sweden/Schweden/Suède ! mailto:Lennart.Borjeson@cinnober.com ! phone:+46-8-50304717 ! gsm:+46-70-3394717 ! fax:+46-8-50304701 ! http://www.cinnober.com !--
participants (3)
-
Andrei Verovski (aka MacGuru)
-
Hans van der Merwe
-
Lennart Börjeson