• Most new users don't bother reading our rules. Here's the one that is ignored almost immediately upon signup: DO NOT ASK FOR FANEDIT LINKS PUBLICLY. First, read the FAQ. Seriously. What you want is there. You can also send a message to the editor. If that doesn't work THEN post in the Trade & Request forum. Anywhere else and it will be deleted and an infraction will be issued.
  • If this is your first time here please read our FAQ and Rules pages. They have some useful information that will get us all off on the right foot, especially our Own the Source rule. If you do not understand any of these rules send a private message to one of our staff for further details.
  • Please read our Rules & Guidelines

Captain Khajiit's Basic Guide to Encoding with HCenc

TV's Frink

You Catch On Pretty Quick
Staff member
Donor
Faneditor
Messages
23,676
Reaction score
406
Trophy Points
193
*mega-facepalm*

Cap, you were right. I'm still at a loss as to where the typo was, but I tried moving my avi file to the C: root in order to minimize the chance of a typo...and WHAM!!! It worked like a charm.

Thanks guys for all the help, sorry to put you through the exercise. The good news is that this should clear the way for the creation of a genuine DVD-quality workprint of my edit :)
 

Captain Khajiit

Well-known member
Donor
Messages
2,685
Reaction score
8
Trophy Points
48
You're welcome, Frink. Everyone who has ever used Avisynth has come across this initially -- staring at the script and wondering where on Earth the problem lies. Good luck with your encoding!
 

TV's Frink

You Catch On Pretty Quick
Staff member
Donor
Faneditor
Messages
23,676
Reaction score
406
Trophy Points
193
Hmmm, these avs scripts sure are picky.

Today I tried encoding a new file using basically the same script as I got to work last time (only the file name changed). Here is the script:
Avisource("c:\chaptertestmux.avi")
ConverttoYV12(matrix=Pc.601)
And here is the error:
error loading Avisynth script,Script error: expected a , or ) (C:\test.avs, line 2, column 27)
Looks to me like line 2, column 27 is the "6" in "Pc.601" but no idea what the issue is.

Here's what happens if I try to insert a comma or parenthesis either before or after the 6...

Avisource("c:\chaptertestmux.avi")
ConverttoYV12(matrix=Pc.,601)
error loading Avisynth script,Script error: expected function name following `.' (C:\test.avs, line 2, column 25)
Avisource("c:\chaptertestmux.avi")
ConverttoYV12(matrix=Pc.6,01)
error loading Avisynth script,Script error: expected a , or ) (C:\test.avs, line 2, column 25)
Avisource("c:\chaptertestmux.avi")
ConverttoYV12(matrix=Pc.)601)
error loading Avisynth script,Script error: expected function name following `.' (C:\test.avs, line 2, column 25)
Avisource("c:\chaptertestmux.avi")
ConverttoYV12(matrix=Pc.6)01)
error loading Avisynth script,Script error: expected a , or ) (C:\test.avs, line 2, column 25)
:-o

I tried one last thing, removing the matrix part of the script...

Avisource("c:\chaptertestmux.avi")
ConverttoYV12
error loading Avisynth script,No compatible ACM codec to decode 0x2000 audio stream to PCM. (C:\test.avs, line1)
It's worth noting I couldn't remember my workflow from last time (prior to writing the script). What I did this time was render a lagarith avi out of Vegas, rendered a AC3 file out of Vegas, and muxed them together using AVI-Mux.
 

TV's Frink

You Catch On Pretty Quick
Staff member
Donor
Faneditor
Messages
23,676
Reaction score
406
Trophy Points
193
Well, never mind to the second problem. I tried the lagarith avi file with no muxed audio, and hcenc accepted it. However, that's without the matrix part of the second line that I know I used last time. When I add the matrix part back in, I still get the first error message.
 

Captain Khajiit

Well-known member
Donor
Messages
2,685
Reaction score
8
Trophy Points
48
Sorry, Frink. I inadvertently left out the inverted commas in that line of the guide. It should be:

ConverttoYV12(matrix="Pc.601")

I have corrected the typo. Thanks for pointing this out and sorry for the inconvenience. I am usually very careful when proof reading, but as I typed the guide in two bursts after work, when I am usually rather tired, the occasional slip was bound to happen.
 

TV's Frink

You Catch On Pretty Quick
Staff member
Donor
Faneditor
Messages
23,676
Reaction score
406
Trophy Points
193
Thanks Captain, that worked perfectly :)
 

TV's Frink

You Catch On Pretty Quick
Staff member
Donor
Faneditor
Messages
23,676
Reaction score
406
Trophy Points
193
Captain Khajiit said:
6. Encoding Settings

This section will assume that your video has a frame rate of 23.976fps. If it is 29.97fps, then you most likely should have performed an inverse telecine before editing. How to perform an inverse telecine is beyond the scope of this guide, but I might write a very basic guide at some point.

Encoding settings will be organized following those of HCenc's tabs that concern us and the little boxes into which they are broken up. Ignore settings that are not covered: they are fine as they are. The word "checked" obviously means that the radio button in question should be checked (a blue dot in a ring) or the box in question, ticked.

Main

files
input: Select your Avisynth script as your input file.
output: Choose an output filename and destination.
logfile: Choose an output filename and destination.

bitrate
average bitrate: checked
average (kb/s): Input the figure that you received in Section 5.
maximum (kb\s): 8000

profile: best

dc prec: 9

miscellaneous
SMP: checked
scene change: checked
autogop: 12
closed gops: checked
3:2 pulldown: checked

aspect ratio: 16:9 for widescreen or 4:3 for fullscreen (Ignore all the others.)

Settings 1

interlacing options
progressive:checked
TFF: checked
Doing another conversion today, and noticed that when I check 3:2 pulldown in the main tab, I get this message:

pulldown turned on, set flags for 23.976 --> 29.97 fps, interlaced is disabled, if your source is interlaced please de-interlace it first, if input rate is not equal to 23.976, setting is ignored

Normally I ignored this, but today I notice on the Settings 1 tab that under interlacing options, I can't check progressive because it is greyed out. However, if I deselect the 3:2 option on the main tab, I can then check progressive.

Wondering if this is a problem or not. I have uploaded a short sample to MU that I ran with 3:2 option checked, if that would be helpful.
 

Captain Khajiit

Well-known member
Donor
Messages
2,685
Reaction score
8
Trophy Points
48
TV's Frink said:
Wondering if this is a problem or not.

It is not a problem. You are right to ignore that message. On my GUI, the section with the progressive radio button is checked, but the whole section becomes greyed out when I check the 3:2 pulldown option. I suppose that when I was typing out the settings to write the guide I did not have the 3:2 option checked, but it does not really matter. When you hit Encode, you should see interlaced: no on the display; if so, all is well.
 

TV's Frink

You Catch On Pretty Quick
Staff member
Donor
Faneditor
Messages
23,676
Reaction score
406
Trophy Points
193
My PC is busy rendering out a huge-o file, but once it is done I will try to encode and see if it gives me the correct message. Thanks for the help as always :)
 

TV's Frink

You Catch On Pretty Quick
Staff member
Donor
Faneditor
Messages
23,676
Reaction score
406
Trophy Points
193
Captain Khajiit said:
bitrate
average bitrate: checked
average (kb/s): Input the figure that you received in Section 5.
maximum (kb\s): 8000
If I get a number higher than 8000 from the bitrate calculator, should I lower my average to 8000, or increase the maximum?
 

Captain Khajiit

Well-known member
Donor
Messages
2,685
Reaction score
8
Trophy Points
48
TV's Frink said:
If I get a number higher than 8000 from the bitrate calculator, should I lower my average to 8000, or increase the maximum?

You do not need an average bitrate anywhere near that high. I suspect that you are encoding an extra. Bear in mind that by default the bitrate calculator is set to DVD-5 size and will assume that you are encoding a video to fit that size minus the author overhead. If so, work out how much space you have on the disc after you have added the main feature and accounted for menus and other extras, and input a custom size into the bitrate calculator. Alternatively, HCenc will allow you to input a custom file size; you do this by going to the Main tab, looking under bitrate, checking the file length radio button and inputting a figure in kilobytes.

If you really are trying to put an extremely short video onto a DVD-5, use 5000kbps. It should be sufficient.
 

TV's Frink

You Catch On Pretty Quick
Staff member
Donor
Faneditor
Messages
23,676
Reaction score
406
Trophy Points
193
Actually, I'm trying to encode the main feature for a DVD-9. The bitrate calculator is giving me 8600 for a 2 hr movie.
 

Captain Khajiit

Well-known member
Donor
Messages
2,685
Reaction score
8
Trophy Points
48
In that case, I would use 5500.

EDIT: You can increase the maximum to 9000 if you so wish.
 

TV's Frink

You Catch On Pretty Quick
Staff member
Donor
Faneditor
Messages
23,676
Reaction score
406
Trophy Points
193
So confused....

Ok, let me start over now that I'm actually sitting in front of the calc.

Video Length: 1 hr 57 min
Type: DVD
DVDs: 1 x 7.95 (DVD9) GB
Audio Bitrate: 448 kbit/s

Calculated Bitrate: 9038 kbit/s
DVD Max Bitrate: 9341 kbit/s

So...wouldn't I enter an average bitrate around 8900 or so into HCenc? And a max of 9400?
 

ThrowgnCpr

awol
Staff member
Messages
15,090
Reaction score
36
Trophy Points
133
older DVD players often have issues with bitrates over 8000 kbps. You should always keep bitrates under this. I generally set my max to 8000, and the avg to whatever my calculator comes up with, or if it is calculated over 8000, i go something just under 8000.
 

TV's Frink

You Catch On Pretty Quick
Staff member
Donor
Faneditor
Messages
23,676
Reaction score
406
Trophy Points
193
Thank you good sir.
 

Captain Khajiit

Well-known member
Donor
Messages
2,685
Reaction score
8
Trophy Points
48
TV's Frink said:
So confused....

There is no need to be confused. You set the average bitrate to 5500 and the maximum to 8000. The average bitrate calculation in the guide is to help you fit the video onto a disc, but because you have plenty of space on the disc and seem to be filling it with one two-hour video you are being given very high figures. There is absolutely no point in doing a VBR encoding with your average bitrate set so close to the maximum bitrate, and HCenc has been known to experience problems with this sort of situation.

The 8000 maximum was indeed an old rule of thumb. I put 8000 as a limit because the guide is only a basic guide and it helps video to compress to a DVD-5. DVD players are required to play streams of up to 9800kbps for video, so the fact that a few early players were non-compliant would not compel me to cap my bitrate at 8000 if I were purposely trying to fit a movie on to a DVD-9 in high quality, which is what you seem to be doing. In your situation, I would use a DVD-5 unless your extras are extensive, but if you do use a DVD-9, my recommendation would be to use a maximum bitrate of 9000.

EDIT: I shall update the guide when I have a chance, to make this clearer.
 

TV's Frink

You Catch On Pretty Quick
Staff member
Donor
Faneditor
Messages
23,676
Reaction score
406
Trophy Points
193
Ok, this is what is going on:
http://www.fanedit.org/forums/showt...les-in-Size-When-Imported&p=126511#post126511

I'm trying to squeeze every drop of quality into the file before DVD Architect takes some back. And incidentally, I tried average 7950 and max 8000 last night, and I ended up with a 6 GB file, instead of the 8 GB file I expected...so If I used 5000 and 8000, wouldn't I end up with a lower quality video? It certainly ends up smaller...
 
Top Bottom