Log in

View Full Version : Encoding speed


Suchy
26th March 2006, 12:33
Hi.
I think that I have a promblem with encoding speed.

Video
duration: 0:23:11
resolution: 640x480
FPS: 23.976

AVISynth script:
# PLUGINS
LoadPlugin("E:\Codecs\AviSynth 2.5\Convolution3d.dll")
LoadPlugin("E:\Codecs\AviSynth 2.5\FluxSmooth.dll")
LoadPlugin("E:\Codecs\AviSynth 2.5\VSFilter.dll")

# LOADING
a=avisource("E:\Encoding\file1.avi").Trim(0,3164)
b=avisource("E:\Encoding\file2.avi")
c=avisource("E:\Encoding\file1.avi").Trim(5587,34351)

# JOIN
a+b+c

# FILTERING
TemporalSoften(3,5,5,scenechange=10)
Convolution3D("movieHQ")
FluxSmoothST(7,7)

# SUBS
TextSub("E:\Encoding\subs.ass")

XviD settings (not mentioned options are disabled):
- AdaptiveQuantization
- BVop 2 - 1,5 -1
- Matrix h263
- 2 pass (without turbo)
- Cartoon Mode
- Chroma optimizer
- Chroma motion
- VHQ 4
- VHQ for B
- Motion Search 6
- Frame Drop 2
- KeyFrame 239
- quant ranges 2-31
- Trellis

Automatically detecd optimalizations enabled both in VirtualDub 1.6.14 and XviD 1.1.0 final

Configuration:
AMD64 2800+ (1,8 GHz)
1,5 GB Ram DDR 400
GF6600 GT AGPx8
WinXP SP2
chipset nForce 3 (drivers installed)
harddrive: 7200 rpm UDMA 6 - 133

Encoding speeds:
1st pass: 0,3-1,4 fps (about 13h)
1st pass without filtering: 21 fps


Tell me if it's normal situation, please.


P.S.
I don't know if problem is with XviD, if VD, if AViSynth that's why I don't know where I should write this post.

foxyshadis
26th March 2006, 13:21
For the filtering you're doing it's absolutely normal for this to happen, those are slow filters (and pretty heavy ones, but if you like the effect that's up to you). Do a lossless pre-encode (this can be true lossless via huffyuv/lagarith, or near-lossless with xvid custom matrices and q2) to overall speed things up.

Suchy
26th March 2006, 13:27
I thought about losless encoding, and later reencoding to XviD.
Thanks. I do as you advice me.

P.S.
I know that these filters are heavy, but result is exactly what I needed.

P.S.S.
21 fps without filtering is normal too?

Didée
26th March 2006, 19:06
An encoding speed of ~1fps with that config & script seems way too low for me. The used filters are not that heavy. *Exept* for, perhaps, TextSub(). Never used that in all those years, and have no clue how much time this one is eating.

If you just open the script in VirtualDub and play it there, what FPS are you getting?

sysKin
26th March 2006, 23:11
- 2 pass (without turbo)

If by that you mean "full quality 1st pass" (which is different than "Turbo", that's an ME option) then 21fps is completely reasonable.

foxyshadis
27th March 2006, 01:55
Textsub on really complex karaoke can really kill a script. Not as badly as AE karaoke, so okay, 1 fps does seem a bit low, but I've seen it happen. So if he can pinpoint it to something besides the textsub, then maybe we have a problem.

Suchy
27th March 2006, 16:17
@foxyshadis: There is dialogs text mainly. Sometimes simple Effect. At the end is karaoke, but isn't complicated.

@Didee: FPS during play dub in VD (play a AVS script) is faster: 1,5 - 4 FPS

@Syskin: But similiar situation is during 2nd pass (compression time: about 14h)
Without turbo - unchecked "turbo" in More->Motion Precision

Suchy
29th March 2006, 11:02
I previosly joined files via AVISynth and saved as 1 file compressed in HuffyUV. Later I filtered this and saved in XviD.

It was more firmly quickly (about 4h for save in huffy + filtering + 1st pass Xvid + 2nd pass Xvid) than before (about 13h for 1stpass + about 14h for 2nd pass).


Source->join->save to huffyuv->filtering->save to 2pass Xvid
time: about 4h (all)

Source->join->filtering->save to 2pass Xvid
time: about 27h (all)

Where is problem? Theoretically there is more operations in first situation.

foxyshadis
29th March 2006, 12:29
Actually, theoretically it's less, when you break it down like:

source->filtering->huffyuv
huffyuv decode->xvid 1st
huffyuv decode->xvid 2nd
vs
source->filtering->xvid 1st
source->filtering->xvid 2nd (see, you run the filtering twice)

Sometimes, the huffyuv overhead actually does slow it down (using a near-lossless xvid is much faster in this regard), but if there's a lot of filters it's a big improvement.

Nonetheless, are we comparing the same video here? I mean, 4h vs 27h seems like a trick question otherwise... and you can't expect useful results comparing entirely different filter chains (sounded like you needed a lossless pre-encode a lot more on the second one). If it is, there's definitely a problem somewhere. Maybe something's using up a lot of extra cpu on your system your second test?

Suchy
29th March 2006, 17:05
err.. right..
I didn't notice that source is filtering 2 times when I use XviD 2pass.

But even now I have 13h (Xvid -> Xvid only one pass of two) vs 4h (huffyuv->Xvid 2 pass together). It's werid.

I've checked this in recovery mode of winXP and results are the same.

I can't find any thing which cause this slow encoding.
I try search again.

Thanks

P.S.
I wonder if YV12->huffy RGB->YV12 converted in AVS is more losless than YV12->huffy YV converted in huffy or YV12->Xvid near losless (all frames quant min1 - max1)

foxyshadis
29th March 2006, 18:11
q1 is NOT near lossless, unless you use a correct matrix (6of9 or eqm ehr), and then you should use Quant 2 unless you have a few extra gigs to fill.

RGB anywhere in the chain is lossy. Stick with YV12 throughout if possible.

Suchy
29th March 2006, 19:59
Allright! I will remember that.
Thanks

EDIT:
I found something.

When I join sources (even two: a+b or AVISource+AVIsource - doesn't matter) before filtering and rendering subtitles, encoding takes about 27 for 2 pass (together).

When I load only one source (exactly the same duration and almost (98%) identical content) and filtering this and rendering subs in the same way as below, encoding takes 4 hours or less (2 pass together).