15 December 2007

AVI to DVD using HCenc Encoding

Programs Needed (All Free):

1. AVI Synth - http://www.videohelp.com/tools/Avisynth

2. HCenc (encoder) -
http://www.bitburners.com/Software/Download/Video_Codecs_and_Encoders/HC_Encoder/HC_Encoder_v0.22/

3. Bitrate Calculator -
http://www.videohelp.com/BitrateCalc.zip

4. Adobe Encore CS3 (not free)

-------------------------------------------------------

Step 1:

The first step in creating DVD's from our 4K or 2K projects (works with any type of AVI whether it is DV/HDV, etc) will be to export the final completed film (fully color graded, titles, effects, etc all completed) from Adobe After Effects.

Adobe After Effects:

Step 1: We need to export our 4k or 2k sequence out to a 720 x (size) AVI file. Preferably an uncompressed or 4:4:4 output. In this case:

- In After Effects, click Composition -> Add to Render Queue

- Render Settings -> Best Settings


- Output Module -> Video for Windows, Video Output -> Format Options -> Blackmagic 10-bit 4:4:4, or uncompressed. In this case, we always want the highest quality possible.



- After we select our compressor, we need to be sure to Stretch to the proper resolution, in this case a 720 x (size). This will also depend on our Aspect Ratio, but in this case, all of our films will be in a 16x9 aspect ratio, and this should be true whether we crop for 2.35:1, 2.39:1, 1.85:1.



- In this case our resolution is 720x405. This can cause an issue as all NTSC DVD's need to be 720x480. This I fine, but we'll explain further in the encoding process of how to change this.

- After we have these settings, it is time to Render out the avi file

Step 2: AVI Synth (creating an AVS file for encoding)

Sample AVS file:
http://www.everchangingproductions.com/downloads/tutorials/sample.avs (open this file in Notepad)

- The first step is to identify the properties of our clip, or AVI file. In this case, we have a 720x405 file with an aspect ratio of 16:9 or 1.78:1

- We need to create an AVS Synth file in Notepad.

- Create these lines in notepad:

AVISource("filename.avi")
ResampleAudio(48000)
LanczosResize(720,480)
ConvertToYV12()


- We create: AVISource("filename (or whatever AVI is named, here).avi"). This avs file needs to be saved in the same directory as your AVI file so that this script may find the above referenced file.

- We are assuming that we have audio attached to our AVI file, which in this case may/may not have audio...when exporting out of After Effects, I export out audio anyhow (even though there is none, just habit). So we add the line: ResampleAudio(48000)

- We now have to add LanczosResize(720,480) this will resize our video to fit from 720x405 to the proper 720x480 for NTSC DVD's.

o This setting may be changed depending on our outputted AVI file.

If AVI has a 1.33 aspect ratio (4:3), enter this into AVISynth script:

LanczosResize(720,480)

If AVI has a 1.78 aspect ratio (16:9), enter this into AVISynth script:

LanczosResize(720,480)

If AVI has a 1.85 aspect ratio (Spherical Widescreen), enter this into AVISynth script:

LanczosResize(720,460)
AddBorders(0,10,0,10 )
BorderControl(YBS=10,YTS=10)


If AVI has a 2.35 aspect ratio (Anamorphic Widescreen), enter this into AVISynth script:

LanczosResize(720,360)
AddBorders(0,60,0,60)


We add this incase our AVI source is different than the 720x405 or 16:9 (1.78:1), or 720/405 = 1.78. If our AVI is for example; 720x306, this would mean: 720/306 = 2.35 or 2.35:1 or Anamorphic as shown above. This would mean you would use the line:

LanczosResize(720,360)
AddBorders(0,60,0,60)


- When finished, save the file in notepad to: filename.avs. This file should be saved in the same directory as the AVI File.


Step 3: Bitrate Calculator

- We need to find out what bitrate to set for our AVI file that is going to be encoded to DVD. We need to use the bitrate calculator that can be downloaded above. This program is very straight forward. We set what DVD size we'll be making, either DVD5 (4.3 GB) or a DVD 9 (7.95 GB). These numbers need to be remembered for later when inputting into our encoder.



- From this image we can see that our calculated Bitrate is 6027 kbit/sec for a 1 hour and 35 minute film. We also can see that our max bitrate should be set to 9406 kbit/sec. Also make sure to note the Audio Bitrate. When the "Audio Department" is creating the AC3's for implementation into the DVD authoring program, it is important to note what bitrate was used in calculating. If the bitrate was higher, then the encoding might give files that are too big for implementation onto dvd.


Step 4: Encoding with HCenc


- We now need to open our encoder or HCenc (HCgui_022.exe).

- Now we can input the AVS file that we created in Step 2. We can also set the output for our m2v file. This can be saved anywhere.

- When loading the AVS file, you will notice there is information for movie info:



o We can see from this that our resolution is now correct (720x480) instead of the 720x405 that we started with.

o We want to make sure that the encoder is set to Best, an aspect ratio of 16:9 and since our film is progressive, we'd like to click the 3:2 pulldown option.



o Our last step is to make sure the bitrate is correct. We take the information that we acquired from the bitrate calculator and apply it to the information in bitrate.

o Original:



Now what we calculated above for a 1 hour and 35 minute film with a 384 kbit/sec bitrate audio file, we can replace this information into the bitrate:



o Now we are finished and ready to encode. After encoding, the program will leave us with a .m2v file (encoded DVD file) ready for authoring in Adobe Encore DVD (or any other authoring program).

1 comment:

The Editor said...

Link to HC Encoder homepage is:

http://hcencoder.bitburners.com