So far, I've got 3 files that after using mencoder, have no audio. I'm using mencoder to size them down for a Creative Labs Zen.
The source in this case is a DVD, ripped to an ISO (movie only). The mencoder command I'm using is:
The player I always use is VLC, so I don't have any codecs/packs installed other than what the installed version of it puts on my system. The same mencoder command line has converted other iso & avi files just fine, but this problem exists with 3 files I've tried (out of about 20) so far.Code:mencoder [input filename] -oac mp3lame -ovc xvid -xvidencopts bitrate=-1 -vf scale -zoom -xy 320 -o [output.avi]
I'm using mencoder version 1.0rc2 downloaded from here - http://www.mplayerhq.hu/design7/dload.html
+ Reply to Thread
Results 1 to 17 of 17
-
-
console output?
you may have to specify audio with the audio id tag.
tripp -
Thanks for the reply. When I start the encoding, it scrolls in the cmd window continuously until it's complete, so I hit cancel after it started and here's what it put out. Let me know if there's a better way to get what you're asking for.
Code:E:\MovieSrc>mencoder "input filename" -oac mp3lame -ovc xvid -xvidencopts bitrate=- 1 -vf scale -zoom -xy 320 -o "g:\MovieDst\output filename" MEncoder 1.0rc2-4.2.1 (C) 2000-2007 MPlayer Team CPU: Intel(R) Core(TM)2 Quad CPU Q6700 @ 2.66GHz (Family: 6, Model: 15, Step ping: 11) CPUflags: Type: 6 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1 Compiled with runtime CPU detection. success: format: 0 data: 0x0 - 0x27a12800 MPEG-PS file format detected. VIDEO: MPEG2 720x480 (aspect 2) 29.970 fps 9801.6 kbps (1225.2 kbyte/s) [V] filefmt:2 fourcc:0x10000002 size:720x480 fps:29.97 ftime:=0.0334 ========================================================================== Opening audio decoder: [mp3lib] MPEG layer-2, layer-3 Too many video packets in the buffer: (4096 in 8260800 bytes). Maybe you are playing a non-interleaved stream/file or the codec failed? For AVI files, try to force non-interleaved mode with the -ni option. ADecoder init failed :( ADecoder init failed :( Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders Too many video packets in the buffer: (4096 in 8260800 bytes). Maybe you are playing a non-interleaved stream/file or the codec failed? For AVI files, try to force non-interleaved mode with the -ni option. Unknown/missing audio format -> no sound ADecoder init failed :( Opening audio decoder: [libmad] libmad mpeg audio decoder Too many video packets in the buffer: (4096 in 8260800 bytes). Maybe you are playing a non-interleaved stream/file or the codec failed? For AVI files, try to force non-interleaved mode with the -ni option. Cannot sync MAD frame ADecoder init failed :( ADecoder init failed :( Opening audio decoder: [hwmpa] MPEG audio pass-through (fake decoder) Too many video packets in the buffer: (4096 in 8260800 bytes). Maybe you are playing a non-interleaved stream/file or the codec failed? For AVI files, try to force non-interleaved mode with the -ni option. Cannot sync MPA frame: 0 ADecoder init failed :( ADecoder init failed :( Cannot find codec for audio format 0x50. Read DOCS/HTML/en/codecs.html! ========================================================================== xvid: using library version 1.1.3 (build xvid-1.1.3) Opening video filter: [expand osd=1] Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1 Opening video filter: [scale] ========================================================================== Opening video decoder: [mpegpes] MPEG 1/2 Video passthrough VDec: vo config request - 720 x 480 (preferred colorspace: Mpeg PES) The selected video_out device is incompatible with this codec. Try appending the scale filter to your filter list, e.g. -vf spp,scale instead of -vf spp. VDecoder init failed :( Opening video decoder: [libmpeg2] MPEG 1/2 Video decoder libmpeg2-v0.4.0b Selected video codec: [mpeg12] vfm: libmpeg2 (MPEG-1 or 2 (libmpeg2)) ========================================================================== VDec: vo config request - 720 x 480 (preferred colorspace: Planar YV12) VDec: using Planar YV12 as output csp (no 0) Movie-Aspect is 1.33:1 - prescaling to correct movie aspect. SwScaler: reducing / aligning filtersize 10 -> 12 SwScaler: reducing / aligning filtersize 10 -> 12 SwScaler: reducing / aligning filtersize 9 -> 8 SwScaler: reducing / aligning filtersize 9 -> 8 [swscaler @ 00D24D00]SwScaler: BICUBIC scaler, from yuv420p to yuv420p using MMX 2 [swscaler @ 00D24D00]SwScaler: using n-tap MMX scaler for horizontal luminance s caling [swscaler @ 00D24D00]SwScaler: using n-tap MMX scaler for horizontal chrominance scaling [swscaler @ 00D24D00]SwScaler: using n-tap MMX scaler for vertical scaling (YV12 like) [swscaler @ 00D24D00]SwScaler: 720x480 -> 320x240 videocodec: XviD (320x240 fourcc=44495658 [XVID]) xvid: par=0/0 (vga11), displayed=320x240, sampled=320x240 xvid: CBR Rate Control -- bitrate=-1kbit/s New_Face failed. Maybe the font path is wrong.n 0mb A-V:0.000 [0:0] Please supply the text font file (~/.mplayer/subfont.ttf). subtitle font: load_sub_face failed. Writing header... ODML: vprp aspect is 4:3. Writing header... ODML: vprp aspect is 4:3.
-
Here's the output from that command.
Code:MPlayer 1.0rc2-4.2.1 (C) 2000-2007 MPlayer Team CPU: Intel(R) Core(TM)2 Quad CPU Q6700 @ 2.66GHz (Family: 6, Model: 15, Step ping: 11) CPUflags: MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1 Compiled with runtime CPU detection. Playing E:\MovieSrc\filename.iso. ID_VIDEO_ID=0 ID_AUDIO_ID=0 MPEG-PS file format detected. VIDEO: MPEG2 720x480 (aspect 2) 29.970 fps 9801.6 kbps (1225.2 kbyte/s) ID_FILENAME=E:\MovieSrc\filename.iso ID_DEMUXER=mpegps ID_VIDEO_FORMAT=0x10000002 ID_VIDEO_BITRATE=9801600 ID_VIDEO_WIDTH=720 ID_VIDEO_HEIGHT=480 ID_VIDEO_FPS=29.970 ID_VIDEO_ASPECT=0.0000 ID_AUDIO_FORMAT=80 ID_AUDIO_BITRATE=0 ID_AUDIO_RATE=0 ID_AUDIO_NCH=0 ID_LENGTH=4048.19 ========================================================================== Opening video decoder: [mpegpes] MPEG 1/2 Video passthrough VDec: vo config request - 720 x 480 (preferred colorspace: Mpeg PES) Could not find matching colorspace - retrying with -vf scale... Opening video filter: [scale] The selected video_out device is incompatible with this codec. Try appending the scale filter to your filter list, e.g. -vf spp,scale instead of -vf spp. VDecoder init failed :( Opening video decoder: [libmpeg2] MPEG 1/2 Video decoder libmpeg2-v0.4.0b Selected video codec: [mpeg12] vfm: libmpeg2 (MPEG-1 or 2 (libmpeg2)) ========================================================================== ID_VIDEO_CODEC=mpeg12 ========================================================================== Opening audio decoder: [mp3lib] MPEG layer-2, layer-3 ID_AUDIO_ID=128 Too many video packets in the buffer: (4096 in 8260800 bytes). Maybe you are playing a non-interleaved stream/file or the codec failed? For AVI files, try to force non-interleaved mode with the -ni option. ADecoder init failed :( ADecoder init failed :( Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders Too many video packets in the buffer: (4096 in 8260800 bytes). Maybe you are playing a non-interleaved stream/file or the codec failed? For AVI files, try to force non-interleaved mode with the -ni option. Unknown/missing audio format -> no sound ADecoder init failed :( Opening audio decoder: [libmad] libmad mpeg audio decoder Too many video packets in the buffer: (4096 in 8260800 bytes). Maybe you are playing a non-interleaved stream/file or the codec failed? For AVI files, try to force non-interleaved mode with the -ni option. Cannot sync MAD frame ADecoder init failed :( ADecoder init failed :( Opening audio decoder: [hwmpa] MPEG audio pass-through (fake decoder) Too many video packets in the buffer: (4096 in 8260800 bytes). Maybe you are playing a non-interleaved stream/file or the codec failed? For AVI files, try to force non-interleaved mode with the -ni option. Cannot sync MPA frame: 0 ADecoder init failed :( ADecoder init failed :( Cannot find codec for audio format 0x50. Read DOCS/HTML/en/codecs.html! Audio: no sound Starting playback... Exiting... (End of file)
Is there a codec I can install for that? -
It's just ac3 audio then.
mplayer identify can sometimes need an extra parameter. identify=6 might be more helpful
-identify
Shorthand for -msglevel identify=4. Show file parameters in an easily parseable format. Also
prints more detailed information about subtitle and audio track languages and IDs. In some cases
you can get more information by using -msglevel identify=6. For example, for a DVD it will list
the time length of each title, as well as a disk ID. The wrapper script TOOLS/midentify suppresses
the other MPlayer output and (hopefully) shellescapes the filenames.
You'll have to pass either the -aid or -alang switch for the correct audio stream. First audio stream is usually -aid 128. If you want english audio and the DVD was authored correctly (looks like you're playing from a DVD image file) you could use -alang en.
To check supported audio playback codecs -
mplayer -ac help
for a complete list.
Some other commands that maybe usefull
mplayer -vc help
Check the video playback codecs
mencoder -ovc help
mencoder -oac help
Check video and audio codecs available for encoding.Linux _is_ user-friendly. It is not ignorant-friendly and idiot-friendly. -
I tried
mencoder "input filename.iso" -oac mp3lame -ovc xvid -xvidencopts bitrate=-1 -vf scale -zoom -xy 320 -o
-aid 128 "outputfilename.avi"
and
mencoder "input filename.iso" -oac mp3lame -ovc xvid -xvidencopts bitrate=-1 -vf scale -zoom -xy 320 -o
-alang en "outputfilename.avi"
and both had the same "Cannot find codec for audio format 0x50.".
The movie is simply a full quality "movie only" rip of one of my movies.
Another front end (SMPlayer) that uses MPlayer behind the scenes plays it with audio. It also indicates what you stated:
Code:Initial Audio Stream Format 8192 Bitrate 448 kbps Rate 48000 Hz Channels 2 Selected codec a52 Audio Streams # Language Name ID 0 en <empty> 128
-
Originally Posted by Airjrdn
Code:mencoder "input filename.iso" -oac mp3lame -ovc xvid -xvidencopts bitrate=-1 -vf scale -zoom -xy 320 -alang en -o "outputfilename.avi"
-
Got it! Two so far now have audio, I haven't tried the 3rd yet.
This worked:
mencoder "input filename.iso" -oac mp3lame -aid 128 -ovc xvid -xvidencopts bitrate=-1 -vf scale -zoom -x
y 320 -o "output filename.avi"
Thanks a ton for your help, I'd have never figured that out on my own. -
Followup question.
The Zen doesn't seem to want to play files if either the width or height are outside of it's max resolution of 320x240. When converting some videos, I end up with an output file that has a resolution of 320x242. If I force it to be 320x240 it plays fine, but that's going to make widescreen videos look messed up because of the different aspect ratios.
Is there a way to say "resize so (width=320 and height <= 240) OR (width<=320 and height = 240)? -
You'd want to use something along these lines -
-vf scale=320:-11,expand=320:240
That will scale the input footage to 320xXXX according to A/R and round to 16. Expand letter boxes the images. So if it's scaled to 320x176, it will then add black bars of 32 pixels to the top and bottom.
Test it out first, I didn't run it through mencoder to see if the syntax is right or not.
<w>,<h>
scaled width/height (default: original width/height)
NOTE: If -zoom is used, and underlying filters (including libvo) are incapable of scal-
ing, it defaults to d_width/d_height!
0: scaled d_width/d_height
-1: original width/height
-2: Calculate w/h using the other dimension and the prescaled aspect ratio.
-3: Calculate w/h using the other dimension and the original aspect ratio.
-(n+8): Like -n above, but rounding the dimension to the closest multiple of 16.Linux _is_ user-friendly. It is not ignorant-friendly and idiot-friendly. -
Thanks, I'll test it out.
Prior to your post, I'd found this which is similar, but states:
Ok, here's a further evolution of my Mencoder options for making video for the DV...
mencoder [in_file] -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=1000:vhq:keyint=250:threads= 2 -oac mp3lame -lameopts cbr:br=128 -ffourcc XVID -vf scale=320:-2,crop=320:240,expand=320:240 -af resample=44100:0:0 -o [out_file]
I also found that it's best to use a constant bit rate for the audio, or you'll get the out of sync audio problem if you seek around the video.
One more item to note on the command line, there is "threads=2"... this is to speed up the encoding for dual-core processors or hyper-threaded processors. If you just have a regular processor, you'll want to set that to 1, or it may make your encoding time even slower.
With these settings, video seems to average around 300megs/hour of play, and I find the quality to be quite good. -
The video scaling seems to be ok now, but I have one audio issue. Sometimes I have to use -aid 128 to get audio, while other times, using -aid 128 produces no audio at all.
Looking at http://www.mplayerhq.hu/DOCS/man/en/mplayer.1.html it seems like you can use different -alang options if you pass in comma separated values, but -aid doesn't support multiple parms.
Is there any way to tell mencoder to use -aid 128 if it needs to, and not to otherwise?
This is the command line with the -aid 128
for %%i in (*.flv,*.avi,*.mov,*.vob,*.mkv,*.iso,*.mpg,*.mpeg, *.divx,*.mp4) do mencoder "%%i" -oac mp3lame -aid 128 -lameopts cbr:br=128 -ovc xvid -xvidencopts fixed_quant=4 -vf scale=320:-2,crop=320:240 -o "G:\MovieDst\%%i".avi -
Well, I didn't set out to learn much about batch programming, but I learned some things anyway.
This code dumps the first 100 frames of each movie to a file just as if it's doing the conversion. Then, it opens the file, dumping information about it out to a .info file. I then open those up, and based on their contents, either do the -aid 128 or not. In the end, you run one batch file to convert any type of movie, and it takes care of making the audio decisions for you. So far I've not found any this doesn't work with, but I haven't had a ton of time to test it yet either.
@@Echo off
md output
for %%i in (*.flv,*.avi,*.mov,*.vob,*.mkv,*.iso,*.mpg,*.mpeg, *.divx,*.mp4) do mencoder "%%i" -oac mp3lame -lameopts cbr:br=128 -ovc xvid -xvidencopts fixed_quant=4 -vf scale=320:-2,crop=320:240 -frames 100 -o "%%i#.avi"
for %%i in (*#.avi) do mplayer "%%i" -v -frames 0 > "%%i".info
del *#.avi
for /F "tokens=1 delims=:" %%a in ('findstr /I /M /C:"no sound" *.info') do echo mencoder "%%a" -oac mp3lame -aid 128 -lameopts cbr:br=128 -ovc xvid -xvidencopts fixed_quant=4 -vf scale=320:-2,crop=320:240 -o "%%a.avi" >> temp.txt
for /F "tokens=1 delims=:" %%a in ('findstr /I /M /C:"Found audio stream" *.info') do echo mencoder "%%a" -oac mp3lame -lameopts cbr:br=128 -ovc xvid -xvidencopts fixed_quant=4 -vf scale=320:-2,crop=320:240 -o "%%a.avi" >> temp.txt
del *.info
call:encode #.avi.info "" temp.txt
move *.???.avi .\output\
del temp.txt
goto :eof
:encode OldStr NewStr File
:ubstitute OldStr NewStr File -- substitute a string in a text file
:: -- OldStr [in] - string to be replaced
:: -- NewStr [in] - string to replace with
:: -- File [in] - file to be parsed
created 20060101
changed 20080326
source http://www.dostips.com
SETLOCAL DISABLEDELAYEDEXPANSION
rem if "%*"=="" type %3|find /v ""
for /f "tokens=1,* delims=]" %%A in ('"type %3|find /n /v """') do (
set "line=%%B"
if defined line (
call set "line=echo.%%line:%~1=%~2%%"
for /f "delims=" %%X in ('"%%line%%"') do %%~X
) ELSE echo.
)
EXIT /b
:eof
Similar Threads
-
Empty audio files when converting MPEG2 with h.264 mencoder or h.264 x264
By doctormelodious in forum ffmpegX general discussionReplies: 3Last Post: 4th Jul 2010, 08:12 -
Mencoder line help for trekstor i.beat move player [linux] - (solved)
By tolostoi in forum Video ConversionReplies: 0Last Post: 2nd Jul 2009, 02:10 -
SOLVED: Audio out of sync or no audio - mkv/h.264 to avi/xvid
By dwoozle in forum Video ConversionReplies: 3Last Post: 2nd Feb 2009, 16:14 -
[Solved] Question about MPlayer filters in FFDShow and Mencoder filters
By BlooderButcher in forum Video ConversionReplies: 4Last Post: 24th Nov 2008, 11:32 -
mencoder converting realmedia files w/audio sync problems
By kruuth in forum Video ConversionReplies: 9Last Post: 26th Sep 2007, 15:34