Hi.
Is it possible to resize a video of e.g. 1.3GB to about 900MB via a terminal command or GUI way?
For example, I'd like the command to figure out the proper aspect ration and bit quality in order to reduce the video size down to 900MB.
Thanks.
Hi.
Is it possible to resize a video of e.g. 1.3GB to about 900MB via a terminal command or GUI way?
For example, I'd like the command to figure out the proper aspect ration and bit quality in order to reduce the video size down to 900MB.
Thanks.
Last edited by Rytron; June 20th, 2015 at 08:16 PM.
1st Distro used (live CD): Knoppix in early 2007 ¦ 1st Distro Installed: Ubuntu 7.10 in Feb 2008
GNU/Linux User #470660 – Ubuntu User #28226
Isaac Asimov: "I do not fear computers. I fear the lack of them."
You can do it with ffmpeg, but it takes some work: https://trac.ffmpeg.org/wiki/Encode/H.264
If you ask for help, do not abandon your request. Please have the courtesy to check for responses and thank the people who helped you.
Blog · Linode System Administration Guides · Android Apps for Ubuntu Users
Hi SeijiSensei.
Those command in your link look very tricky.
I may just stick with commands such as these:
- ffmpeg -i input.mp4 -vf scale=720:576 output.mp4
- ffmpeg -i input.mkv -vf scale=576:-1 output_576.mkv
- ffmpeg -i input.mkv -vf scale=-1:720 output_720.mkv
- ffmpeg -i input.mp4 -vf scale=iw/2:-1 output.mp4
1st Distro used (live CD): Knoppix in early 2007 ¦ 1st Distro Installed: Ubuntu 7.10 in Feb 2008
GNU/Linux User #470660 – Ubuntu User #28226
Isaac Asimov: "I do not fear computers. I fear the lack of them."
See the Two-pass example in the link provided by SeijiSensei:
https://trac.ffmpeg.org/wiki/Encode/H.264#twopass
Using two-pass method can allow you to achieve a desired output file size. (In the vast majority of all other cases, and if file size is not a priority, I recommend just using single pass with -crf).
If you don't feel like doing the math you can use a simple bitrate calculator. You just need to tell it the duration and the desired output file size.
Example if your input is 1 hour long and you want an output of approximately 900 megabytes:
I'm not sure why someone added audio encoding to the first pass example in the wiki, but I've never needed to do that, so I omitted it.Code:ffmpeg -y -i input -c:v libx264 -preset slow -b:v 1918k -pass 1 -an -f mp4 /dev/null && \ ffmpeg -y -i input -c:v libx264 -preset slow -b:v 1918k -pass 2 -c:a libfdk_aac -b:a 128k -movflags +faststart output.mp4
1st Distro used (live CD): Knoppix in early 2007 ¦ 1st Distro Installed: Ubuntu 7.10 in Feb 2008
GNU/Linux User #470660 – Ubuntu User #28226
Isaac Asimov: "I do not fear computers. I fear the lack of them."
Are the values in my commands for kiloBytes or kiloBits?
1st Distro used (live CD): Knoppix in early 2007 ¦ 1st Distro Installed: Ubuntu 7.10 in Feb 2008
GNU/Linux User #470660 – Ubuntu User #28226
Isaac Asimov: "I do not fear computers. I fear the lack of them."
You run two commands with two-pass encoding. Your commands may look something like this:
The -b option takes a value in bits, so you have to add a "k" to make it kilobits (as shown in the example above).Code:ffmpeg -y -i input -c:v libx264 -preset slow -b:v 592k -pass 1 -an -f mp4 /dev/null ffmpeg -i input -c:v libx264 -preset slow -b:v 592k -pass 2 -c:a libfdk_aac -b:a 128k -movflags +faststart output.mp4
@FakeOutdoorsman I went with Handbrake in the end. But I will keep your info for future reference. Cheers.
1st Distro used (live CD): Knoppix in early 2007 ¦ 1st Distro Installed: Ubuntu 7.10 in Feb 2008
GNU/Linux User #470660 – Ubuntu User #28226
Isaac Asimov: "I do not fear computers. I fear the lack of them."
Bookmarks