LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General > LinuxAnswers Discussion
User Name
Password
LinuxAnswers Discussion This forum is to discuss articles posted to LinuxAnswers.

Notices


Reply
  Search this Thread
Old 05-04-2006, 12:52 PM   #1
Steel_J
Member
 
Registered: Oct 2004
Location: Montreal, Canada
Distribution: Ubuntu 16.04 LTS
Posts: 359
Blog Entries: 1

Rep: Reputation: 31
DISCUSSION: Batch convert MPEG files to AVI


This thread is to discuss the article titled:
Batch convert MPEG files to AVI

Quote:
A lot of users have TV shows captured as MPEG files on their systems or personal video recorder. I built a PVR that record's the satellite with an hardware MPEG2 encoder PCI card. It's all fine when I want to watch the shows within the week but for those shows I want to keep for later I convert them to high quality AVI files and transfer them elsewhere. Otherwise MPEG files take a lot of disk space. Here is a little script I wrote to batch convert all MPEG files within a folder to quality AVI videos. The only requirement for the script is mplayer. You can modify the "vbitrate" variable yourselves. I set it to 1100 because it produces a 500-550MB files from a one hour tv show. I find this to be a reasonable ratio between size and quality.

Last edited by XavierP; 05-04-2006 at 12:59 PM.
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 03-31-2013, 05:45 PM   #2
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
Smile Lossy Compression

MPEG is more lossy than AVI. Converting is like coverting MP3 to WAV. The video might appear different, but once it's MPEG, it can't regain losses in quality that have been sacrificed as a function of the greater good that makes MPEG desirable for its intended purpose.

It's like taking a photograph that is underexposed and out of focus and trying to draw out of it a good picture: what isn't there in the first place.

One more time, it's like converting lossy JPEG image compression to lossless TIFF format. Once the compression to JPEG is performed, the losses are not recoverable, because the information is gone.

And, digital TV is transmitted over satellite and cable systems in slightly modified MPEG-2 format. PVRs can record that directly to a hard drive, with few translations.

Analog TV requires full MPEG encoding before it can be written to disk file. But analog TV is like 150 lines; not even close to the native resolution MPEG is designed to adequately preserve. So, converting to AVI is superflous.

You can digitize an analog signal into an HD format, but it doesn't then become HD quality. The quality remains the same or worse.
 
1 members found this post helpful.
Old 03-31-2013, 09:08 PM   #3
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Any reason why you necropost to different threads, in this case even with wrong information?
 
Old 04-02-2013, 08:03 AM   #4
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
.avi is not a codec, it's a container format. You can put mpeg video inside an avi file, among many others. The quality of the video and audio you get depends entirely on the actual codecs you use and the parameters you apply to them. AFAIK, there is no default video codec associated with .avi, at least not any more, although the most common are probably divx/xvid (see below) and wmv.

.mpg is not exactly a codec either for that matter. It generally refers to the mpeg-1 or mpeg-2 video codecs in one of several containers, usually either an mpeg-ts or mpeg-ps (the latter being a more restricted version for use with dvd video). Audio codecs include of course mp2 and mp3, although ac3 and raw pcm audio are also supported.

mp4 is a continuation of the mpeg standard, but AFAICT spins it off in a different direction from the older versions, with new codecs and new containers. divx/xvid and H.264 are different levels of mp4 codecs.

I suggest Wikipedia-ing for more details

In any case, AwesomeMachine is right about one thing. There's no way to get better video quality when converting from one lossy video codec to another. Like photocopies of photocopies, you'll only end up degrading the quality each time you re-encode. The best you can do is keep the loss to a minimum.

But then again, the OP didn't say anything about keeping the same quality, only that the intention was to convert them to another "high quality" format that has a smaller file size.

Last edited by David the H.; 04-02-2013 at 08:07 AM. Reason: small addition
 
2 members found this post helpful.
Old 08-14-2013, 03:52 AM   #5
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
Smile Actually, copying to a larger size

Quote:
Originally Posted by David the H. View Post
.avi is not a codec, it's a container format. You can put mpeg video inside an avi file, among many others. The quality of the video and audio you get depends entirely on the actual codecs you use and the parameters you apply to them. AFAIK, there is no default video codec associated with .avi, at least not any more, although the most common are probably divx/xvid (see below) and wmv.

.mpg is not exactly a codec either for that matter. It generally refers to the mpeg-1 or mpeg-2 video codecs in one of several containers, usually either an mpeg-ts or mpeg-ps (the latter being a more restricted version for use with dvd video). Audio codecs include of course mp2 and mp3, although ac3 and raw pcm audio are also supported.

mp4 is a continuation of the mpeg standard, but AFAICT spins it off in a different direction from the older versions, with new codecs and new containers. divx/xvid and H.264 are different levels of mp4 codecs.

I suggest Wikipedia-ing for more details

In any case, AwesomeMachine is right about one thing. There's no way to get better video quality when converting from one lossy video codec to another. Like photocopies of photocopies, you'll only end up degrading the quality each time you re-encode. The best you can do is keep the loss to a minimum.

But then again, the OP didn't say anything about keeping the same quality, only that the intention was to convert them to another "high quality" format that has a smaller file size.
The avi is a container intended for raw video. If you're going to use a shovel as a screwdriver, technically I'm wrong. Normally avi contains more information than any-version mpg.

And, the quality of mpg will not improve, even if avi is used. The point is not whether or not mpg can exist within avi, but whether or not that would improve video quality.

As far as necroposting, from a different reply, there are discussion threads spanning at least 8 years on this board. One thing that is very frustrating is when you hot-link off google to a discussion thread that is not useful.

If more people were like me, willing to complete a post, while not asking for anything in return but maybe that someone might benefit in the future; the world would be a better place.

I mean everything I wrote in the nicest possible way.
 
Old 08-14-2013, 04:40 AM   #6
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Writing things nice does not make them technically correct. There is no problem with necroposting if you correct factual errors or extend the information in a thread in a meaningful way, but in this case a large part of the information you posted is simply wrong.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Program which can convert RMVB to MPEG or AVI AoiSora Linux - Software 1 08-29-2005 09:59 PM
Batch convert video files KimVette Linux - General 1 08-02-2005 09:13 PM
Convert AVI to MPEG? mrgrieves Linux - Software 1 07-10-2004 03:04 PM
Mplayer issues. Trying to convert WMV to AVI or MPEG mandika Linux - Software 3 06-20-2004 05:12 PM
convert avi to mpeg xgreen Linux - Software 7 11-30-2003 09:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General > LinuxAnswers Discussion

All times are GMT -5. The time now is 05:29 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