LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-20-2009, 09:54 AM   #1
sinail
LQ Newbie
 
Registered: Nov 2009
Posts: 4

Rep: Reputation: 0
converting mpeg 2 to avi


hi,
I have been trying for a few days to find a program that compresses mpeg2 to avi. I tried using avidemux but that program wasn't able to properly read my file. then i tried a similar program with the same result.

I also tried installing iriverter but the installation failed (it told me "Package dependencies cannot be resolved - This error could be caused by required additional software packages which are missing or not installable. Futhermore there could be a conflict between software packages which are not allowed to be installed at the same time.")

i also tried searching this forum but found nothing helpful.
any suggestions?
Thanks
 
Old 11-20-2009, 11:00 AM   #2
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
Try http://www.linuxquestions.org/linux/...files_to_AVI_0
and next time, search these forums...
 
Old 11-20-2009, 01:49 PM   #3
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
Does it have to be Xvid compatible ? so it can play on standalone players ?
 
Old 11-20-2009, 02:39 PM   #4
lazlow
Senior Member
 
Registered: Jan 2006
Posts: 4,363

Rep: Reputation: 172Reputation: 172
It sounds like you have a goofy (non standard) mpeg2 file. You can try converting into a "standard" mpeg2 and then use avidemux to convert it to avi.

Quote:
ffmpeg -i input.mpg -sameq output.mpg
 
Old 11-21-2009, 03:08 AM   #5
sinail
LQ Newbie
 
Registered: Nov 2009
Posts: 4

Original Poster
Rep: Reputation: 0
1)I am new to linux so I don't understand where and how I have to write all those commands. I looked at the help files about MEncoder and Mpalayer but I didn't find anything that helped me.

2)I just want to compress a 1.8GB 45 minute clip into a more manageable size, so it doesn't matter if it's Xvid compatible.

3)how do I convert it into standard mpeg2?

thanks
 
Old 11-21-2009, 04:42 AM   #6
Adam.lei
LQ Newbie
 
Registered: Nov 2009
Location: Yantai, China
Distribution: Ubuntu
Posts: 4

Rep: Reputation: 0
Smile Hi, I think mencoder is ok to use

You can install mplayer and it's own tool mencoder. mencoder can easily convert all types you see.
 
Old 11-21-2009, 09:11 AM   #7
lazlow
Senior Member
 
Registered: Jan 2006
Posts: 4,363

Rep: Reputation: 172Reputation: 172
@ post #5:

Just open a terminal, change to the directory where the file you want to convert is, and enter the command I listed(answer to #1). This will create a copy of the file that is in a "standard" format(answer to #3). Then covert/compress this new file with avidemux(answer to #2).
 
Old 11-21-2009, 09:35 AM   #8
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
First, if you have mencoder open a terminal or console and run this:

Code:
mencoder -ovc help -oac help
and post the output here, just so we know what codecs you can use.
 
Old 11-21-2009, 02:21 PM   #9
sinail
LQ Newbie
 
Registered: Nov 2009
Posts: 4

Original Poster
Rep: Reputation: 0
1)I did install mplayer and mencoder. the question is how to convert files

2)I converted the file to a non-goofy mpeg2 using "ffmpeg -i input.mpg -sameq output.mpg" but then when I opened the new file (which was twice as large by the way) with avidemux the result was similar - the video was too slow and without sound. (pre-conversion the video was too fast and without sound)

3)typing "mencoder -ovc help -oac help" on the terminal, it said:

MEncoder SVN-r29237-4.4.1 (C) 2000-2009 MPlayer Team

Available codecs:
copy - frame copy, without re-encoding. Doesn't work with filters.
frameno - special audio-only file for 3-pass encoding, see DOCS.
raw - uncompressed video. Use fourcc option to set format explicitly.
nuv - nuppel video
lavc - libavcodec codecs - best quality!
vfw - VfW DLLs, read DOCS/HTML/en/encoding-guide.html.
qtvideo - QuickTime DLLs, currently only SVQ1/3 are supported.
xvid - XviD encoding
x264 - H.264 encoding


Available codecs:
copy - frame copy, without re-encoding (useful for AC3)
pcm - uncompressed PCM audio
mp3lame - cbr/abr/vbr MP3 using libmp3lame
lavc - FFmpeg audio encoder (MP2, AC3, ...)
faac - FAAC AAC audio encoder

(screen shot attached)

4)thanks
Attached Thumbnails
Click image for larger version

Name:	Screenshot.png
Views:	21
Size:	182.8 KB
ID:	2037  

Last edited by sinail; 11-21-2009 at 02:47 PM.
 
Old 11-21-2009, 03:08 PM   #10
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
Ok, that's good, now try doing this:

1) Open a terminal and navigate to the file you want to convert or just open a terminal in the directory where the file is you want to convert.

2) Run this command:

Code:
mencoder input.mpg -oac mp3lame -lameopts q=2 -ovc x264 -x264encopts qp=25:subq=6:frameref=5:bframes=3:8x8dct:b_pyramid:weight_b:direct_pred=auto:mixed_refs:trellis=1:threads=auto -o output.avi
Replace input.mpg and output.avi accordingly.

If you want higher quality video you should do a 2 pass encoding so something like:

Code:
mencoder input.mpg -oac mp3lame -lameopts q=2 -ovc x264 -x264encopts qp=25:subq=6:frameref=5:bframes=3:8x8dct:b_pyramid:weight_b:direct_pred=auto:mixed_refs:trellis=1:threads=auto:pass=1 -nosound -o /dev/null; mencoder input.mpg -oac mp3lame -lameopts q=2 -ovc x264 -x264encopts qp=25:subq=6:frameref=5:bframes=3:8x8dct:b_pyramid:weight_b:direct_pred=auto:mixed_refs:trellis=1:threads=auto:pass=2 -o output.avi
And if you want possibly better quality sound you can change:
Code:
-oac mp3lame -lameopts q=2
to
Code:
-oac faac -faacopts quality=500
 
Old 11-23-2009, 03:18 AM   #11
sinail
LQ Newbie
 
Registered: Nov 2009
Posts: 4

Original Poster
Rep: Reputation: 0
thanks - it works!
 
Old 11-23-2009, 03:35 AM   #12
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
Great, if you want to further adjust video quality you can use a lower qp= value, but this will generate a larger file.
 
  


Reply

Tags
avidemux, mpeg2



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
converting *.avi to *.mpeg error ceantuco Linux - Newbie 12 05-20-2009 04:13 AM
converting dvix, mpeg, and avi to dvd LinuxGuru707 Linux - Software 7 09-14-2007 05:01 PM
avi to mpeg, reduce size of mpeg? gunnix Linux - General 5 03-04-2007 05:55 PM
best tool for avi->mpeg film converting ? soup21 Linux - Software 4 11-22-2005 10:47 AM
Converting avi to mpeg jnx138 Linux - Software 1 11-23-2003 03:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:32 PM.

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