Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Ok, it's my first day here and my second thread, but this just occured to me.
I've been using mplayer and mencoder for less than a week and really like it on the whole. I'm using them on SuSE 8.2 on a really nice Compaq nx9005 with a whizzing 1.8GB processor and 256MB of RAM, so no really performance issues.
The question I have is this: I've tried using both 2 and 3 pass encoding of a couple of DVD's I borrowed from a friend, but find that the quality really isn't very good unless I crank up the bitrate to silly proportions (1800 plus) which then makes a 1.6GB file. Whew! Man, that's just too big!
I know nothing about video technology, so small steps (and small words) would be appreciated. The only thing that occurs to me is this: I have a couple of DivX's (avi's) from a friend and they are both in a much smaller, "letterbox" format and the clarity and resolution are perfect!
If I rescale the DVD's at rip time, will this go a long way toward improving quality and making the file sizes smaller? I'd like to keep the films to 2 CD's max.
The quality until now (and I've only done two versions of one DVD - Buena Vista Social Club (100 minutes long) has been grainy and what I can only describe as "mosaic" - that is, blocky segments instead of clean, crisp resolution.
A colleague here at work reckons it's due to the file sizing itself just like it does when I play the DVD - a large square in the center of the screen rather than a nice, smaller "letterbox" shape.
The MEncoder docks say that resizing (rescaling) is a bad thing. Don't know what to try first, to be honest.
saliong isn't a problem really... in theory it's not as good, but hey... that's life. works fine for me.
add some extra options to lavcopts, e.g "vhq:vqmin=2". if you're going to encode manually, i'd suggest doing a -vop cropdetect before hand and whopping off any widescreen bands for extra quality.
i also habbitually resize to about 480 to 560 by whatever.... you really need to work out the average bits per pixel value, and aim to hit around 0.20 for a good divx quality. less and it's ugly, more and you're throwing away file space that could be used to actually encode at a larger dimension etc....
personally i noramlly only encode 1pass, and it's fine for me.
I don't really follow what you mean about the pixel values(honestly, I know nothing about this technology). Can you give me a bigger hint plus a site where I might can learn more? Do I need an extra bit of software to figure out these pixel values?
Or could you give me an example based on one of the lines of script I'm running currently (that is, does it matter where in the string of commands I place any of your suggested options?).
I apologize if it sounds like I'm lazy. I'd just like to rule out any user errors due to me being new at this (and copy the two disks before my friend starts to miss them too much).
Would this be right for a possible cleaner option?
===================================
this is a little script one of the mencoder guys wrote.... there is an indepth discussion of bpp in the mplayer mailing list if you search for "calcbpp.pl" in google....
Code:
#!/usr/bin/perl -w
use POSIX;
sub round {
my $v = shift;
return floor($v + 0.5) != floor($v) ?
floor($v + 0.5) :
floor($v);
}
if (scalar(@ARGV) < 4) {
print("Please provide a) the cropped but unscaled resolution (e.g. " .
"716x524), b) the aspect ratio (either 4/3 or 16/9 for most DVDs), " .
"c) the video bitrate in kbps (e.g. 800) and d) the movie's fps.\n");
exit(1);
}
($unscaled_width, $unscaled_height) = split('x', $ARGV[0]);.$encoded_at = $ARGV[1];.if ($encoded_at =~ /\//) {. my @a = split(/\//, $encoded_at);. $encoded_at = $a[0] / $a[1];.}.$scaled_width = $unscaled_width * ($encoded_at / (5/4));.$scaled_height = $unscaled_height;.$picture_ar = $scaled_width / $scaled_height;.($bps, $fps) = @ARGV[2, 3];..printf("Prescaled picture: %dx%d, AR %.2f\n", $scaled_width, $scaled_height,. $picture_ar);.for ($width = 720; $width >= 320; $width -= 16) {. $height = 16 * round($width / $picture_ar / 16);. $diff = round($width / $picture_ar - $height);. $new_ar = $width / $height;. $picture_ar_error = abs(100 - $picture_ar / $new_ar * 100);. printf("${width}x${height}, diff % 3d, new AR %.2f, AR error %.2f%% " .. "scale=%d:%d bpp: %.3f\n", $diff, $new_ar, $picture_ar_error, $width,. $height, ($bps * 1000) / ($width * $height * $fps));.}.
basically though it's the bitrate divided by the total area times the number of frames per second. i.e. the number of bits that each single pixel is given to store the data.
Thanks for all that. The Perl stuff goes a bit over my head, but I'll find that google posting you mentioned and read up on it.
Thanks, too, for the script. I'll take that home now (just going home) and run it on that DVD.
I'd really like to learn more about this. Had no idea that the copy option for the sound was the problem - just followed the guidelines in the docs. Should have guessed, though. Makes sense on reflection (but then, most things do, I suppose).
I'll let you know how the general quality pans out.
The first run failed (seems my mencoder doesn't like the "://" redering. I also found I had to put the values in a different order to get it to accept them (said I hadn't selected any -oac values when I first tried the given format).
Anyway, it ran and the quality was pretty good, but it still has some blocky output. I'll try a second pass rendering tonight.
I also just printed out an article I found when searching for the perl script you printed above:
To me, not surprising as it was directed to /dev/null to start with. Hmmm.....
I removed this and moved the -oac settings around and it ran, but still produces one big block in the center of the screen rather than the nice "letterbox" format. I'll keep reading and keep experimenting.
And I haven't forgotten about your acidrip! I need to install the other components first and then I'll give it a go.
Are there any pointers or things I should be mindful of since you first put this out that might make using it more successful?
well the biggest thing there is still that you are straight copying the audio, so are including a 400kbps stream rather than a more suitable 128kbps in mp3 format.
/dev/null is being used as that is the first pass, and so you only really want the divx2pass.log file, not the actual video.
Thanks. Any ideas why the script failed with /dev/null included? Only ran once I took that out.
Also, I just used it as is the first time, but put in your suggested mp3lame settings on the second go. Output wasn't that bad.
You mentioned that this would produce a log file (I'm assuming like with the 2 pass method I've used up to now). Will this de facto increase the quality or have I misunderstood? You mentioned you use single pass encoding with good results.
One last point that struck me when trying to encode "Crouching Tiger" last night: I did a test run of about 45 seconds and found when I played it back it had the commentary as default and not the Mandarin or English soundtrack. How weird is that?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.