Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
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.
I am trying to reduce some video files I have so that I can transfer then to my pda. These files are "small" in a desktop sense but copying many 300MB files to my pda takes a long time and besides the screen is tiny anyway so I am keeping info that I dont need and wasting precious disk space.
Does anyone have a recipe to use mplayer or anything like it to do this? I would like to keep the same video quality, just reduce the video size to loose some of the fat to produce the bigger image in my desktop. I dont want to drop frames and I dont need to change encoding formats.
Mplayer also comes with "mencoder", which will allow you to re-encode video files. And yes, you do need to re-encode because what you want requires altering the existing video information from within its current codec, this can only be done by re-encoding things.
Using mencoder is a pain tho. First, what codec is the current video in? Using "copy" for the audio should be fine, and "lavc" for the video codec. Use the "scale" option with the video filter to scale things.
That should work, resizing to 320x200 using the mpeg4 codec. Not sure how good mencoder is at guessing quality, so if your video is already crappy quality, you might want to think about lower the quality settings. Since there is so many options, and i find it all to boring, ill just leave that out, read mencoders man page if you want to learn tho, under "-lavcopts".
Hi SciYro, I tried your suggestion here several times. My movies are 352x238, 640x480, 352x240 and 448x336. My goal is to reduce the file size without loosing quality.
I tried to reduce a 352x238 movie to 300x200 (as in your example) and then to 150x100. But the file changed from: 162.035.712 bytes to: 118.582.492.
This is not what I was expecting. I thought that by reducing the screen size by a factor of 2 I would get a reduction in file size of the same order. Am I wrong? Is there any way to do what I am saying but keeping the quality?
I tried using xvid codec and got: 105.500.906 (with 150x100). So I guess one of the ways is to find the best codec. Is it possible to make it go thru the codec several times to improve the compression?
Finding the best quality vs size is, unfortunately, not an exact science. You'll just need to experiment a little. Be sure to read the mplayer man page carefully, there are LOTS of options to tweak mencoder. You should also read the mencoder documentation (should be at /usr/share/doc/MPlayer-(version)/html/mencoder.html) for encoding tips. By the way, the biggest factor in file size (and quality) is not the resolution, but the video bitrate.
I see, but shouldnt I get a much smaller file if I have much smaller frames? That is assuming I dont touch the bitrate, after all if each frame has a given number of bits and I keep the bitrate but transfer less bits I would expect a smaller file. Feel free to correct me if I am wrong.
I will try it again with xvid codec. And will also play around with the bitrate. Can mencoder be smart and notice that I am reducing the screen resolution but since I dont state anything about bitrate it increases my bitrate "automagically"?
I will post back my results once I get some numbers to compare.
The bitrate is the number of bits (or kilobits) _per second_, not _per frame_, you still have the same number of frames per second. If you have the same bitrate but reduce the resolution, you just increase the number of bits used per frame compared to a higher resolution.
Quote:
Can mencoder be smart and notice that I am reducing the screen resolution but since I dont state anything about bitrate it increases my bitrate "automagically"?
Not that I've noticed. If you don't specify a bitrate it will just use some default value, which seems to be the same regardless of resolution. AFICT anyway.
Also, I forgot to mention /usr/doc/MPlayer-(version)/tech/encoding-tips.txt. There are some good tips in here, I improved the quality of my encodings dramatically by using some of these suggestions. Especially, you should always use vhq or mbd=1 (same thing) or maybe mbd=2. The default is mbd=0, if you use this you probably want to change the mbcmp option to something other than 0 (see mplayer man page for details).
I don't think it will help in this case. Acidrip is for ripping dvds, not sure it can encode from files. It's just a frontend to mplayer/mencoder anyway.
I've used acidrip for converting MPEG files (of programmes I've backed up from my Sky+ box) to AVIs, so it's definitely not just for ripping DVDs. It looks to me like you can choose crop and scale options, so it might be worth playing about with. I appreciate it's just a front end for other command line programs; can memcoder definitely not do what you're after?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.