Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I would like to convert a Mp4 file in HD into a Mp4 file of lower resolution. Is there any software that can be used for this?

share|improve this question

3 Answers 3

Terminal commands (Which by default are not installed) are:

MENCODER

Install it by sudo apt-get install mencoder

mencoderInstall mencoder

The part about mencoder that you want is the parameter -vop scale which tells mencoder to what scale you want the video to go to. This is normal if you want to reduce bandwidth use, lower video size, etc..

mencoder input.mp4 -ovc lavc -lavcopts vcodec=mp4 -vop scale=640:480 -oac copy -o output.mp4

or

mencoder input.mp4 -ovc lavc -lavcopts vcodec=mp4 -vf scale=640:480 -oac copy -o output.mp4

or a simple

mencoder input.mp4 -vop scale=640:480 -o output.mp4

Although from my experience is better to include additional information for video and audio like the one above.

FFMPEG (Deprecated)

Install it by sudo apt-get install ffmpeg

ffmpegInstall ffmpeg

Here is an example of ffmpeg:

ffmpeg -i input -vf scale=iw/2:-1 output

Where IW = Video Input Width.

Scale = Parameter to scale to. In this case you are dividing the original size by 2 (iw/2)

both of which can provide more information if you either execute them without parameters or variables like just mencoder or ffmpeg or type for example man mencoder or man ffmpeg which will give you a VERY extensive little manual on how to work with them.

AVCONV <-- I love this guy!

avconvInstall Avconv

To Install - sudo apt-get install libav-tools

To Run - avconv -i input.mp4 -s 640x480 output.mp4

Where -i is for the original input file, -s is for the size for each frame and the name of the output final goes in the end.

GUI tools which I love are:

enter image description here

AVIDEMUX - It can resize and lower the size which helps in cases where the objective is to lower size. avidemuxInstall avidemux

enter image description here

HANDBREAK - Excellent tool for converting videos and optimizing size. I use it a lot when going from ogg to mp4 with h.264. Lowers A LOT the size. handbreakInstall handbreak

enter image description here

OPENSHOT & PITIVI - Both are good video editors tha can help lower size when rendering the video. openshotInstall openshot and pitiviInstall pitivi

So in conclusion, for direct resizing/scaling you can use the terminal ones. For size you can use all.

share|improve this answer
2  
Avidemux can resize. and more - checkout the video filters menu –  artfulrobot Dec 11 '12 at 11:59
    
@artfulrobot Correct. Had to set it to transcode first. +1 –  Luis Alvarado Dec 11 '12 at 12:26
    
On Ubuntu Precise: avidemux gives warnings about h264 saying that you'll either lose frame accuracy, or get stuttering/crashes. avconv took over an hour on my Intel i5 to process a 13 minute file and generated a much bigger file than the original. I can't get mencoder to work Cannot find codec 'mp4' in libavcodec Couldn't open video filter 'lavc'. Openshot doesn't give much control (bunch of presets, none are what I needed) over output and created files that played at the wrong speed or had choppy audio. :-( –  artfulrobot Dec 11 '12 at 13:17
    
@artfulrobot - Wow you got problems ^^. Avidemux does say the warnings over h264 because you WILL loose frame accuracy (Not much crash)when transcoding, the only way would be to actually put the same compression/rate/bits/etc.. For the avconv time there has to be a problem. I did a 1 hour 23 minute movie in mp4 format with h264 in about 25 minutes with an i3. With an i7 2600 it went down to 11 minutes. Did you happen to install the restricted extra package –  Luis Alvarado Dec 11 '12 at 13:40

Use avconv. Type in terminal

avconv -i input.mp4 -s 320x240 output.mp4

Replace 320x240 with whatever resolution you want.

There a lot of additional options that you can play with. Do man avconv to know more.

Instead, if you don't have avconv, you could use ffmpeg.

Install:

sudo apt-get install ffmpeg

ffmpegInstall ffmpeg

Convert:

ffmpeg -i input.mp4 -s 320x240 output.mp4
share|improve this answer
    
I tried avconv. It is giving me command not found. I tried everything mentioned above. It is giving me the same answer. It would be really useful if you could suggest an alternate solution. –  theja Jul 10 '12 at 12:04
    
See if the edit works. –  abhshkdz Jul 10 '12 at 13:12
    
Added -c:a copy to avconv to copy audio stream without reencoding –  warvariuc Oct 14 at 15:54

Use VLC.

From the Media menu choose "Convert/Save". Add your file(s) to the input and click Convert/Save button.

You'll then be asked to specify an output file, and you can choose a profile and tinker with it, e.g. here I scale the video by 50%:

screenshot

Click Save.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.