LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 08-28-2007, 08:42 PM   #1
randell6564
Member
 
Registered: Nov 2005
Location: California USA
Distribution: Ubuntu,(Feisty Fawn) Windows XP(Home Edition)
Posts: 634

Rep: Reputation: 31
Need help compressing video file for uploading


Hey folks!
I have some music videos that I want to upload to my online storage, but they are all 25 to 45MB in size and that would take much too long with my connection speed!

Can someone please tell me how and what to use to make these files smaller?

I am dual-booting Ubuntu 7.04 and Windows XP, so anything that would work on either will be appreciated!

Thanks!
 
Old 08-28-2007, 11:29 PM   #2
binary_y2k2
Member
 
Registered: Jul 2005
Location: England, UK
Distribution: Ubuntu 8.04 Server, Kubuntu 12.04
Posts: 698
Blog Entries: 1

Rep: Reputation: 31
Gzip or Bzip2 are probably the best compression formats.
You can use a GUI like File Roller or Ark...
Gzip has less compression but it's quicker and less memory intensive, Bzip2 has higher compression but more memory usage..
Code:
gzip --best filename.video
then that will compress as "filename.video.gz"
Code:
bzip2 --best filename.video
then that will compress as "filename.video.bz2"
 
Old 08-29-2007, 02:51 PM   #3
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
You can not really compress videos as they are usually already compressed using a lossy compression. What is the current format (mpeg2)? I can't advise but maybe someone can advise based on the answer.
 
Old 08-29-2007, 08:52 PM   #4
randell6564
Member
 
Registered: Nov 2005
Location: California USA
Distribution: Ubuntu,(Feisty Fawn) Windows XP(Home Edition)
Posts: 634

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by Wim Sturkenboom View Post
You can not really compress videos as they are usually already compressed using a lossy compression. What is the current format (mpeg2)? I can't advise but maybe someone can advise based on the answer.
Thanks Guy's!
In answer to your question, Wim Sturkenboom, 'MPEG 1' is what the properties of these video's are telling me. Don't know if that helps. I'm not a video person.

I tried right clicking on the files and selecting "Create Archive". You get the choice of creating a tar.gz, tar.bz2, .tar, .zip, .gz, .bz2, .ar, .ear, .jar, or .war. None of these choices get me even CLOSE! (only reduces the file by a couple MB's)

I just want to upload them to my online file storage for safe keeping. 40MB takes much too long to upload when I'm trying to get about 15 files uploaded.

Thanks!
 
Old 08-29-2007, 09:03 PM   #5
randell6564
Member
 
Registered: Nov 2005
Location: California USA
Distribution: Ubuntu,(Feisty Fawn) Windows XP(Home Edition)
Posts: 634

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by binary_y2k2 View Post
Gzip or Bzip2 are probably the best compression formats.
You can use a GUI like File Roller or Ark...
Gzip has less compression but it's quicker and less memory intensive, Bzip2 has higher compression but more memory usage..
Code:
gzip --best filename.video
then that will compress as "filename.video.gz"
Code:
bzip2 --best filename.video
then that will compress as "filename.video.bz2"
Hi binary_y2k2!
I did a
Code:
gzip --best videoname.mpg
and that only reduced the size by 2MB.
Isn't there software out there that can do some serious compression?
 
Old 08-30-2007, 02:04 AM   #6
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
As I said, video compresses badly as it's already compressed. I'm not a video person either, but I know that the latest mpeg compression is mpeg-4 which compresses far better; I however don't know how wide-spread it currently is and if software tools are available for it (encoding as well as decoding).

As I see it, either encoding using a better compression (preferred; e.g. mpeg-4) or re-encoding to a better compression is the only solution for you.
 
Old 08-30-2007, 02:39 AM   #7
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 66
You could try something like this.

Suppose the average length of your videos is 5 minutes (it is a rough guess based on the info you gave), that is 300 seconds. Let's say you want each video to be about 10MiB in size (change according to your needs), that is 10000KiB. That would give you a need for (10000/300)*8 kb/s, hence 266kb/s.
For the sound, we'll suppose 64kb/s (we won't actually process it, as it would lead to useless quality loss), which leaves 202kb/s for the video.
That's very approximative calculation, but you get the idea.

So you'd run the following command:
Code:
mencoder -mc 0 yourfile.mpeg1 -vf pp=ha/va/dr,hqdn3d,harddup
 -ovc lavc -lavcopts vcodec=mpeg4:autoaspect:vbitrate=202:dia=3:cmp=3:subcmp=3:last_pred=2:trell:mbd=2:v4mv
 -oac copy
 -ofps 25 -o newfile.avi
That's a single line, split here for better readability. On the "last line", change 25 with the actual frames per seconds you have (25 is for PAL or SECAM, I don't know if it is 30 or 29.xxx with NTSC); if you have a doubt, just remove the "-ofps 25" entirely.

Yves.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
tar is not compressing archive file BajaNick Linux - Software 5 06-16-2007 11:21 PM
compressing a file micro_xii Linux - Newbie 2 12-23-2006 03:20 AM
Compressing file using a binary file bernie82 Programming 3 06-01-2005 02:11 AM
compressing a file sanjith11 Linux - General 2 07-08-2004 03:42 AM
Compressing a file dynamically xanthium Programming 5 03-22-2002 05:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 02:04 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration