![]() |
One question:
I have encoded a sample with this "ping/Pong" stuff. When I play the sample with the Media Player, there's a message in grey letters that says: "Offset set to: 0 sec. (Offset intervall should be: 0 sec. / 49 sec.)" Is that OK, or this an error ? |
Quote:
49 sec is the offset for a "pong" pass. When you go to encode, you must unable slicer function first, and no message will sowed. |
Slicer has been updated ...
look here for the new Version: http://www.kvcd.net/forum/viewtopic....15775&start=16 |
Hi Andrej :D,
Thanks for updating the original thread (as per my request :)). I have already tested it at home and I gotta tell you: I love it. BTW, has it gotten any faster than the older release based on sampler()? I'm saying this because I did a small test with (1,15,3,"ping") and it was ~15 seconds faster than the older one with the same parameters. Or maybe it has something to do with the older version having the subtitling feature? I had "subs on" when I encoded the sampler() based sample. I was using HC Encoder v0.14beta with a simple Mpeg2Source() and your function. Have you done any speed testings yourself between both versions? Cheers pal |
Thanks Inc for updating your excelllent Ping-Pong prediction tool, I use this in my scripts when I do manual conversions and have had great results I like to look of the new version and no need to have sampler any more, I can't wait to run some tests with it. :)
|
The new one does use the avisynth's internal SelectrangeEvery() command. Maybe thats the reason why a little speedup occures :) ... as the external call to sampler.dll is not more done. So it seems that SelectrangeEvery() is faster than Sampler().
The subtitles aren't needed anymore. In the old version it showed you how the offset has to be set manually, but now this will be done automatically when the script recognises the "pong" string in the slicer() command. So no more Subs needed. I got an extended slicer() Version of the latest release where ALL specs are shown in subtitles for testing, like OrigFramecount, SlicedFramecount, PercentOfMovie, Ping or Pong ... etc .... but who cares. :lol: |
We care. :D
|
Quote:
I'm guessing it could be the subtitle() too but I'll tell you later. Quote:
Quote:
We do care. It could be very usefull to store ilustrated test runs with different settings. That way we could easily recall the basic settings we used on a test run. Cheers |
Here it is .... but this is a subtitled one and it's NOT configurable, means I used it for testing and to proof that 2% in the command got real 2% of the framerate for example. So Subtitles will be forced :!: :!: :!: NOT to be used for prediction :!:
So its not an enhancement ... its just a testing/proofing function. For prediction purposes do use the one in the link above! Code:
function slicerTesting(clip input, int percent, int Goplenght, int Gopmulti, string "ping") |
Thanks for sharing Inc :D we appreciate all your hard work with this excellent slicer() tool. :)
|
@Inc: I was thinking about you new function and I would like to know what do you think about:
Suppose you want to predict an encoding task and select 2% prediction sample size. So You do calculations and a script as following. Quote:
Ping-pong in only one pass. Please notice that slicer calls (ping and pong) just asks for 1 % (half your prediction sample lenght). I mean that it is really only an 1% ping-pong prediction. If it is true, with encoders that supports command line, is is quite easy to do a loop until matching sample prediction size. What do you think? |
Code:
a=Mpeg2source("E:\DVD Authoring Working Folder\Matrix.d2v").slicer(1,15,1,"ping") Better would be: Video=Mpeg2source("E:\DVD Authoring Working Folder\Matrix.d2v") ping = Video.slicer(1,15,1,"ping") pong= Video.slicer(1,15,1,"pong") last = ping++pong If you set return at the end no other following routins will be included. Also .... ping = Video.slicer(1,15,1,"ping") pong= Video.slicer(1,15,1,"pong") last = ping+pong is the same as ... last = Video.slicer(2,15,1,"ping") as by just 2% theoretically the amount of slices is doubled, means one more slice between the slices of 1% (wich means a pong is included). IF Im not wrong ...... Please check that :) Ping pog is not purposed to do ... ping pong ping pong ping ..... Its more like this ping pong ping ping ping ping pong - encode |
Quote:
Thanks for show me difference between return and last. Did you mean that with return, not resize neither filtering would be applied in my previous script? Quote:
Ping 1% = 1xxx1xxx1xxx1xxx1xxx1 Pong 1%= x1xxx1xxx1xxx1xxx1xxx1 Ping 2% = 11xx11xx11xx11xx11xx11 I agree that: ping = Video.slicer(1,15,1,"ping") pong= Video.slicer(1,15,1,"pong") last = ping+pong is the same as ... last = Video.slicer(2,15,1,"ping") but if your function behaviour is: Ping 1% = 1xxx1xxx1xxx1xxx1xxx1 Pong 1%= xx1xxx1xxx1xxx1xxx1xx Ping 2% = 11xx11xx11xx11xx11xx11 your previous affirmation is not true. Could you say me how really works your function. Quote:
When you do a 2% ping pong we have: 2 % ping 2 % pong 2 % ping 2 % ping 2 % ping 2 % ping 2 % pong You "suppose" that ping-pong differences will be equal than first one, bur really it isn't as you can view in the screenshot: http://www.digitalfaq.com/archives/error.gif CQ 69 diff = 1172 CQ 70.5 diff = 1175 CQ 69.9 diff = 1176 CQ 70.2 diff = 1181 Small differences but differences. Is for this reason that you need to evaluate last pong, to see if prediction is enough close of target filesize. I think if you do prediction as You corrected me before, as ping pong differences are inherent, you don't need last pong pass. In other words, when you do: Target size 30000 KB 1: 2 % ping 20000 KB 2: 2 % pong 25000 KB 3: 2 % ping 22000 KB 4: 2 % ping 24000 KB 5: 2 % ping 26000 KB 6: 2 % last ping 27500 KB 7: 2 % last pong 32000 KB As pp diff is not the same at different CQ values, you target would be (27500+32000)/2=29950 KB at last CQ. But you can continue doing pings until obtain exact match. I do: 1: 2 % ping-pong (1% ping + 1% pong) 2: 2 % ping-pong 3: 2 % ping-pong 4: 2 % ping-pong 5: 2 % ping-pong As pp diff is inherent, my target would be (13865.55+16134,45)=30000 KB It will need less passes than usual ping-pong to obtain same exact match. Not final pong is necessary. All this stuff is just a theory, I had not have time to test it. |
Ähhhhm ... thats a lot of stuff!
I see you want it to integrate in your Pred-Tool. Nice! As I also intented to write a HYBRID Predictioner for HC/CCE/TmpEnc/Nuenc ... but Im so much in other PureBasic Avisynth Stuff so Ill explain you how to do it. (Avalon also integrated Slicer in his AutoQ's but Im shure he even doesnt know how the idea is ;) ) Quote:
Quote:
Ping 1% = 1xxx1xxx1xxx1xxx1xxx1 Pong 1%= xx1xxx1xxx1xxx1xxx1xx ...ok ... Ping 2% = 11xx11xx11xx11xx11xx11 ... but here u show the doubling of the Gop lenght including! the increase of %frames in total ;) "11" means for example (2*15frames), means a Gop multi of 2! When increasing the "%" Value that wont enlarge the slices(means the count of the FOLLOWING frames) but enlarges the count of the slices theirselves. Example (5% of the movie): Ping = 1xxxxxxxxxxxxx1xxxxxxxxxxxxx1xxxxxxxxxxxxx ..... Pong= xxxxxxx1xxxxxxxxxxxxx1xxxxxxxxxxxxx1xxxxxx ..... doubling the 5% to 10%: Ping = 1xxxxxx1xxxxxx1xxxxxx1xxxxxx1xxxxxx1xxxxxx ..... Pong= xxx1xxxxxx1xxxxxx1xxxxxx1xxxxxx1xxxxxx1xxx ..... multiplying the GOP by 2 by keeping 10%: Ping = 11xxxxxxxxxxxx11xxxxxxxxxxxx11xxxxxxxxxxxx ..... Pong= xxxxxxx11xxxxxxxxxxxx11xxxxxxxxxxxx11xxxxx ..... multiplying the GOP by 2 by keeping 5%: Example (5% of the movie): Ping = 11xxxxxxxxxxxxxxxxxxxxxxxxxx11xxxxxxxxxxxx ..... Pong= xxxxxxxxxxxxx11xxxxxxxxxxxxxxxxxxxxxxxxxxx ..... So thats the math, as IF you increase the GOP multi, you have to decrease the number of slices to match the same % in total ;) So .... 2% and GopMulti=1 means more slices! but short! sampled ..... 2% and GopMulti=2 means less slices! but long! sampled ;) Acording to the rest of your post .... Well If you first do a pin and then a pong you get: a) The size of the sample which whould be the result IF you would use the actual CQ (yep thats what we already know ;) ) b) the DIFFERENCE of the ping (slices) to the pong (slices). THAT Difference you have to keep in your mind as it affects the whole logic. So we do Ping = 100kb Pong = 110kb 110-100 = 10 .... 100/10 = The difference = 10% in size as "less" to the pong. Means do add 5% to every following ping to get the wanted "how would it be if I would do a pong now" average! Ping = xxxkb (+5% of size) ping = xxxkb (+5% " ) Ping = xxxkb (+5% " ) Ping = xxxkb (+5% " ) ------ that would match! Finally we would do a final "safe" pong and again we would do the same calculation way as in our first ping/pong WITHOUT adding the 5% to the LAST ping. The Result should match the last Ping+5%. Be aware that the Calcs above are out of mind as Im in the office, but you will understand WHY you have to do maximal 2 pongs in the whole prediction. The Pongs just serve you the difference, which wouldnt be available in a prediction of the same % Amount in single passes. THATs the "Idea" of Slicer. |
@Inc:
Just now I understand what do you mean with "keep the difference in mind". For me difference was ping KB - pong KB. But you are talking about a "proportional difference" (I don't know how to call it in english). difference = a - b proportional difference = (a - b) / a It is only an explanation for other confused people as me. :oops: |
Quote:
Edited1: Forget it, was my mistake. Edited1: When I encode separated ping and pong, it gives me same framecount that the previous script. Why? I changed function percent, but still same framecount??? |
@Pro,
Only changing the GOP multiplier value will give you different sample sizes. That's how this function is supposed to work. You ask for 1% of a movie with 155000 frames :?: :arrow: then you always get 1550 frames in a ping or pong. Quote:
It should look like: proportional difference = (a - b) / b Cheers |
Quote:
Not a typo. Read a few post before Inc said ping 100 pong 110 difference (proportional difference) = 10% It is actually -10% (a -b) / a = -10% (100 - 110) / 100 = -10% |
Quote:
ping=27619KB pong=28066KB (28066-27619)/28066 So actually I've been doing (b-a)/b :lol: But that's just because usually "b" has a higher KB value than "a". Don't really know why. But I guess it's because "a" usually has a few frames from the begining of the movie. Thus these initial frames are really dark scenes that will always be visible on "a" but not on "b". Eventually I've had a couple of a>b but usually I have b>a. Cheers |
@rds
If you are doing: ping=27619KB pong=28066KB 28066-27619=447 447/28066=0.0159 be carefull: If you apply that proportional diff to pongs: 28066 * (0.159/2) = 223.5 28066 - 223.5 = 27842.5 27619 + 223.5 = 27842.5 you will obtain your target = 27842.5 But if you apply that proportional diff to pings (that is that you are doing, ping pong ping ping ping ping ping ping safe pong): 27619 * (0.159/2) = 219.94 27619 + 219.94 = 27838.94 that is a sub-value respect to your target. (Theoretically your actual final size will be oversized, but difference is so little that maybe you can't appreciate it) Do you understand? |
Site design, images and content © 2002-2026 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2026 Jelsoft Enterprises Ltd.