VideoHelp Forum




+ Reply to Thread
Results 1 to 9 of 9
  1. Member
    Join Date
    Apr 2006
    Location
    United States
    Search Comp PM
    Hi forum, I just had a few questions about Mencoder.exe. I have took on the task of writing code to automate MKV converstions to AVI using the Mencoder.exe command line with the help of this wonderful tutorial here. The only problem that I see is the video quality seems to be kind of choppy, poor quality and the only other way to describe it is it seems like there were some errors during the conversion process.

    I am wondering if there are some command line arguments that would make the quality of the converted AVI file alot better. I am new to Mencoder, so at this very moment, I just thought I would try to convert it to xvid, as seen in the aforementioned tutorial to see if that would help. I am at work and using Remote Desktop (Terminal Server) to convert it with the xvid command line, so I won't be able to see if that helps until I go home for break. Below is my command line for just doing a copy and the second one with xvid

    <COPY>
    mencoder.exe "C:\test.mkv" -aid 1 -oac mp3lame -ovc copy -o "C:\test.avi"
    </COPY>

    As I mentioned, at this moment, I am seeing if a xvid conversion would help the quality

    <XVID>
    mencoder.exe "C:\test.mkv" -oac mp3lame -ovc xvid -xvidencopts pass=1 -aid 1 -o "C:\videooutput.avi"
    </XVID>

    As for the MKV specs, the only tool I have to get information about it is MKVMerge and MKVExtract. Now the video name has "divx5.2" in it (ex: text_divx5.2.mkv), if that helps. If it helps, the HxW is 704 x 528 in MKVMerge GUI.

    If there is no other way to increase the quality, is there another command line tool available to convert MKV to AVI?

    Thanks, I will hang up and listen

    - Mike G.
    Quote Quote  
  2. Member
    Join Date
    Apr 2006
    Location
    United States
    Search Comp PM
    Let me add on to this question, if I may. I wanted to see what kind of quality AllToAVI GUI would render, which I am new to that converter as well.

    Does AllToPlayer GUI, use mencoder.exe to do the conversion, as the DOS command window seems to have the same activity as the one mencoder has?

    If so, how would I find the command line arguments that AllToPlayer GUI sends to mencoder.exe when one chooses the highest audio and video quality in the AllToPlayer GUI?

    - Mike G.
    Quote Quote  
  3. Member
    Join Date
    Dec 2004
    Location
    Triptonia
    Search Comp PM
    Originally Posted by mickgreen58
    As I mentioned, at this moment, I am seeing if a xvid conversion would help the quality
    It won't!
    Each subsequent lossy encode leads to degradation of the bitstream.
    Reasons to re-encode are to change something major like filesize, compatibility, resolution.
    You might also want to apply a multitude of filtering effects for a multitude of reasons and encode to output.

    Originally Posted by mickgreen58
    Now the video name has "divx5.2" in it (ex: text_divx5.2.mkv), if that helps. If it helps, the HxW is 704 x 528 in MKVMerge GUI.
    You don't have to re-encode divx to put it in a avi container.
    Personally I don't trust mencoder's mkv demuxer.
    With mkvtoolnix is mkvextract a command line app that'll put divx in to avi.
    You need to run mkverge with --identify to find out which track is which.
    Also with haali splitter is dsmux.
    Avimux-gui one would think would have a command line app behind it. But it doesn't. Still works very well though.
    Audio would probably have to be re-encoded. Probably be vorbis...
    Use mkvinfo to get details on your mkv file.

    I don't like alltoavi much.
    Quote Quote  
  4. Member
    Join Date
    Apr 2006
    Location
    United States
    Search Comp PM
    Thanks for the post, actually I got very good results with this command line:

    mencoder.exe "C:\test.mkv" -aid 1 -o "C:\test.avi" -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=1000:vpass=1 -ffourcc XVID -oac mp3lame -vf scale=704:528

    I am currently researching why the file wasn't gigantic and encoding didnt take long (14 mins) when the bitrate is set to 1000, which I would think would make the file huge.

    The result was a video that wasn't choppy and jerky.

    - Mike G.
    Quote Quote  
  5. Member
    Join Date
    Dec 2004
    Location
    Triptonia
    Search Comp PM
    Testing is good.
    What you do depends on your source.
    I'll repeat that your video doesn't need re-encoding.
    You haven't provided any info regarding audio.
    Use mkvinfo for info.

    1000 bitrate is not going to make a huge file, no.
    It's probably not at that bitrate though. Open your avi in gspot and check.
    Source probably has a bitrate lower than that.
    You could set it up to 2000 and it would make little difference.
    14 mins I'd say is normal for what you're doing if you're working with a 20-25min clip.

    Using vpass=1 is useless if you're only going to do a single pass.
    Using -vf scale is useless if you're not going to change the resolution.

    I'll make the assumption that audio needs transcoding.
    note: kiss multichannel audio goodbye when using mencoder to encode
    You should be doing something like
    Code:
    mencoder input.mkv -o output.avi -mc 0 -ovc copy -oac mp3lame -lameopts cbr:br=128:mode=0
    for re-encoding you could try
    Code:
    mencoder input.mkv -o output.avi -aid 1-mc 0 -ovc xvid -xvidencopts fixed_quant=4:vhq=4:cartoon -ffourcc XVID -oac mp3lame -lameopts cbr:br=128:mode=0
    I've assumed animation and added cartoon switch.
    Remove vhq for speed, or try 3.
    Use lower value for fixed quant for better, or higher if filesize comes out too big.

    gl
    Quote Quote  
  6. Member
    Join Date
    Apr 2006
    Location
    United States
    Search Comp PM
    45Tripp, thanks for responding. Unfortunately, right now the computer that the video I was testing is on a computer that is being reformatted for reasons unrelated to the subject at hand. I will open it up in GSpot once it becomes available. I some files on another computer, so I will use those as a basis for my questions for you.

    Alot of the things you speak of are a little over my head at this point, so I have a couple of questions for you.

    1. You said that I didn't need to encode, how did you know that, is it because the file has "divx5.2" in it?

    2. I openend up an MKV file in GSpot, which is software I just downloaded when reading your post, so I dont know much about it. When I opened it up, the only info on the screen is the path, size and just below that File Type and Mime Type, things I already know. I don't see anything to the right under video or Audio, at the bottom. It may be something with Remote Desktop, I am not sure.

    3. Using vpass=1 is useless if you're only going to do a single pass.
    , I was a little confused on this comment. I thougth vpass=1 was the way to say only do a single pass?

    4. I am not too strong on the subject of bitrate. I thought 1000 bitrate was a DVD quality type file? What is the highest bitrate a file can have?

    5. I will do more research on my own, but some of the parameters you listed I am not too familiar with. Such as vhq, mc, and fixed_quant.

    6. Finally, I am confused about alltoavi and mencoder. I downloaded AllToAvi and it has mencoder in it's directory. I also downloaded mencoder separately. I looked at the sizes of the mencoder.exe in both folder and they were different. What is the difference between them?
    Quote Quote  
  7. Member
    Join Date
    Dec 2004
    Location
    Triptonia
    Search Comp PM
    1. You said that I didn't need to encode, how did you know that, is it because the file has "divx5.2" in it?
    yes

    2. I openend up an MKV file in GSpot,

    gspot doesn't support the matroska container
    open it with the latest mediainfo or with mkvinfo.

    3.[/b], I was a little confused on this comment. I thougth vpass=1 was the way to say only do a single pass?
    vpass=1 tells it to log info gathered the first pass to be used with the second pass

    4. I thought 1000 bitrate was a DVD quality type file? What is the highest bitrate a file can have?
    DVD compliant has a max total bitrate of 9800, audio+visual.
    Check links at top left, what is, vcd, svcd, BD, etc for info.
    Most people rip their dvds and back up to xvid/divx compressing to around the 1000 mark. 800-1300 is pretty typical, or used to be. There's HD stuff about and people are starting to use the h.264 codec, and there's new stuff starting to be used more and more.

    5. I will do more research on my own, but some of the parameters you listed I am not too familiar with. Such as vhq, mc, and fixed_quant.
    Fixed quantization for a set constant quality.
    vhq to set wide motion search.
    mc 0 so it doesn't try and correct audio/visual sync. sometimes it skips frames.

    6. Finally, I am confused about alltoavi and mencoder. I downloaded AllToAvi and it has mencoder in it's directory. I also downloaded mencoder separately. I looked at the sizes of the mencoder.exe in both folder and they were different. What is the difference between them?
    Yes alltoavi uses mencoder.
    You can find the command in the log, after conversion.
    The difference is the build. Mencoder is constantly being developed.
    Get precomplided binaries here http://oss.netfarm.it/mplayer-win32.php
    You can substitute the alltoavi one with one that works better for you.

    gl
    Quote Quote  
  8. Member
    Join Date
    Apr 2006
    Location
    United States
    Search Comp PM
    One last question

    mc 0 so it doesn't try and correct audio/visual sync. sometimes it skips frames.

    Wouldn't I want it to correct audio/visual sync? Or does it mean, correct a/v sync when it is a known issue in the file from the onset, as opposed to correcting it during encoding.

    Also, when I was doing a straight copy, the video was jerky and really bad, it was not until I re-encoded, that it had good quality.

    - Mike G.
    Quote Quote  
  9. Member
    Join Date
    Dec 2004
    Location
    Triptonia
    Search Comp PM
    Wouldn't I want it to correct audio/visual sync?
    No.
    Not as a default. And if you do run into a/v sync problems you'll probably fix it other ways.
    If you don't prevent mencoder from trying you'll more likely than not get skipped and duplicate frames, and audio sync problems that you wouldn't otherwise have.
    I think problems always arise with vorbis audio.

    Also, when I was doing a straight copy, the video was jerky and really bad, it was not until I re-encoded, that it had good quality.
    Don't know. Try it with mc 0. In all likelihood you do have vorbis audio, and it could be the above problem.
    If you like you can upload a source sample somewhere and I'll look at it.
    use cutfile to cut http://jsoto.posunplugged.com/others.htm
    or mkvmerge to split, to get samples.

    gl
    Quote Quote  



Similar Threads

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