Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > MPEG-2 Encoding

Reply
 
Thread Tools Search this Thread Display Modes
Old 22nd July 2010, 19:53   #1  |  Link
sebazvideo
Registered User
 
Join Date: Sep 2009
Posts: 83
HCEnc CPU usage very low

I'm trying out HCEnc for DVD encoding because I want to find something as good as x264 is for h.264. I downloaded both the 0.24 beta and 0.23, but in both the CPU usage when encoding is very low, and the encoding is extremely slow, taking about an hour for a 21 minute clip. My system has an AMD Phenom II 1090T 3.6 Ghz CPU (6 cores) and 16 GB of DDR3 1333 Mhz RAM, so it should go much faster than this. The source file is an AVI in the Lagarith codec, RGB24 color space, 1920x1080-60i and the Avisynth script is this:

AVISource("filename.avi", audio=false)
AssumeTFF()
ConvertToYUY2(interlaced=true, matrix="pc.709")
Spline64Resize(720,480)

Basically a variation of the script I use to encode to h.264 using x264, with the change of YUY2 instead of YV12 (but I tried YV12 and it's the same thing) and the resize to 720x480 because it's for DVD. I tried using more basic resizers but it didn't make a difference in CPU usage.

In HCEnc the CPU is set to auto, SMP is selected, priority is set to normal (I set it to high and it didn't make a difference). I saved the INI file and this is what it shows:

*BITRATE 9000
*MAXBITRATE 9000
*FRAMES 0 37666
*AUTOGOP 18
*DC_PREC 10
*CHROMADOWNSAMPLE 1
*1PASS
*INTRAVLC 2
*MATRIX mpeg
*PRIORITY normal
*CHROMAFORMAT 422

Is this program supposed to be this slow, or is it something else?
sebazvideo is offline   Reply With Quote
Old 22nd July 2010, 23:31   #2  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
How many fps are you getting with the script alone?

Edit: You can use this tool to measure the fps.

Last edited by Groucho2004; 22nd July 2010 at 23:33.
Groucho2004 is offline   Reply With Quote
Old 23rd July 2010, 11:15   #3  |  Link
pandy
Registered User
 
Join Date: Mar 2006
Posts: 1,049
For DVD i think it should be like this one:
AVISource("filename.avi", audio=false).BilinearResize(Last.Width(),Last.Height()/2).Spline64Resize(720,480).ConvertToYV12(matrix="PC.601", Interlaced=False)

For speed testing maybe use this one:
ColorBars(1920,1080).KillAudio().Trim(0, -1).Loop(37667)
#or ColorBars(1920,1080).KillAudio().Trim(0, 37666)
BilinearResize(Last.Width(),Last.Height()/2).Spline64Resize(720,480).ConvertToYV12(matrix="PC.601", Interlaced=False)
pandy is offline   Reply With Quote
Old 23rd July 2010, 20:20   #4  |  Link
sebazvideo
Registered User
 
Join Date: Sep 2009
Posts: 83
Quote:
Originally Posted by Groucho2004 View Post
How many fps are you getting with the script alone?

Edit: You can use this tool to measure the fps.
With the script I typed in the first post, using avsinfo, I'm getting 10.58 fps and decreasing with each update, at around 6%. Also, CPU usage is very low, around 25%. I guess it wasn't much a HCEnc problem as it was either Avisynth's, or the codec's fault.

If I change the script to LanczosResize, it's about the same. I wish I could find a way to make it work, but so far the file that I encoded (which took over an hour for 21 minutes of footage), doesn't even play. I authored a DVD to compare the same footage output from Sony Vegas and the one from HCEnc, and the latter doesn't play at all in neither my blu-ray player nor the computer, while the Vegas encoded stream plays fine in both.
sebazvideo is offline   Reply With Quote
Old 18th November 2011, 09:38   #5  |  Link
Rush_iam
Registered User
 
Join Date: Nov 2009
Posts: 8
Same problem. My CPU usage is about 20-30%. Using lagarith codec input.
Any ideas how to fix it?
Rush_iam is offline   Reply With Quote
Old 18th November 2011, 11:43   #6  |  Link
TheSkiller
Registered User
 
Join Date: Dec 2007
Location: Germany
Posts: 632
Are the source file (Legarith) and the m2v MPEG2 that is to be encoded on the same physical hard disk drive? Maybe that's the bottleneck, especially with very fast CPUs. In such case the CPU has to wait periodically for the HDD to finish writing/reading before it can go on.
It would help a lot if you made an intermediate Legarith file that is processed and ready for DVD encoding.


Oh, and, the common mistake, you should resize to 704x480, you can't just use 720 without taking PAR into calculation. The easy way, just use 704 and encode at 704, it is perfectly DVD compatible (allowed by the spec) just like 720 is and will yield 100% correct aspect ratio.

If your source really is interlaced (not just flagged interlaced) then you have to be careful, you want to keep the interlacing when going to DVD. Resizing the HD video down to DVD without bobbing and reinterlacing will destroy the interlacing and blend the fields!

Last edited by TheSkiller; 18th November 2011 at 11:50.
TheSkiller is offline   Reply With Quote
Old 18th November 2011, 15:53   #7  |  Link
Rush_iam
Registered User
 
Join Date: Nov 2009
Posts: 8
Thank you for your reply, TheSkiller.
I always encode using different HDDs for source and target files so it should not be bottleneck.
My source files are interlaced Widescreen PALs 720x576, 1440x1080 or 1920x1080. In .avs I don't use any filters except input line and AssumeTFF() and I don't resize height so I keep correctly interlaced frames.

I am encoding with HCEnc for a half a year and I always like render quality. But I'd never seen full cpu usage and I always though that HCEnc is bad with multithreading.
TheSkiller, please, check your CPU usage while encoding and tell me.
I've tested it on 4-threaded Athlon II X4 and got 30-40% CPU usage, on 8-threaded Core i7 I get only 20-30% CPU usage
Rush_iam is offline   Reply With Quote
Old 18th November 2011, 20:34   #8  |  Link
Taurus
Registered User
 
Taurus's Avatar
 
Join Date: Mar 2002
Location: Krautland
Posts: 903
On old Intel Core2Duo 6600
Processor:
For all 4 Cores:
75% on 1pass
85% on 2pass

OnePassVBR:
25% on analizing
85% on final encode

To lossless File:
55% for lossless file
about 80% for final encode

This is with HCEnc 0.25
From Lagarith-ver1326 720x576/25fr/sec file.
Everything else running in the background (Antivirus/etc.)....

Avisynth 2.6 MT (No MT on this test) (With MT slightly faster on all settings)
Script:

AVISource("Test.avi") # progressive, no interlaced file at hand.

Make sure Lagarith is doing the decoding for you.

FFVideoSource("Test.avi") is slightly slower on my side.

Did you try UTVideo as the encoder for your source files?
It's faster for encoding and decoding on my side.

What bitrates your encoding to?

Last edited by Taurus; 18th November 2011 at 21:07. Reason: MT explained
Taurus is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:32.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.