PDA

View Full Version : Recipe to convert mpg to xvid?



rgann
2005-05-20, 06:10 AM
Hi, I'm hoping for find an easy-to-follow guide on how to convert the mpegs that gbpvr makes (default medium setting mpeg2s) to xvid-encoded avis. I've seen video files on the net that are beautiful in xvid, and at only 350 megs for a 52 minute episode of something.

I tried using virtualdubmod, but the aspect ratio gets changed and the visual results aren't great. How about it: has anybody got a recipe for how to do this? doom9.org and videohelp.com don't really address the issue.

dottore
2005-05-20, 09:03 AM
try autogk at doom9.org. this is an automated gordian-knot - installation. very helpful, you just have to give the filename of your mpeg, the codec and it does a good job.

rgann
2005-05-21, 04:27 AM
Nice. This is good and easy. And if you install the beta version it even uninstalls its spyware. Thanks dottore.

reboot
2005-05-21, 06:53 PM
Virtualdubmod works for me.
I don't know why you think it changes the aspect ratio, unless you added the filter.
The quality is decided by the codec you choose, and the settings of that codec.
I have terriffic results with DivX 5.

pcostanza
2005-05-22, 01:47 AM
Nothing I tried can even come close to the quality I've seen on the net. Some of the British shows I've seen are just under 1 hour and are always under 400meg. The quality is awesome. I've just about given up. I got a 1 hour show only down to 1.2 gig and the quality was not good at all.
Autogk is easy but just isn't good enough for me.

wtg
2005-05-23, 08:31 PM
You might try Pocket Divx Encoder (http://divx.ppccool.com/). It'll convert to Divx or Xvid, though I've not tried XVid myself. It has a nice interface, is super easy to use, and seems faster than most (though I've not timed it).

You might think from the website that it's only for converting to handheld formats, but that's not so. You can pick a PC as the target platform, pick the resolution you want, and it'll convert just about any AVI or MPG source.

If you try it, post back with your results.

Tim

American_rob
2005-05-24, 09:08 PM
Has anyone had luck automatically creating .avi files for smartphone / pocket pc? This is one of the only areas that snapstream had an advantage in. It automatically created .wmv files for playing on pocket pc.

I have used Pocket_DivX.exe with a great deal of success in the past and thought about working in a line to the PostProcessing.bat file to create an entry in a Pocket DivX Task file. Then launch Pocket DivX with the windows scheduler at like 4:00am each morning to process all the files in the task file.

Anyone done this or know an easier way?

Could be a great plug if it let you configure the settings for converting based on which show you were working with. (for instance my girlfriend watches Friends on her smartphone and I would like to have PPC versions of some Anime I record). Should be integrated into Xrecord though to make it easy. Pick the quality setting as well as secondary file settings. Also good if it gave the option to delete the original file or not. It's much easier to keep 100's of 50meg files but difficult with 1.5 gig ones.

Thanks for any help.

erik
2005-05-28, 07:37 PM
Pocket Divx Encoder is actually a graphical frontend for mencoder
From the settings in the userinterface a file named temp.sh is generated in the temporary file directory, then this temp.sh is run.

You can copy the commandline that runs mencoder in a batch file and use it to automatically encode all your mpg into avi's.
The line below encodes good quality divx on a 1.8GHz pentium with more then 50 f/s or 2 times quicker then realtime.

mencoder.exe input.mpg -oac mp3lame -lameopts mode=2:cbr:br=128 -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=1800 -ffourcc DIVX -o output.avi

No scaling is done so the full resolution is kept.

American_rob
2005-05-29, 04:01 PM
Do you have a full set of parameters for Mencoder under DOS / Windows?

My Pocket_DivX.exe is a standalone. I would love to have command line options.

Pocket_DivX does a great job encoding so I would assume the quality is the same with Mencoder.exe - I have found better results than with AutoGK and like the preconfigured settings for Smartphone and Pocket PC.

p.s. I posted an Automate Pocket_DivX script that autoloads any new files ina directory and subdirectory. Command line options would be much more solid however.

capone
2005-05-29, 04:08 PM
I'm w/o you on that. I try and have used a ton of apps, but it never seems to compare to quality I see from groups like lol.

I keep meaning to find the xvid encoder settings they use. The app does a lot for you, but I think it's optimizing the encoder itself that really makes a difference.



Nothing I tried can even come close to the quality I've seen on the net. Some of the British shows I've seen are just under 1 hour and are always under 400meg. The quality is awesome. I've just about given up. I got a 1 hour show only down to 1.2 gig and the quality was not good at all.
Autogk is easy but just isn't good enough for me.

erik
2005-05-29, 04:42 PM
My c:\temp directory is normally empty.
When I start pocket_encoder it unpacks a whole bunch of files in c:\temp
When you select an input file and hit the preview button a file called temp.sh is generated.
The second line of the file contains the command that is used to run mencoder
So you can experiment with pocket_encoder till you have something you like and then copy the second line from temp.sh to get the mencoder command line parameters.
Once you quit pocket_encode all the files it created in the c:\temp directory are deleted!!!!
This second line you then put into a .bat file (e.g. postprocessing.bat) to have it run automatically.
The two files you need from the c:\temp directory are mencoder.exe and xvidcore.dll. Copy them to the gbpvr home directory and modify the second line from the temp.sh you copy into postprocessing.bat like this.
Example as generated with PC output and the advanced setting High Quality option disabled.
Original line
./mencoder.exe "C:\Temp\x\t.mpg" -oac mp3lame -lameopts mode=2:cbr:br=96 -ss 387 -endpos 10 -vf scale=512:384,eq2=1.0:1.0:0.03:1.0 -sws 2 -ovc lavc -lavcopts vcodec=mpeg4:vhq:vbitrate=640 -ffourcc DX50 -o "C:\Temp\x\t_PC.avi" >> 1.txt 2>> 2.txt
Changed line to be included in postprocessing.bat
mencoder.exe "%1" -oac mp3lame -lameopts mode=2:cbr:br=96 -vf scale=512:384,eq2=1.0:1.0:0.03:1.0 -sws 2 -ovc lavc -lavcopts vcodec=mpeg4:vhq:vbitrate=640 -ffourcc DX50 -o "%~dpf1.avi"

You may have to change the ffourcc setting from DX50 to DIVX to be able to use your mediaplayer. Some experimenting helps.
I have not tested this in my postprocessing.bat but used it as standalone
If you have problems using it, send me an email with your postprocessing.bat
Good luck!

rgann
2005-05-31, 06:04 AM
I tested both AutoGordianKnot and PocketDivxRecorder, as suggested.

AutoGK is a pretty nice program. It automatically runs a double pass xvid recording, and the output results are quite acceptable with minimum of blockiness. One can simply set a desired output size, and the program runs a compressibility test to optimize parameters. The aspect ratio is always maintained, so that video is never stretched out. Unfortunately, the author has chosen to make the audio vbr mp3 by default (so that virtualdub will have trouble with it), but this can be changed.

Pocketdivxrecorder might work for some, but for me it was rather weird. First, the automatically selected output for my 704x480 input mpg (from medium quality gbpvr recording) was 640x436. That ratio is certainly close to 704x480, but the output video is noticibly stretched horizontally. The encoding is very fast (easily 1/10th of autogk) but is fairly blocky for the same output size. Also, the program seems only to support divx (correct me if I'm wrong) which is philosophically a bit icky to me (not open source).

Although some may have usage suggestions that obviate my troubles with Pocketdivxrecorder (and I'd love to hear them), it seems like AutoGK is the better choice.

wtg
2005-05-31, 12:39 PM
Also, the program seems only to support divx (correct me if I'm wrong) which is philosophically a bit icky to me (not open source).


I think you'll find an XVid option on the Advanced properties page.