LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   converting mpeg 2 to avi (https://www.linuxquestions.org/questions/linux-software-2/converting-mpeg-2-to-avi-770454/)

sinail 11-20-2009 09:54 AM

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

timmeke 11-20-2009 11:00 AM

Try http://www.linuxquestions.org/linux/...files_to_AVI_0
and next time, search these forums...

H_TeXMeX_H 11-20-2009 01:49 PM

Does it have to be Xvid compatible ? so it can play on standalone players ?

lazlow 11-20-2009 02:39 PM

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

sinail 11-21-2009 03:08 AM

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

Adam.lei 11-21-2009 04:42 AM

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.
:)

lazlow 11-21-2009 09:11 AM

@ 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).

H_TeXMeX_H 11-21-2009 09:35 AM

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.

sinail 11-21-2009 02:21 PM

1 Attachment(s)
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 :)

H_TeXMeX_H 11-21-2009 03:08 PM

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

sinail 11-23-2009 03:18 AM

thanks - it works!

H_TeXMeX_H 11-23-2009 03:35 AM

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


All times are GMT -5. The time now is 11:20 PM.