Log in

View Full Version : possibly jerky encoding? (due to blended frames it seems)


Data
20th March 2004, 14:00
Hi,

here's number three in the TNG encoding test series of AutoGK ;)
No matter what I try in AutoGK (resolution, DivX, XviD, etc.) I can't get a smooth avi output, the playback of that scene is always jerky. (they use a fast camera pan in this scene)
Using DrDivx I am able to get a smoothly playing avi file.

Here you can download a test avi file and also the original VOB input files (for comparison and/or for AutoGK encoding):
http://mitglied.lycos.de/datasoong/jerky.html

I'd appreciate any help on this ;)
Thx in advance.

PS: Another thing, what's the recommendation on the "support for ess based standalones" option at AutoGK installation (that changes the matrix)? I don't currently have an external player, but am planning to get one sometime later this year. (maybe a kiss player or so)

jggimi
20th March 2004, 14:30
At first, I thought it might have been one of the dreaded hybrids. But I downloaded your fragment and didn't see any difficulty with it, per se.

So I encoded it with DivX (using GK) and didn't have any trouble.

So for the first time, I installed AutoGK and ran your fragment through it. I used XviD, 100% Quality.

I saw hesitation/jerkiness with BSPlayer ... but none whatsoever with Media Player Classic. You might want to test your stuff with different players, to see if that's your trouble.

Thanks for having me install AGK!

Data
20th March 2004, 15:01
Hi jggimi,

thanks for testing (and sorry you had to install AutoGK as "Thanks for having me install AGK!" was meant sarcastically, I'm affraid :()

I'm already using classic Media Player 6.4. One possibility would be my CPU, it's just a 1,4 GHz Pent4mobility, but I haven't had jerky playback with any other videos so far. (the graphic card seems do do quite nicely [ati 7500]). But even if it was the CPU, lowering the resolution (i.e. by half) should at least solve that (which it doesn't). On another system (An older CPU, a Pent3 but with a GeForce4 TI 4200, where playback is usually super-smooth thanks to the GPU, I also get this jerky playback [but only in this szene]).

What kind of system do you have?

manono
20th March 2004, 16:16
Hi-

Nah, he wasn't being sarcastic.

I may be able to fix the jerky play for you. Open one of the episodes in VDubMod. Set Video to Direct Stream Copy. Then go Streams->Stream List and you'll see the audio listed. Then right-click on the audio and and set Preload for 96 ms. Set Interleaving for 96 ms (not frames). And if you remember the delay, or still have that the streams list that DVDDecrypter gave you, or the original audio file, then set that also. Then OK your way out of there, and go File->Save as... and give it another name. Wait a minute or so, and then test it out.

And if you step through that scene, you'll see it's filled with blended frames. Evidently the TNGs for PAL are garbage. You might want to try out Restore24 on them sometime. You can find info about it in the AviSynth forum.

manono
20th March 2004, 16:20
About the ESS chipset option-

DVD/MPEG4 players with the ESS chipset don't support the XviD Matrices that AutoGK uses. So by installing AutoGK with that option, it uses different Matrices, and the resulting .avi's play fine. Otherwise they look real bad. This is only true for units with the ESS chipsets. Others with either the Sigma Designs or the MediaTeq chipsets don't have the problem. I think it can probably be fixed with a firmware upgrade.

Data
20th March 2004, 17:01
Originally posted by manono
I may be able to fix the jerky play for you. Open one of the episodes in VDubMod. Set Video to Direct Stream Copy. Then go Streams->Stream List and you'll see the audio listed. Then right-click on the audio and and set Preload for 96 ms. Set Interleaving for 96 ms (not frames). And if you remember the delay, or still have that the streams list that DVDDecrypter gave you, or the original audio file, then set that also. Then OK your way out of there, and go File->Save as... and give it another name. Wait a minute or so, and then test it out.
I think it has increased the smoothness slightly, but not much :(


Originally posted by manono
And if you step through that scene, you'll see it's filled with blended frames. Evidently the TNGs for PAL are garbage. You might want to try out Restore24 on them sometime. You can find info about it in the AviSynth forum.
You're right, that's the cause. When I look at the DrDivX encoded file again, I almost see none of these blended frames. Looks like they already removed them with an algorithm. The AutoGK avi is filled with these blended frames.

Well it's becoming more and more evident, that I have to switch to GK in order to get the results I need. (so much for my need to have a "simple" tool for the job LOL)

I'm still somewhat overwhealmed by the info on the restore24 thread, I think I'm gonna figure it our eventually, but where do I get the dlls they use in the scripts:
loadplugin("C:\x\masktools141.dll")
loadplugin("C:\x\kerneldeint140.dll")
loadplugin("C:\x\avisynth_c.dll")
loadplugin("C:\x\smartdecimate.dll")
loadplugin("C:\x\mpeg2dec.dll")
loadplugin("C:\x\unfilter.dll")
loadplugin("C:\x\sangnom.dll")

mpeg2dec.dll & tomsmocomp.dll I found (in my GK directory)

Thanks again ;)

jggimi
20th March 2004, 17:39
No, I wasn't being sarcastic. I'd needed a reason to install it; you provided me with one.

Data
20th March 2004, 17:41
glad to hear that ;)

therealjoeblow
20th March 2004, 18:00
Originally posted by Data
Hi,

here's number three in the TNG encoding test series of AutoGK ;)
No matter what I try in AutoGK (resolution, DivX, XviD, etc.) I can't get a smooth avi output, the playback of that scene is always jerky. (they use a fast camera pan in this scene)
Using DrDivx I am able to get a smoothly playing avi file.



Appears to be the same problem as I reported with the Red Violin here:

http://forum.doom9.org/showthread.php?s=&threadid=65985&perpage=20&pagenumber=7

len0x is (hopefully) looking into the deinterlace/IVTC routines for hybrid material.

manono
20th March 2004, 18:16
Hi-

If you didn't see the blends in the Dr. Divx avi's, then maybe it's something in AutoGK that's causing it. I don't know much about how it treats PAL DVDs, though. That same scene in a Dr. Divx encoded .avi didn't have those blends? Or did you encode a different episode? But any panning scene should display the same thing if the DVDs came from a bad NTSC to PAL conversion.

If you have the latest GKnot, then you also have the KernelDeInt.dll. You can get Sangnom here (http://atlas2.tgv.net/~media-video/forum2/download.php?id=244). You can get the rest here (http://www.avisynth.org/warpenterprises/).

But before going through all that, I'd first make sure that TNG is really full of blended fields from the conversion from NTSC, and not from something that AutoGK did. Just run a SeparateFields() on it and check.

Data
20th March 2004, 18:20
Hi manono,

again thx for your help. I got all files except one:
avisynth_c.dll

Can't find it on the avisynth filter page (since I don't know its real name :)) Right now I'm only getting a "overlay" function not found :)


I think the blends are in the RC2 pal dvds :( AutoGK just keeps them 1:1 (whereas DrDivx removes them somehow).

PS: Can you test the VOB I provided for these "blends", I think I see them, but I'm not sure if that's exactly what you mean (the effect I get is something like 2 frames intertwined)

manono
20th March 2004, 18:33
Hi-

The AviSynth_C.dll comes as part of the SmartDecimate package. They go together. Now to download the vob and check it out. I'll be back.

Edit-Yes, that vob is a mess. Restore24 should work on it, but since I'm not in PAL land, and have never used it, I can't help you. Interestingly, Unblend worked pretty well on it, and got rid of all but a few blends:

KernelBob(4)
Unblend()
Decimate(4).Decimate(3)

You can get Unblend at WarpEnterprises' page to which I linked before. And you can learn how to use KernelBob here (http://forum.doom9.org/showthread.php?s=&threadid=66093&highlight=KernelBob).

Data
20th March 2004, 20:00
Thx again,
I've been at this for the last couple of hours (my head is starting to spin), question: what plugin do I need for AVISynth 2.5x to recognize Decimate()? (right now it sais unknown function)

Thanks!

manono
20th March 2004, 20:10
Oh, sorry-

Decimate is part of Decomb. Load the Decomb.dll (it's in GKnot), and you then have access to Telecide, Decimate, and FieldDeinterlace.

my head is starting to spin

But just think how much you're learning. :)

Data
20th March 2004, 20:31
testing...

scharfis_brain
20th March 2004, 20:52
you should give restore24 a try.

It works very good on removing blends of a NTSC -> PAL conversion.

Data
20th March 2004, 23:48
Hello scharfis_brain,

I've been trying to get a good result with restore24 and also with your modified version of the Restore24/bobmatcher version of the script for the last I don't know many hours :). When using the normal restore24 the video still looks interlaced at some frames (and it still "jerks around" like hell [it's like its skipping important frames].

Then I tried your restore24/bobmatcher modification, the trouble there was that it used the function overlay (which doesn't exist in AviSynth 2.5x), i.e.:
outnomatch = overlay(out2,out1,opacity=0.5,mode="blend")
In the post it said that you later replaced that with the function "layer" but it doesn't say exactly how. So I used the following line (not sure ir that's correct):
outnomatch = layer(out2,out1)

When using this code the video looks nice (no more interlacing, etc.) - but I still get the jurky playback. When lookang at each frame 1 by 1 in VirtualDubMod every frame looks perfect (no more blended ones exist). But in playback it's just far from smooth playback :(

(in DVD2AVI I selected Video/Field Operation/None and then just saved it as a 1.76 projekt - I hope that was correct).

Another interesting thing is that when I just deinterlace the file, i.e. using:
loadplugin("c:\x\mpeg2dec3.dll")
mpeg2source("project.d2v",cpu=4,iPP=true)
converttoyuy2(interlaced=true)
SeparateFields()
bicubicresize(640,512)
and then simply encode this "full of blended frames" avs-input file in GordianKnot, the resulted file has no jurky playback problems whatsoever! (I used XviD & 2pass)

Frankly, I'm at a complete loss here.
1)AutoGK outputs a jurky file, which still has blended frames
2)DrDivX outputs a smooth file, with almost every blended frame removed
3)GK using restore24.avs outputs a jurky file that's partly interlaced
4)GK using restore24bobmatcher outputs a jurky file, with every blended frame removed

and now this:
5)GK using deinterlace.avs outputs a smooth playing back file, even though it's still filled with blended frames

??!??!

I've uploaded my test scripts plus the d2v file / the VOB file is also available there:
http://mitglied.lycos.de/datasoong/jerky.html

I'd appreciate it if you could take a look. I've spent hours and hours and hours on this without getting a decent result. :(

Thanks a lot!

scharfis_brain
21st March 2004, 00:19
I don't know, what you're doing wrong.

I've converted the VOB-File using DVD2AVI (NO forced Film)
to a D2V-Project.

then I used this script:


loadplugin("masktools.dll")
loadplugin("smartdecimate.dll")
loadplugin("kerneldeint.dll")
loadplugin("tomsmocomp.dll")
loadplugin("mpeg2dec.dll")
loadplugin("mpeg2dec3.dll")

import("bobmatcher.avs")
import("restore24.avs") # be sure that this file only contains my modified restore24.

mpeg2source("tng.d2v")
restore24(tomsbobsoft(),bobmatcher())


that worked nice on my PC.


EDIT:
When using this code the video looks nice (no more interlacing, etc.) - but I still get the jurky playback. When lookang at each frame 1 by 1 in VirtualDubMod every frame looks perfect (no more blended ones exist). But in playback it's just far from smooth playback
This script is not able to play in realtime!
You have to encode a snipplet of your video to a file.
Only this file can be judged about smooth movement at playback...

Data
21st March 2004, 00:30
when I use your exact lines I get:

[i]crop: "YV12 images can only be cropped by even numbers (bottom)"
(bobmatcher.avs, line 7)
(test.avs, line 12)

:(

Can you please send me your bobmatcher.avs & restore24.avs file?

This script is not able to play in realtime!
You have to encode a snipplet of your video to a file.
Only this file can be judged about smooth movement at playback...
I know! ;) I always used GK and fed it with the avs input file, and the resulting avi file was what I described as smooth or jerky ;)

scharfis_brain
21st March 2004, 00:40
oh, forgot to place

[b]converttoyuy2(interlaced=true)[b]

between mpeg2source & restore24

please do not feed your script to GK.

just open it with VDub and then do a encode with mjpeg or something similar.

Data
21st March 2004, 00:59
Ok, it run's now, but I get the same result (jurky / jumpy video).
This time I opened it in VirtualDubMod and saved it as an XviD avi (also tried MJPEG, uncompressed AVI - all with the same jumpy result).

Just to make sure, I then also went specifically low with the resolution (by using "bicubicresize(320,256)" at the end), so it can't be a CPU performance problem during playback.

You say it worked fine for you, please be so kind as to send me your tng.d2v project file & the two avs files (that are used in the "import"). Thx!

Data
21st March 2004, 01:17
Here's an example of the encoded video file:
http://mitglied.lycos.de/datasoong/jump1.jpghttp://mitglied.lycos.de/datasoong/jump2.jpg

That's from one frame to the next (it's like it's missing lots of frames in between) - so it does look jumpy/jerky during playback too :(

scharfis_brain
21st March 2004, 01:21
If you do not receive any errors while using the functions (AVS-files), they are identical with mine ones.

It is useless to send you the D2V-File because it refers to my Folder-Structure. Even moving a d2v-file to another folder will result in failing when trying to open it.

How heavy is the jerkyness you have to deal with?
(how often every x frames??? )

some skips or dupes are normal with restore24.
It is far from perfect but gives good, whatchable overall-results.

Data
21st March 2004, 01:36
The skipping happens 4 times in my short clip:
frame 59->60
frame 83->84
frame 107->108
frame 131->132

Exactly every 23 frames (just checked it).

scharfis_brain
21st March 2004, 02:17
okay.

there are not much things to do against this for now.

1) try mpeg2source("x.d2v",cpu=4,ipp=true)

2) crop away ALL black borders & lines surrounding the video.

either you're accepting the stutters restore24 is producing or you'll have to do an interlaced backup.

manono
21st March 2004, 03:57
I didn't encode with that script I gave you before using Unblend. I just stepped through the .avs in VDubMod. It looked smooth, and had only a few blends left in it. So you might give that one a try. Maybe there's something peculiar about that series, as after coming out of Unblend, but before Decimation back to 25fps, there were 2 original frames, followed by 2 duplicate frames, which I thought strange.

To do it easily and fast, just open the .avs in VDubMod, set Video for Fast Recompress, and then go Video->Compression->XviD->Configure->Encoding Mode->1-pass quantizer 3, and then save it to avi.

Edit: I just encoded it following that script, and I thought it played smoothly and looked good. I don't know how the rest of the episode will do, and it'll probably make the CGI parts play jerky, but hybrids, especially NTSC hybrids converted to PAL, are tough to encode perfectly anyway. I used this script:

LoadPlugin("F:\DivX Stuff\GKnot\2.5Plugins\Mpeg2Dec3.dll")
LoadPlugin("F:\DivX Stuff\GKnot\2.5Plugins\KernelDeInt.dll")
LoadPlugin("F:\DivX Stuff\GKnot\2.5Plugins\Decomb510.dll")
LoadPlugin("F:\DivX Stuff\GKnot\2.5Plugins\Unblend.dll")
mpeg2source("D:\Server Downloads\Upload\input3\test.d2v")
crop(20,4,692,568)
kernelbob(4)
Unblend().Decimate(4).Decimate(3)
LanczosResize(640,480)

scharfis_brain
21st March 2004, 12:35
What the hell is going on here?!?

Please tell me exactly, where this sample comes from!

It is totally atypic for a NTSC -> PAL conversion!

It seems ,that a PAL-Speedup has been done with TNG but every other field is a blend of its neighbors.

this means the resulting framerate after unblending has to be 25fps instead of 24fps.

I found out that

kernelbob(5).selectodd() worked wonders on this sample.
But I doubt it would work an the whole thing, because of pattern changes.

You can modify restore24 to output 25fps (so call it restore25).
This can easily be done changing the line

smartdecimate(24,50,......... )
to
smartdecimate(25,50,......... )

within the restore24.avs - file.

Please tell me, which Episode this sample is from (with number).
I have a lot of self-recorded VHS-Tapes of TNG, so I want to compare your blending-type with the one on my PAL-Tapes.

Data
21st March 2004, 13:48
Hi scharfis_brain ;)

The scene is from the first ever TNG episode 1x01 (the pilot "Encouter at Farpoint").
RC2 DVD, Chapter 3, Time index 0:10:48 - 0:11:01

It was ripped using DVDDecrypter (I ripped only chapter3), and for the test sample you downloaded I cut 9MB out of that chapter 3 using VobSplit 2.6 (I know a crude method, but at if you ignore the begining and the end of the sample the rest should be 100% in tact).

So far this scene (with the fast camera pan) has been the only one giving me such problems (i.e. with smoothness in AutoGK).

scharfis_brain
21st March 2004, 14:18
Okay, the solution I gave you should work.

So I assume the other (non-effect) scenes are full progressive?

Then You should only restore the problematic scenes. Leave all other scenes untouched.

I now have an idea why this scene is blended.
(Found that Tape myself)

before and after this scene there are effect scenes that need another treatment, when converting to PAL than normal non-effect-scenes.

But the converter-machine didn't do the Pulldown Fallback (the one that creates progressive frames) between both effect-scenes. This resulted IMO with this blended scene.

Data
26th March 2004, 21:12
Hi scharfis_brain,

finally got around to testing it ;)
Your restore25 solution works perfectly, thank you!

As fot the other frames all being progressive, I'm not quite sure about that, I think some scenes might still have non-progressive or even blended frames.

Can one run the restore25 script over the entire episode, or would that possibly damage/compromise good/non blended frames?