|
|
INDEX F.A.Q. SEARCH LATEST POSTS
Rules Register Profile Private messages Login
| Author |
Message |
ta2 Member
Joined: 11 Jan 2003 Location: England
|
|
How to Convert AVI to DVD & AC3 with CCE and AC3Machine
Contents:
1. Introduction
2. Tools
3. Getting Things Ready (GSpot)
4. AVISynth Scripts (AVISynth)
5. Calculating Your (Average) Bitrate (DVDRHelp.com Bitrate Calculator)
6. Encoding with CCE (Cinema Craft Encoder)
7. Extracting the Audio (VirtualDub)
8. Converting the Audio (AC3Machine & BeSweet)
9. Pulldown (Pulldown.exe and PulldownBatchFE)
10. Author
11. Troubleshooting
Introduction
CCE is undoubtedly the worlds leading MPEG-2 encoder. It's faster and boasts better quality than any other encoder out there. However, all is not well - CCE lacks some very basic options which could make things so much easier at our end. For example, there is no resize feature or add borders feature. No preset templates, no AVI, WAV etc encoding, and the frame rate conversions (25 to 30 etc) leave a lot to be desired. This guide will help you configure CCE and AC3Machine to convert your AVI file to DVD standard MPEG-2 + DVD standard AC3.
Supported conversions:
Video to Video:
AVI to DVD, DivX to DVD, DV to DVD, XviD to DVD
Audio to Audio:
WAV to AC3, MP3 to AC3, OGG to AC3, MP2 to AC3, WMA to AC3, MP3 to WAV, OGG to WAV, MP2 to WAV, WMA to WAV
Video to Audio:
AVI to WAV, AVI to AC3, DivX to WAV, DivX to AC3, DV to WAV, DV to AC3, XviD to WAV, XviD to AC3
Tools
Firstly you'll need to set up a few of programs, namely:
AC3Machine 0.41 (other versions may work) - freeware, available from doom9.org
AVISynth 2.5x (I use 2.52) - freeware, available from avisynth.org
BeSweet 1.4 (other versions may work) - freeware, available from doom9.org
CCE 2.67.00.xx (I use 2.67.00.10) - trialware, available from cinemacraft.com
DVDRHelp.com Bitrate Calculator - freeware, available here
GSpot 2.xx (other versions may work) - freeware, available from headbands.com/gspot
Pulldown.exe - freeware, available from here
PulldownBatchFE 1.0 (other versions may work) - freeware, available from here
VirtualDub 1.5.7 (most versions will work) - freeware, available from virtualdub.org
1. AC3Machine is the AC3 encoder. It is a GUI for BeSweet.
2. AVISynth is used to serve simple functions to CCE.
3. BeSweet allows AC3Machine to run.
4. CCE is the MPEG-2 encoder.
5. DVDRHelp.com Bitrate Calculator tells us the average and max bitrate.
6. GSpot gives us important AVI information.
7. Pulldown.exe converts our 23.976 fps file to a standard 29.97 fps. If not using an NTSC source you don't need this.
8. PulldownBatchFE makes using Pulldown.exe much, much easier. If not using an NTSC source you don't need this.
9. VirtualDub extracts and converts audio from the AVI file.
Getting Things Ready
To start off, you should obviously set up all of your programs and make sure they're all working. This can save a lot of hassle later on.
Once all your programs are fully functional, open up GSpot. You will see a screen similar to this:
1. Click on the button, and direct yourself to your AVI file.
You'll now see (something similar to) this:
2. Note down the FPS
3. Note the Resolution and Aspect Ratio
4. Note the type of audio
5. Note if the audio is stereo, mono or 6 channel
6. Note the sampling frequency
7. Note the movie length
If you have AC3 Audio (4) then you won't need to use VirtualDub and AC3Machine to convert the audio, since you already have it. Instead you can use VirtualDub to do a direct stream copy (very, very quick). If you have 44.1KHz AC3, then you'll still have to do the whole process. Though I think that's probably quite unlikely.
AVISynth Scripts
Once you've done this, you can start up notepad so you can start making your AVISynth script. It's very simple, and will go something like this...
avisource("C:\2 Fast 2 Furious.avi")
LanczosResize(x,y,)
AddBorders(0,z,0,z)
ConvertToYUY2()
ResampleAudio(44100)
Of course you'll have to replace the letters in blue with a few numbers of your own. You can also change 'LanczosResize' to 'BicubicResize' if you wish, but I have always thought Lanczos yields a clearer and less blocky picture (although the difference is actually quite negligible). ResampleAudio is supposed to allow CCE to run on AMD CPUs, but I never use this line and have had no problems on my Athlon XP 2100+.
Finding your x, y and z values
To find out your x, y and z values you will need to do a few calculations. Here are the calculations for a 4:3 movie:
PAL Movies:
Actual size is 720x576, so you will need to calculate the following.
592x256 (your movie size, 3, which you noted earlier).
720/592 = ~1.216
1.216 x 256 = ~311.2
Since you can't have a decimal, and odd numbers will not fit the borders as easy as even ones, then you use 312 as your y value. Side note: if you did want to try using 311, then your borders would be (0,z,0,z+1), you'd still use all of the other values as the same. Likewise, you you had, for example 310.9 you would round down to 310, or 311 with (0,z,0,z-1) since you are rounding up.
x is always 720 for a PAL, 4:3 movie.
z is the easiest value to find. Just take this equation:
576-y
/2
So for my movie here, I would be using 312 as my y value, so...
576-312 = 264
264/2 = 132
So 132 is my z value.
NTSC Movies:
Actual size is 720x480, so you will need to calculate the following.
592x256 (your movie size, 3, which you noted earlier).
720/592 = ~1.216
1.216 x 256 = ~311.2
Since you can't have a decimal, and odd numbers will not fit the borders as easy as even ones, then you use 312 as your y value. Side note: if you did want to try using 311, then your borders would be (0,z,0,z+1), you'd still use all of the other values as the same. Likewise, you you had, for example 310.9 you would round down to 310, or 311 with (0,z,0,z-1) since you are rounding up.
x is always 720 for a PAL, 4:3 movie.
z is the easiest value to find. Just take this equation:
480-y
/2
So for my movie here, I would be using 312 as my y value, so...
480-312 = 168
168/2 = 84
So 84 is my z value.
Here are the two scripts I would be using for PAL and NTSC respectively.
avisource("C:\2 Fast 2 Furious.avi")
LanczosResize(720,312)
AddBorders(0,132,0,132)
ConvertToYUY2()
ResampleAudio(44100)
avisource("C:\2 Fast 2 Furious.avi")
LanczosResize(720,312)
AddBorders(0,84,0,84)
ConvertToYUY2()
ResampleAudio(44100)
I will add calculations for 16:9 movies later on, but for now you can make do with these or work out the 16:9 values for yourself.
So, now that you have your AVISynth script written out in notepad, save the file. Make sure you save the file as ***.avs because otherwise CCE will not load the file. If you have saved the file as an .avs file, then you will see the AVISynth icon on your ***.avs file. If you don't see the .txt extension, open any directory, go to 'Tools->Folder Options->View' and uncheck 'Hide Extensions for known file types. You can now rename your file to a .avs extension.
Calculating Your (Average) Bitrate
You noted down the movie length (Runtime) earlier. In this case it was 1:47:41. You should now go to this page: http://www.dvdrhelp.com/calc.htm and use the bitrate calculator.
1. Enter your movie length in the field at the top.
2. Make sure the calculator is set to DVD mode.
3. In this case I'll be using 224/kbit audio, since my source isn't great quality, but you can use whatever you want here. Remember, the higher your audio bitrate, the lower your video bitrate.
4. Note down the average bitrate.
5. Note down the maximum bitrate.
6. You can change the amount of DVD's you'll use if you want, but in most cases 1 DVD is more than enough.
Encoding with CCE
Now that we have the script sorted, everything is fairly easy. Open CCE, and drag your .avs file into the main window. You'll have a screen similar to this:
Now right click on the file, and go to Edit...You'll see this screen:
1. Change the encoding type to either:
MPEG-2, One Pass CBR (Speed)
MPEG-2, Multipass VBR (Quality)
2. Enter the minimum bitrate as 0. (Not applicable to CBR).
3. Enter the average bitrate as whatever you noted down earlier.
4. Enter the maximum bitrate as whatever you noted down earlier. (Not applicable to CBR).
5. Set the number of passes you want (more = better quality, less = better speed). (Not applicable to CBR).
6. Make sure the timecode setting is at: 00,00,00,00
7. Make sure CCE is set to 4:3 Encoding and that all other settings are the same as in the picture.
8. Click Video, and make sure everything looks as it is below. Select the frame rate that you noted earlier. Do not try a frame rate conversion, CCE is appalling at this and you will have wasted your time. Try TMPGEnc for frame rate conversions.
9. Click Quality, and make sure everything looks as it is below. You will probably have to change the Intra Block DC precision, the Block scanning order, and check the Progressive frame flag box.
10. Click Encode now, and come back a few hours later...
Extracting the Audio
Now that you have the video sorted, all you have left is the audio. This process is a lot quicker than that of the video, and also a lot simpler since there are very few places where you can screw up.
Load up VirtualDub. Go to the file menu, and open your AVI file.
Ignore the '2' for the moment, you will have to come back to this menu later and click on that option. Now that you've loaded your AVI file, go to the Audio menu.
If you have AC3 audio, see the note at the end of this section, otherwise select 'Full processing mode' from the menu, then go to the conversion menu.
In this case, our audio is already at 48KHz, so we don't need to resample it. But in most cases you will have to resample from 44.1KHz to 48KHz (1). Once you've done this, click OK and go to the file menu.
NOTE: If your AVI file has AC3 sound (you found this out back at the start with GSpot) then you should go 'Direct Stream Copy' and then save the file. You don't need to resample it usually since its already 48KHz most of the time. In the case that it is 44.1KHz, you'll have to use AC3Machine.
Click on 'Save WAV...' and save your new wave file to a convenient location. The conversion process should only take about 3 or 4 mins.
Converting to AC3
Now that you have a nice big WAV file, all you have to do is convert it to AC3 and you are finished. Load up AC3Machine, and you will have a screen like this:
1. Load your WAV file here.
2. Select a location for the output file here.
3. All the way back at the start, you found out what type of audio you had. About 95% of the time it will be Stereo, since if it was 5.1 you wouldn't be here anyway, you could have just done a direct stream copy. The other 5% of the time you'll have Mono (yuck!) since you can't select mono here, you'll have to go for stereo again.
4. Choose your bitrate here, make sure its the same as the value you used in the DVDRHelp bitrate calculator.
5. If you have 44.1KHz AC3 as input, you'll need to set the sampling rate to 48000Hz. If you have WAV audio, then don't resample it.
6. Make sure all other options are the same as in the picture.
Encode!
You now have a .mpv file and an .ac3 file. Rename your .mpv file to .m2v so that authoring programs will recognise it. Any preliminary files can now be deleted. Though it is recommended that you save them until you are 100% sure your DVD came out ok.
If you had 23.976 as your frame rate, you'll need to use Pulldown on your file. If not, then you can proceed to the authoring step.
Pulldown
Load up your file in the Pulldown GUI (PulldownBatchFE) and click 'process'. Wait a little while and you will have your fully DVD compatible and audio synched .m2v file.
Author
Before you can play your encoded files on your DVD player, you need to encode them. Currently I haven't made a guide for this part of the process, but you can use this guide by Baldrick to help you author your DVD.
Troubleshooting
1. CCE Encodes 240 frames of error message, help!!!
Make sure you have correctly located your AVI file in the AVISynth script, remember, you won't be using the same location as me! Also make sure you have the correct codecs installed. GSpot will usually tell you if you have the codecs installed.
2. CCE Won't Accept my AVS file.
Your version of CCE might not be compatible. Check it is version 2.67.00.xx. Other versions may work, but I have not tested them. If it is a compatible version, make sure you have correctly installed AVISynth, and that you have an up to date version. I used version 2.52, but I think 2.08 will work as well. Not 100% sure on that one though.
3. My MPEG-2 file looks stretched or squashed.
Make sure you have done the right calculations for the AVISynth script. It is very unlikely you will be using the same aspect ratio as me since this file has a really weird one. In a later version of this guide I may add a calculator to help create an AVISynth script for you.
4. VirtualDub won't extract my Audio.
Make sure you have the correct codecs installed, and that if you have AC3 audio you are using a direct stream copy. I have had problems with AC3 audio and have found VirtualDub will not convert it to WAV format. GSpot will usually tell you if you have the codecs installed.
5. My authoring program won't accept my MPEG-2 file.
Make sure you have renamed the file to ***.m2v (was ***.mpv before). Also, if you are using a source of 23.976, then you will need to use pulldown on your file.
6. The audio is really quiet.
That's probably because you are playing the file on your computer. AC3 is meant for being played on a TV or similar. If you really need to, you can use a program called 'Goldwave' to increase the volume. Also, make sure you selected 'Auto Find Maximum Gain' in AC3Machine.
7. I get a logo in each frame of my video!
That's because you are using a trial version of CCE. Get the full version from somewhere.
8. The audio is out of sync.
Make sure you have used pulldown if you have used a source footage of 23.976 and make sure you have selected the right frame rate throughout.
9. The picture is jerky.
Oh dear. You've tried to use CCE to convert the frame rate. I did warn you. TMPGEnc is the best out there for frame rate conversion, and its absolutely free! Get it from http://www.tmpgenc.net and follow a guide for it to convert the frame rate. In most cases there is no need to convert the frame rate, unless your TV can only support PAL/NTSC. If you are playing back on your computer, you might need an upgrade since playing DVDs requires a lot of processor power.
10. AC3Machine won't run.
Make sure you have installed BeSweet to the same directory.
11. Pulldown won't run.
Make sure you have installed Pulldown.exe and PulldownBatchFE to the same directory.
12. CCE Stops encoding just before it's finished!
This is probably when the file size reaches 4GB. Only NTFS file systems can support files this large.
13. CCE Stops encoding soon after it's started.
This is probably because you are on an old Athlon CPU. Make sure you have added the 'ResampleAudio (44100)' line to your AVISynth Script.
Guide created by Games-Realm, Copyright 2003 © Games-Realm.com
|
|
TheDJ® Member
Joined: 17 May 2003 Location: London
|
|
Something u could add to ur guide, which i am having trouble with.
When extracting the audio as Direct stream ac3 using VD, how do u lower the bitrate to match what was shown in the bitrate calculator.
I.E.
Extracted AC3 = 448kbps
Target = 224kbps.
I mentioned this because now i cannot burn my DVD as it has gone over 4.7 gig, because of the AC3 audio bitrate being too high.
|
|
TheDJ® Member
Joined: 17 May 2003 Location: London
|
|
I've stumbled across another problem.
After doing all conversions, when i add my m2v and ac3 to my authoring program, it is showing as 29.970 fps, whereas the movie was actually encoded as 23.976 fps, and original source is same!
Now when i play back the movie which i burnt as 29.970, it is slightly jerky!
Why is it showing as 29.970 fps in authoring? I used pulldown after converting.
|
|
ta2 Member
Joined: 11 Jan 2003 Location: England
|
|
| TheDJ® wrote: |
Something u could add to ur guide, which i am having trouble with.
When extracting the audio as Direct stream ac3 using VD, how do u lower the bitrate to match what was shown in the bitrate calculator.
I.E.
Extracted AC3 = 448kbps
Target = 224kbps.
I mentioned this because now i cannot burn my DVD as it has gone over 4.7 gig, because of the AC3 audio bitrate being too high. |
ANSWER: You should have put 448kbps in the bitrate calculator. You can overcome this, however, by reencoding the AC3 file with AC3Machine.
| TheDJ® wrote: |
I've stumbled across another problem.
After doing all conversions, when i add my m2v and ac3 to my authoring program, it is showing as 29.970 fps, whereas the movie was actually encoded as 23.976 fps, and original source is same!
Now when i play back the movie which i burnt as 29.970, it is slightly jerky!
Why is it showing as 29.970 fps in authoring? I used pulldown after converting.
 |
I have no idea about this one. Sorry.
|
|
TheDJ® Member
Joined: 17 May 2003 Location: London
|
|
Hi Taz, thanks for eventually replying.
I would also like to know the values to use for a 16:9 format instead of the 4:3 format u used above. Or do i just select 16:9 in CCE?
Other than this Taz, the guide works very well, thanks for your efforts! I prefer using CCE to TMPGenc any day, quailty kicks a**!
Hope u can reply a bit quicker.
Thx
/TheDJ®
|
|
b0bby Member
Joined: 22 Dec 2003
|
|
i have finally got my video and audio sync'd @ 25fps.
but the whole think when multiplexd is kinda of slow.
surly thats not right....
how can i not speed the whole thing up slightly....
so it actually sounds correct.
Its fine if i encode to ntsc but i need it in PAL
cheers
|
|
yepyep Member
Joined: 06 Dec 2003
|
|
AVIcodec shows my video as 640*464 (4:3)
x = 720
y = ((720 / 640) * 464) = 522
z = (480 - 522) / 2 = -21
So the question is: what
avisource("D:\APie2.avi")
LanczosResize(720,522,)
AddBorders(0,21,0,21)
ConvertToYUY2()
When I try opening this, it says "GdipLoadImageFromFile failed : 3"
Hmm tried LanczosResize(720,480,) too and it did the same thing tho..
Anyone know what's wrong?
|
|
insayn Member
Joined: 27 Jan 2003
|
|
Hi Ta2,
I have a problem using your guide. Here is what I get from GSpot for my avi video.
FPS 23.97 Aspect Ratio 752x320 2.35:1 Audio ac3
Audio is 5ch Sampling frq 48000 Movie length is 01:40:27
This is the Script I used and saved as .avs:
avisource("E:cd1.avi")
LanczosResize(720,306)
AddBorders(0,87,0,87)
ConverToYUY2()
ResampleAudio(44100)
When I drag into CCE it gives me this error message:
Frame size 728x56 is not supported.
Any ideas on what I am doing wrong? Thanks For Your Help and for this guide.
|
|
asisoft Member
Joined: 04 Sep 2003
|
|
| insayn wrote: |
When I drag into CCE it gives me this error message:
Frame size 728x56 is not supported.
|
This error happens from time to time and something the frame length was reported much lower than it should be. Don't know whether it was CCE or AVISyn fault. What I usually do is to reboot Windows or change the AVISource() into DirectShowSource(). It works in most of my cases.
|
|
insayn Member
Joined: 27 Jan 2003
|
|
| asisoft wrote: |
| insayn wrote: |
When I drag into CCE it gives me this error message:
Frame size 728x56 is not supported.
|
This error happens from time to time and something the frame length was reported much lower than it should be. Don't know whether it was CCE or AVISyn fault. What I usually do is to reboot Windows or change the AVISource() into DirectShowSource(). It works in most of my cases. |
Thanks I will give it a try tomorrow and let you know....
|
|
TheDJ® Member
Joined: 17 May 2003 Location: London
|
|
| asisoft wrote: |
| insayn wrote: |
When I drag into CCE it gives me this error message:
Frame size 728x56 is not supported.
|
This error happens from time to time and something the frame length was reported much lower than it should be. Don't know whether it was CCE or AVISyn fault. What I usually do is to reboot Windows or change the AVISource() into DirectShowSource(). It works in most of my cases. |
Directshowsource is for Mpg's.
Maybe the calculations for the video size was wrong?
|
|
asisoft Member
Joined: 04 Sep 2003
|
|
| TheDJ® wrote: |
Directshowsource is for Mpg's.
|
DirectShow layer is more than MPEG.
|
|
TheDJ® Member
Joined: 17 May 2003 Location: London
|
|
| asisoft wrote: |
| TheDJ® wrote: |
Directshowsource is for Mpg's.
|
DirectShow layer is more than MPEG. |
is more than wot? wot do u mean?
|
|
asisoft Member
Joined: 04 Sep 2003
|
|
T0tum Member
Joined: 26 Jun 2003
|
|
Tnx, great guide.
If anyone could explain me, why should i use Pulldown>?
Ive encoded several movies with PAL 25fps and never used it, they work just fine...
ty
|
|
TheDJ® Member
Joined: 17 May 2003 Location: London
|
|
| T0tum wrote: |
Tnx, great guide.
If anyone could explain me, why should i use Pulldown>?
Ive encoded several movies with PAL 25fps and never used it, they work just fine...
ty |
You only need to use pulldown on movies which have an FPS of 23.976, so that it puts the video and audio in sync.
|
|
TheDJ® Member
Joined: 17 May 2003 Location: London
|
|
BUT! i am still enquiring about wot figures to us to make 16:9 encode.
I have asked this question several times now????????
|
|
[NL]Gh0sT Member
Joined: 06 Mar 2004
|
|
Hi,
nice guide, but I've stumbled upon a strange CCE error. When I try to load the following .avs file:
avisource("C:MyMovie.avi")
LanczosResize(720,324)
AddBorders(0,126,0,126)
ConvertToYUY2()
ResampleAudio(44100)
CCE gives me the following error:
| Code: |
/!\ Frame size 1380x80 is not supported. Supported frame size is up to 720x576.
|
Is there something wrong with the LanczosResize I typed?
Any help is appreciated,
[NL]Gh0sT
Edited the Z and the Y values, which were wrongely calculated, but still get a "too big" error.. 1380x56 now..
_________________ ..: [ Once Busted - Twice As Shy ] :..
Last edited by [NL]Gh0sT on Mar 25, 2004 11:58, edited 3 times in total
|
|
TheDJ® Member
Joined: 17 May 2003 Location: London
|
|
| [NL]Gh0sT wrote: |
Hi,
nice guide, but I've stumbled upon a strange CCE error. When I try to load the following .avs file:
| Code: |
avisource("C:MyMovie.avi")
LanczosResize(720,576)
AddBorders(0,198,0,198)
ConvertToYUY2()
ResampleAudio(44100)
|
CCE gives me the following error:
| Code: |
/!\ Frame size 1380x80 is not supported. Supported frame size is up to 720x576.
|
Is there something wrong with the LanczosResize I typed?
Any help is appreciated,
[NL]Gh0sT |
Looks like u made a calculation error during making ur AVI script.
Whats the specs of ur movie? Resolution? FPS?
|
|
[NL]Gh0sT Member
Joined: 06 Mar 2004
|
|
| Quote: |
Looks like u made a calculation error during making ur AVI script.
Whats the specs of ur movie? Resolution? FPS? |
FPS: 25.00
x:y: 640x288 (2.22:1)
Audio: AC3 Stereo
Fo: 48000Hz
Length: 01:16:14
(* Specs found using GSpot *)
Thanks,
[NL]Gh0sT
_________________ ..: [ Once Busted - Twice As Shy ] :..
|
|
troyvcd1 Member
Joined: 24 Jun 2002
|
| |