Log in

View Full Version : I don't know how to compress avi to x264...:(


inox187
23rd April 2007, 13:58
Well the thing is, i made the video of 1,98Gb which is of course too big.
I would like to compress it to x264 ( now it is cinepak radius codec )....but i don't know how.
I download it megui ,avi synth 2.5 and i was torchering myself almost a whole day but i did'nt manage to do anything.
Can someone pls help me with that?
Tnx in advance....

gameplaya15143
23rd April 2007, 14:32
now it is cinepak radius codecouch

You are probably lost with the avisynth part.. it does have a bit of a steep learning curve. I don't use megui so I can't help you there (I just type the commandline manually)

Usually all you need to get started is to create an *.avs file (create a text file and change the extension, be sure that you show all extensions in windows). Then tell it your video source
avisource("video.avi")(refer to the avisynth documentation for the built in filters and their usage, if you need them)

The first step is the hardest. Just keep at at. Good luck.

deets
23rd April 2007, 15:03
megui has an avisynth script creator - tools-avisynth script creator

but dont panic, avisynth is pretty easy for the simple stuff :)

as gameplaya said, you start with your source, then you add the other bits, such as resizing if you so wish.

one very handy tip is to add the trime command to the end, this is great for testing clips.

here is a example script megui made for me, but its easy enough to do by hand:

DirectShowSource("C:\com.mkv",fps=23.97,audio=true)
#deinterlace
crop( 0, 0, -2, -2)
LanczosResize(480,272) # Lanczos (Sharp)
#denoise
trim (25000,28000)

you could just change com.mkv to whatever your file is, mine is resizing for my PSP and then only doing 30000 frames for a test.

then load into megui, chose a profile and hit enque and it should give you a nice mp4 :D if you need any more help, let us know. im sure you will!

inox187
23rd April 2007, 16:24
tnx ppl for your help.
but i'm total noob for this.
i tried to put my avi file to the source and this is what i got:

http://www.imagesforme.com/thumbs/1144megui error.jpg (http://www.imagesforme.com/viewer.php?id=1144megui error.jpg)

because if i get it right i have to open my .avs file in this red line:

http://www.imagesforme.com/thumbs/6889meguiavisynth.jpg (http://www.imagesforme.com/viewer.php?id=6889meguiavisynth.jpg)

and it asks for my avs file, and all i have is avi :(.

I did one blank .txt file which i renamed to .avs as gameplaya said but it can't be loaded and i don't see why should be. it's empty. :( :( :(


i know i'm doing something wrong....:confused:

foxyshadis
23rd April 2007, 16:42
Your cinepak decoder is broken and causing the crash, most likely. Try uninstalling any codec packs you might have, install ffdshow-tryout, and enable cinepak decoding in VFW mode. (See the start menu entry it creates.)

If you possibly can, just re-render your video into another codec. Indeo, xvid, ffdshow's huffyuv or ffv1, anything but cinepak.

deets
23rd April 2007, 17:46
dont panic, yeah it looks complex, but we will walk you through it and get you sorted :)

inox187
23rd April 2007, 21:11
tnx ppl for help.
i did re-render it in xvid but i get the same error message.
i did rendering in adobe premiere pro.

To be honest, i don't know where to start from at all....

deets
23rd April 2007, 22:50
try this:

DirectShowSource("C:\youravi.avi",audio=false)

put that in blank text file and save as test.avs and change the file name and paths to your avi. see if that will load

Blue_MiSfit
23rd April 2007, 23:00
Dear god please please re-encode the original. Cinepak is 15 years old and hopeless when compared to anything modern.

What is your source? DVD? An editing program? Analog capture?

~MiSfit

inox187
24th April 2007, 07:19
try this:

DirectShowSource("C:\youravi.avi",audio=false)

put that in blank text file and save as test.avs and change the file name and paths to your avi. see if that will load

Tnx, I'll try that ;)



What is your source? DVD? An editing program? Analog capture?

Mixture. I used .avi files from aeffects, 3d max studio, flash and still images from photoshop....

Didn't know for cinepak :( :( :( , i used only xvid untill now

burfadel
24th April 2007, 10:25
Try staxrip:
http://www.planetdvb.net

Its very user friendly :) for the people who like writing 10 page avisynth scripts MEGUI is better, but for the average user who wants simplicity, yet have all the normal abilities (you can add filters etc), then Staxrip is more intuitive.

It will ask you to download everything. It uses the vfw interface so it recompress avi files no problems as long as you have the cinepak codec installed.

When in staxrip, use the profile 'DVD'. I know its not a DVD, but its just a settings profile. It changes the source thing automatically when loading the file. DVD is the default profile anyway.

Do this without opening your file, its just setting the profile up. If you do it once you have loaded the file you can not save the changes as a template and you'll have to do it again next time.
Can't remember the default settings, but I think x264 and AAC is the default (although he may have changed it back to XVID)...

Either way, you can click on the profiles menu, encoder, then click 'edit' at the bottom. A list of profiles is presented to you. Click on one that looks good, or better select an x264 one and click edit on the right side. Click on 'Codec COnfiguration' and all the x264 settings are available to you there. I don't like any of the profile set, you can make you own profile then add it to the list and call it whatever you want.

Now for the sound click on the down arrow to the right of the sound thing. Click on AAC then the top one. The profile doesn't set it to HE, the profiles are names very well. Click on the down arrow again then click 'edit'. The quality of the AAC file is after the -vbr option 0.5 is the default. You can set it to 0.4 to save space, AAC is very good and it will still be like an MP3 at 160 or more... someone insisted XVID and MP3 was better for a 700MB movie, I said x264 and AAC sound would be better even for a 400MB file (2.5 hr movie). The people who watched it and heard it didn't know which one was which (they didn't see the file size), both renamed .avi. Mine won for both video and sound :)

Save this as a template by clicking on file then 'Save project as a Template'. Then you won't need to keep changing things each time you load a file. btw, with the programmes, you can copy newer versions and then click ignore about the unknown version thing. This is especially useful with new versions of x264, just copy the new version over the old one in the program files directory.

Anyways load you movie up and it should work... If your sound was done in mp3 then thats a bit sucky, because the sound won't automatically be extracted sometimes... If you have problems with that you'll just have to extract the current sound using a different step. You can even use that as is, or recompress it (but only to AAC format, recoding to MP3 again will rresult in possibly a noticeable quality drop).

Hope this helps!

inox187
24th April 2007, 15:31
Hope this helps!

Thans to all you a lot, and to you, the most....

I just started to encode it.....

Althought i didn't find dvd in profile, there were only x264, divx and xvid, but encoding started...

Tnx 1 more, if i don't succeed i'll post again. ;)

burfadel
24th April 2007, 16:04
Glad to hear you go it worked out (hopefully)! The DVD is the initial startup template, I probably should have written that clearer. It loads up automatically with all the settings inside the template. If you add one file to the encode queue and load another to encode in the same session (of Staxrip being open), it will ask you which template (profile) you want to use. The default startup template will be highlighted which is DVD :)

You can fully customise the startup and default profiles etc. I guess can you can work that out with a bit of playing with it. Basically if you set all the settings you want you can save it as a template. Then under tools--settings you can select the default startup profile (template).

The x264 insane is a 2 pass mode that selects:
- 3 b-frames (i'd choose higher as adaptive is set. Since adaptive is set I usually set this to 16, and let the encoder have its freedom in deciding. Some people say it affects playback CPU use having it higher but this is not an issue on standard definition files (such as 720x576 (PAL) or 720x480 (NTSC), and thats if its not resized smaller already. Staxrip only works well with standard definition files, it takes some heavy playing around to work with High-def from what I've seen, but thats what you use MEGUI for. Most of the time depending on what you're using it for standard def is fine, and I take it you're in that group! I'm not one in that group, a good high def (1920x1080) file will be several times larger for the same quality. Plus if you're using that resolution you'd want ultimate quality, so you'd set the bitrate so high or the quantiser so low that you'd end up with a file several gig in comparison to a really really good one at 700!

- 16 reference frames (slow and insane :) , 5 or 6 is about where the benefit drops off to almost none. I found the only time its beneficial setting higher is when there repetition of near identical frames. In natural scenes even due to light changes, type of movement etc the extra reference frames aren't beneficial.

- Loop filter (-2, -1)

- B frames page. Leave all the boxes ticked, bias as 0 and 'Direct' mode at auto :)

- 'Frames options' page. Leave CABAC ticked, and the other settings as default.

- Analysis page:
- Mixed references should be ticked, No fast p skip can be enabled, it is slightly slower but may help in certain circumstances...
- Motion estimation method. 7 is best but 6 is only fractionally not as good but is faster. The percentage difference in speed is in at least double figures... you can have a 20ghz processor the same as yours (hypothetically), the percentage difference for your processor remains the same!

- subpixel motion estimation. Multi-hex is the best realistic mode, but you can get away with hex. This is also a double percentage figure difference.

- Trellis RD. Yeah leave that as always!

- Partitions page. Leave all ticked! simple!

Any additional settings can be added to the CLI page.

deets
24th April 2007, 17:23
Try staxrip:
http://www.planetdvb.net

Its very user friendly :) for the people who like writing 10 page avisynth scripts MEGUI is better, but for the average user who wants simplicity, yet have all the normal abilities (you can add filters etc), then Staxrip is more intuitive.



hehe i wouldn't say a 2 line avs is quite 10 pages :P

i think meGUI is fantastic and quite simple once you set aside 30 mins to work through it :)

burfadel
24th April 2007, 20:25
Yeah it is! Megui is more customisable, Staxrip is simpler :) its also very easy with cutting out ads etc, and batch encoding. Plus I've tried Megui a couple of times and couldn't get it working ideally taking everything in to account. Scripts can be placed in to Staxrip as well, just not a intuitively as Megui. They're both good! but Staxrip just seems to work for everything straight out! Such as the instance of recoding the Cinepak avi file.

inox187
24th April 2007, 21:37
well i did it but...the picture was full of errors :(
but i've puted hq insane at 800x600, so maybe that's the reason?
I'm running it again now at 720x480 at constant quality.

foxyshadis
24th April 2007, 21:58
Install the latest ffdshow, and if you're using CoreAVC 0.4 (included in many of the codec packs in the last year or two) be sure to disable it; there are some bugs that manifest themselves as broken picture.

Blue_MiSfit
24th April 2007, 22:53
Ok here's what you really need to do.

You edited everything in Premiere, so you need to re-render your project.

Premiere's export engine is... unsuitable :)

What I always do is this:
1) Install debugmode frameserver
2) Export from Premiere using AVI mode, and select debugmode as the codec. It will only take a second, and the debugmode window will come up. Here you can select YUY2 mode, and the frameserver will open. Keep Premiere and this window open.
3) The AVI that you created with the Premiere will be small - a few megabytes. It's just a placeholder for and encoding application to hook onto. Load it into VirtualDub, and re-encode it using fast recompress mode to a lossless codec like HuffYUV or Lagarith. Both are very good. This will actually pull the video off your premiere timeline, uncompressed, and feed it straight to Virtualdub, bypassing Premiere's export engine.
4) Go back to premiere, close the frameserver, and export your audio as a WAV (I havent figured out how to do audio and video all in one step)
5) You now have a lossless AVI, and an uncompressed WAV. These can be recompressed into x264 via StaxRip or MeGUI, depending on your preference.

If you find this guide confusing, send me a PM and I can send you some screenshots when I get home. Work machines too locked down :D

I do this stuff all the time. Premiere is tempermental and needs to me massaged ever so carefully

~Misfit

burfadel
24th April 2007, 23:45
Yep ^^^^^ that would work too! The video being full of errors probably is due to the decoder. Ffdshow does support cinepak now. The latest builts can be found at http://ffdshow.info

Basically use the one with the highest rev number. Like x264 they haven't released a final version yet (they have released a couple of beta's) but the last one is already quite outdated. Progress with ffdshow is quite steady. Make sure the cinepak box is ticked under 'codecs' in the video decoder settings. Hopefully that would work for you!

inox187
25th April 2007, 09:01
I tried yesterday 3 times after installing the newest ffdshow, and changing parameters, but i always get the same result egg. screen full of errors... :(
@ BlueMisfit....tnx for advice, i'll try that afternoon when i get back from work ;).