Results 1 to 3 of 3

Thread: new mencoder command

  1. #1

    Smile new mencoder command

    Well after lots of reading and trial and lots of error I came up with this for my mencoder it resamples to 44100 and gives a clean HQ audio out and resizes the video for widescreen videos to fit in vshare player I have only tried it with avi files but big difference in quality make sure you are using the latest mplayer download

    just comment out the original with a #

    and add this below in the video_conversion.php
    this is locates in includes/settings folder


    Code:
    $cmd_mencoder = "$config[mencoder] '$video_src' -o $video_flv -af resample=44100:0:0 -sws 9 -vf scale=448:-3,expand=448:336 -of lavf -ovc lavc -lavcopts vcodec=flv:vbitrate=800:vhq:trell:v4mv:mv0:mbd=2:cbp:aic:cmp=3:subcmp=3 -oac mp3lame -lameopts abr:br=56:mode=3 harddup ";
    Last edited by MauiRedMan; 06-20-2009 at 05:32 PM. Reason: Improved code

  2. #2
    Join Date
    Sep 2008
    Posts
    1,019

    Default

    Uh... thanks... but:

    The resample command that you are using has nothing to do with video. The "-af resample=22050:0:0" is an audio command. This tells mencoder to resample the audio frequency (which is what the af stands for) to 22.050 Khz. This is pretty much half of the audio frequency that a standard MP3 track has, which is actually a poorer sound. In other words, all this command did was replace the srate (which is the sample rate command) with a resample command, forcing mencoder to resample the audio versus adjusting it as is.

    The "real" reason why your command generates improved video is because of the following:

    Code:
    -sws 9 -vf scale=448:-3,expand=448:336
    and

    Code:
    vcodec=flv:vbitrate=500:trell:v4mv:mv0:mbd=2:cbp:aic:cmp=3:subcmp=3
    The first code tells mencoder to scale the video (using the software scaler) and forces it to a certain size (448x336). Because you are scaling the video, processing that would otherwise be wasted on keeping the video's resolution is redirected to other portions of the conversion process. Also, since you are scaling the video to a certain size (versus resizing the video, which is what vShare does natively), you get a cleaner video after conversion.

    The second code ups the conversions a bit by using some of mencoder's newer ffmpeg processing commands, which aid in better processing of the video signal.

    Where your code breaks down, however, is in two places. One, the resample rate is terrible. You should resample your audio to a standard 44100. The second is in the vbitrate. At only 500Kbps, higher quality videos are going to be choked off tremendously. You will want to increase that based upon the types of videos that you are expecting to upload. For the average user, I would make it 800. This is high enough such that your videos are not choked off, but is low enough so that if you are getting low quality uploads that it doesn't waste disk space by creating overly large files.

    Finally, as a side note, in order to use this, you will need later versions of both mencoder and ffmpeg (if an older version of ffmpeg, you will need it to be compiled with the swscale command).
    vShare Solutions
    Custom vShare Modules and Services

    Now, your visitors can watch videos on your site using their mobile or tablet device with the Mobility Mod for vShare 2.8!

  3. #3

    Default

    I see thank you my original problem was if I had widescreen videos they would get cut off and I could not see the whole thing so I wanted to scale them down I also found that the resample gave me a better sound quality than just the sample command in vshare I made the changes you suggested and going to try them out right now I corrected the code

    Thanx again bplex
    Last edited by MauiRedMan; 06-15-2009 at 07:21 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •