Pages

Monday, November 21, 2011

[SOLVED] How to reduce video size in Ubuntu to post in YouTube?


I faced this particular problem yesterday. We had the Annual fest of HSBC Analytics @ Bangalore, where our friends and colleagues gave some enthralling performances. I captured dozens of videos in my 14 megapixel Nikon D-90 with the hope that I'll upload them to YouTube for others too see. But, to my horror I discovered that each video is over 300 mb (4-5 min. of run time each). A particular video was 700 mb and it ran for 10 min.! How do I ever upload them to YouTube because it only allows 100 mb of upload per attempt? Splitting is not an option as it will ruin the fun.

So, a bit of research took me to ffmpeg - to install ffmpeg, if it is already not there in your system, you need to hit the terminal and type

sudo apt-get install ffmpeg

It was already installed in my system (Ubuntu 11.04) and hence, I did not run this command.

Once installed, on the terminal change directory (using cd) to the location where the video files are dumped. Next step is very simple - just type in the following command:


ffmpeg -i DSCN3085.AVI -ab 56k -ar 22050 -b 300k -r 15 -s 480x360 DSCN3085.flv


Replace DSCN3085.AVI with the file name and the format it is in and replace the output file name DSCN3085.flv with the desired output file name and the format. I want to upload these videos to YouTube and hence, flv format suits me perfect. The transformation was amazing - watching the videos it was difficult to distinguish between the original and the copy. Apart from intact picture quality and sound clarity, my 700 mb file got reduced to only 29 mb!

P.N.: You can replace 480x360 in the code with 320x240 as well if you want to reduce it further. Also, you can transform to and fro in the following formats: VOB, AVI, MPEG, FLV, DIVD-X, mp4, etc. Give it a try!

9 comments:

  1. Thanks for this, short and to the point!

    ReplyDelete
  2. That was very helpful, thanks!

    ReplyDelete
  3. iused WinFF tool it work great

    ReplyDelete
  4. Thanks for that post. Is there a way to batch process? I got 24 videos and want to format them all in a single command.

    ReplyDelete
  5. Thank you very much, you saved my life. It works very well.

    ReplyDelete
  6. Thank you very much, you saved my life. It works very well.

    ReplyDelete
  7. Thanks for sharing! This is really useful to me. I found an article offering more solutions to reduce video file size without losing quality. You guys can have a check if this doesn't work. Hope it helps.

    ReplyDelete