VideoHelp Forum




+ Reply to Thread
Results 1 to 17 of 17
  1. 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:
    Code:
    mencoder [input filename] -oac mp3lame -ovc xvid -xvidencopts bitrate=-1 -vf scale -zoom -xy 320 -o [output.avi]
    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.

    I'm using mencoder version 1.0rc2 downloaded from here - http://www.mplayerhq.hu/design7/dload.html
    Quote Quote  
  2. Member
    Join Date
    Dec 2004
    Location
    Triptonia
    Search Comp PM
    console output?

    you may have to specify audio with the audio id tag.


    tripp
    Quote Quote  
  3. 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.
    Quote Quote  
  4. Member
    Join Date
    Dec 2004
    Location
    Triptonia
    Search Comp PM
    yeah the audio decoder fails to initialize.

    try
    mplayer "input filename" -identify -frames 0

    see what info you can get on the audio.

    you may have to try separating audio and video before bringing them back together.


    gl
    Quote Quote  
  5. 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)
    "Cannot find codec for audio format 0x50."
    Is there a codec I can install for that?
    Quote Quote  
  6. Since VLC plays the file fine, I pulled it up, started playing it, and then went to View->Stream and Media Info. In there, it has a section that states:

    Stream 1
    Codec: a52
    Language: English
    Type: Audio
    Quote Quote  
  7. Get Slack disturbed1's Avatar
    Join Date
    Apr 2001
    Location
    init 4
    Search Comp PM
    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.
    Quote Quote  
  8. 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
    Quote Quote  
  9. Member
    Join Date
    Dec 2004
    Location
    Triptonia
    Search Comp PM
    Originally Posted by Airjrdn
    mencoder "input filename.iso" -oac mp3lame -ovc xvid -xvidencopts bitrate=-1 -vf scale -zoom -xy 320 -o
    -alang en "outputfilename.avi"
    well that's wrong. so try it again like this
    Code:
    mencoder "input filename.iso" -oac mp3lame -ovc xvid -xvidencopts bitrate=-1 -vf scale -zoom -xy 320 
    -alang en -o "outputfilename.avi"
    Quote Quote  
  10. 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.
    Quote Quote  
  11. 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)?
    Quote Quote  
  12. Get Slack disturbed1's Avatar
    Join Date
    Apr 2001
    Location
    init 4
    Search Comp PM
    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.
    Quote Quote  
  13. 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]
    To explain the video filters a bit, basically, it first scales the movie to 320x[whatever needs to be for correct aspect], then if the Y aspect is > 240, it will crop & center the video at 320x240.... last if the video is smaller than 320x240, I found the player would show green blocks and bizzare colors, so I added the expand parameter... so if your video was, for example 320x180... it would make it 320x240 and auto-center the video. In doing this, I found that would solve the strange video problems with videos that were smaller than 320x240.

    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.
    I just kicked off a batch of videos to convert with those settings, and I'll give yours a go after that.
    Quote Quote  
  14. 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
    Quote Quote  
  15. Member
    Join Date
    Dec 2004
    Location
    Triptonia
    Search Comp PM
    Originally Posted by Airjrdn
    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.
    so use -alang...
    Quote Quote  
  16. I tried. I did -alang en, and some still didn't have audio.
    Quote Quote  
  17. 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
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!