Re: [Tutorial]How to encode MPEG4 AVC videos
Its actully pretty simple.
1: Download and install the programs at the top. You don't need x264 since when you update MeGUi installs it for you and I wouldnt install Yamb but find mkvmerge GUI V2.9.5
2: Create a new .avs file by right clicking > new > AviSynth Script
3: Copy and paste this into it
DirectShowSource("C:gamename.avi"
#trim(1000,10500) # Trims the Video - get the framenumbers with VirtualDub - remove the '#' if you want to use it.
#changefps(20) # remove the first '#' if you recorded at 25fps
#pointresize(width*2,height*2)
SubsStart=25 # set to 25 if you recorded at 25 fps
SubsDura=150 # set to 125 if you recorded at 25 fps
Subtitle("-= Mortal Kombat Mythologies: Sub-Zero =-", first_frame=SubsStart, last_frame=SubsStart+SubsDura, y=410, size=24, text_color=$ffffff, align=2)
Subtitle("Played By RickyC", first_frame=SubsStart, last_frame=SubsStart+SubsDura+5, y=430, size=24, text_color=$ffffff, align=2)
Subtitle("WWW.LONGPLAYS.NET", first_frame=SubsStart, last_frame=SubsStart+SubsDura+10, y=454, size=24, text_color=$ffff00, align=2)
ConvertToYV12() # Converts to YV12 colorspace for h264
It looks less complicated once its been pasted in the text document. You need this for each one of your videos or just edit the one you have each time. You want to change "("C:gamename.avi"
" to where your game is and the name of the file.
At the bottom of all that is the game name and who created the movie and this will be printed on to the video at the start so change that too. Also the numbers after the "Y" will increase/decrease the position of the text at the start and "size" will increase/decrease the text size. The SubsDura=150 and SubsStart=25 numbers are for how long the text will be shown for. It will be a little trial and error to get it perfect specially if you've never done it before but it takes seconds.
If there is a "#" at the start of a line it will stop the function taking place. So if you don't want the "longplays.net" text to be on or don't want the framerate changed just place a # before it. You can see there is one before the framerate text already.
So most of the time you just changed where the file is and what the video is called at the top and on the bottom lines change the name of the player and what the game is called. If you don't see the text at the start adjust the number after the "y" till you get it in a nice place.
4: Save the .Avs file.
5: Check the text that is printed at the bottom is in the right place and is up for a few seconds by opening the .avs file or dragging it in to your video player. Media player classic works or even virtualdub should work.
If the video doesn't show its most likely you didnt type in the correct location of the file in the avs file or you typed the wrong file extension after the name of the video like gamename.mp4 instead of gamename.avi.
6: Once the text shows perfect open up megui and update it. Copy the "'neroAacEnc.exe" files you downloaded at the start int megui's root folder too. If its gives errors when encoding the audio its not the root folder but copy into the folder it tells you to.
7. Under encding setting of megui's main screen select x264 scratchpad and click config in the video encoding section and and change the settings to what is shown above or as close as you can get it since the new megui menus are different.
To lower/increase quality Change the number by quality that is defaulted at 30. Though I normally leave this. If the file size i huge though i would change to 31 or 31.5. If you want it a little better then maybe 28 but im normally ok with default. Higher numbers = lower quality. I find if the number is too high then things on the video seem to shake or jump mainly in 3d games.
Also changing the min/max quantizers under advance from 5 / 30 will help with file size and affect quality much less i find. For faster 2d games or 3d games i change to 20 / 35. For super long games maybe 25 / 40. Higher numers = lower quality. I dont notice much different when changing numbers but flie size gets lower.
If you are unsure what numbers to set create a 1 or 2 min test video of different parts of the game and see how it looks. You don't need to be changing the numbers that often it will generally look good and 20/35 will give nice file size to quality ratio for most games.
You will use your own numbers if you ever get used to it.
8: save the profile. Then under the audio encoding part select Nero AAC scratchpad go to config then audio settings above ans save the profile. You'll only need to config all this once then after this its quicker.
9: Click the top right "..." button and select your .avs file. Change the output name and go to enqueue. Beware Megui will copy over files with the same name so chaning before starting is always good.
10: Do the same for the audio part mke sure the output name isnt the same as the video otherwise it will go over the video. If the avs file doesnt work then save a .wav file of your movie in virtualdub and use that where you would use your avs for the audio encoding.
11: Select Queue and press start.
12: Once finished use MKVmerge to join the audio with the video and BAM.
If there is any unsync in the audio you can set a delay in mkvmerge though youtube won't take notice of it. If delay is more gradual you can either go back to the source files and try to fix with virtaldub or create a wav file of the audio, open it in a program like audacity and add silence or delete parts of the audio in different parts of the track to keep it in sync. Not the most accurate way but i can be faster than going back to the source files and starting over.
13 Videos should be in one complete file and not multipul parts. but you can do a little each time and join them all up at the end using mkvmerge. If you're going to do this make sure the settings you use in megui are exactly the same for time use encode a part of you won't be join them up.
After all the parts are done use mkvmerge and drag the 1st video part to it, highlight that part then click append and pick the 2nd part then highlight that 2nd part append again till all the video parts are there.
Then go to add and pick your first audio file, then highlight it and go to append and add your 2nd audio file etc till all your audio parts and video parts are there.
Then start mkvmerge. All will be joined and hopefuly in sync. If not you can add a delay in the audio with each individual part you append and try again.
I really did want this to be short and uncomplicated but it turned out a little different than how it started. If you have other ways to encode with H264 then you could use them but MEgui is the easiest and fasters way i've found. Same with the audio if you can convert to aac with variable bitrate you could as well.
Took me awhile to get this down and i still make mistakes in encoding from time to time and some videos just don't want to encode correctly.