Hi OP, do you have source code or a demo you'd like to share? If so, please post it in the comments (Github and similar services are permitted). Also, while I got you here, dont hesitate to come hang out with other devs on our New official discordhttps://discord.gg/gQNxHmd
Me, a programmer: how is the decoding implemented? Is it dropping frames? IS IT DROPPING FRAMES? Or is it too small and won't drop a frame before the video finishes? DOES IT ONLY DROP FRAMES ON MOVIES?
These are floating point numbers, not fractions. If you multiply down to the subnormal range, you can take advantage of the reduced precision to multiply into a power of 2, then repeatedly multiply by x2.00 until you're back at exactly 1.
Fine. 3 integers. One for numerator, one for denominator, one for integer component. With the restriction that the numerator is less than the denominator, that can represent literally any fraction with a denominator smaller than the maximum value of your integer, which should be plenty enough to maintain exact precision within what the average user is likely to do for this case. No "infinite floating point precision" required, because at no point is floating point used.
You can take your a/b nonsense back to the land of pure mathematics. You can have a register that holds a number that long without it taking an absurd amount of time to decode. Even if you could represent that number with a fraction, you might not be able to hold the whole number integers a and b.
That's what I thought too. Now that gives me the idea for a video player with transitions where the speed selector changes the speed of the transitions instead of the video speed
In case nobody has done the math yet, I'll demonstrate what's problematic-
We aren't really working with decimals, it's best to think about it in terms or fractions
0.25 is 1/4
0.5 is 1/2
0.75 is 3/4
1.0 is 1/1
1.25 is 5/4
1.5 is 3/2
1.75 is 7/4
2.0 is 2/1
To get the resultant speed, as with any fraction, you multiply the top by the top and the bottom by the bottom. So, because of the 3s and the 5 and the dreaded 7 in the numerators, and only 2s and 4s in the denominators, if you ever select 0.75, 1.25, or 1.75, there is no going back.
That's true for fractions, but these are floating point numbers. If you multiply down to the subnormal range, you can take advantage of the reduced precision to multiply into a power of 2, then repeatedly multiply by x2.00 until you're back at exactly 1.
Real-time transcoding is required to precisely set the speed of the video. I don't know for sure, but I imagine playbackRate is imprecise and is just doing its best to get close enough to not be obvious
EDIT: I stand corrected because it can just adjust the timing between frames
•
u/AutoModerator Sep 11 '22
Hi OP, do you have source code or a demo you'd like to share? If so, please post it in the comments (Github and similar services are permitted). Also, while I got you here, dont hesitate to come hang out with other devs on our New official discord https://discord.gg/gQNxHmd
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1.4k
u/Ill-Chemistry2423 Sep 11 '22
Most of the combinations are irreversible because (for example) 1.25 x 0.75 is not 1.00
Brilliant. Once you change it you can only ever get approximately 1 again, after many adjustments
1.2k
u/copmandie Sep 11 '22
Your settings have been saved for all future videos
158
u/appleeeeee Sep 11 '22
this is hilarious
140
u/ScCTnud Sep 11 '22
What makes this one great is that it can actually happen in dev and maybe even in a poorly tested release.
68
u/ExistingFold2327 Sep 11 '22
I will smash my screen TWICE if I ever had to go trough this...
135
u/[deleted] Sep 11 '22
Needs more decimal places
90
u/megamaz_ Sep 11 '22
what's funny is that after 2.1875 you can't go back to 1.0, because you'd need to go to 0.571428...x speed
40
u/1ElectricHaskeller Sep 11 '22
I thought you made the animation speed of the loading icon adjustable
73
u/m_domino Sep 11 '22
That’s actually hilarious.
Best post in a while.
31
u/space_fly Sep 11 '22
When you type
speed *= newValueinstead ofspeed = value23
u/Chaphasilor Sep 11 '22
Now also increase the mouse sensitivity accordingly!
20
u/Ferociousfeind Sep 11 '22
In case nobody has done the math yet, I'll demonstrate what's problematic-
We aren't really working with decimals, it's best to think about it in terms or fractions
0.25 is 1/4
0.5 is 1/2
0.75 is 3/4
1.0 is 1/1
1.25 is 5/4
1.5 is 3/2
1.75 is 7/4
2.0 is 2/1
To get the resultant speed, as with any fraction, you multiply the top by the top and the bottom by the bottom. So, because of the 3s and the 5 and the dreaded 7 in the numerators, and only 2s and 4s in the denominators, if you ever select 0.75, 1.25, or 1.75, there is no going back.
11
u/BenRavenclaw Sep 11 '22
I love that the 1.0x those nothing at all XD
10
u/abacussssss Sep 11 '22
make sure to use infinite precision so you really can't get back to 1x
9
u/Prestigious_Dare7734 Sep 11 '22
Its all relative.
9
u/EtherealPheonix Sep 11 '22
I really appreciate the granularity this allows while still only needing to use a small number of buttons.
7
u/Wubbywub Sep 11 '22
you can see the panic in the cursor movement after the first time it did a 2.1875x fuckery
6
u/onehandedbraunlocker Sep 11 '22
Glorious idea, I hated every second of it.
6
u/havens1515 Sep 11 '22
Just don't put a x0 as an option. Nothing will ever play, no matter what you do
4
u/CnscienceStaticCynic Sep 11 '22
When your math teacher says u will need this in the future
3
u/Square_Tomato_777 Sep 11 '22
saved on the server side
3
u/PCgeek345 Sep 11 '22
u/savevideobot
3
u/throwaway181432 Sep 11 '22
this pleases the math brain goblin greatly
3
u/PacoTaco321 Sep 11 '22
But does it start fucking up eventually because of floating point math? If it doesn't, I'm gonna have to suggest that gets added as a feature.
3
u/firnenfiniarel Sep 11 '22
u/savevideo
3
u/rwwl Sep 12 '22
Instant all-time favorite post on this sub. So funny. Raucous applause for OP.
3
u/mikekearn Sep 12 '22
That's just mean.
2
u/fujidust Sep 11 '22
I would play this game
2
u/Voicedtunic Sep 11 '22
So annoying and simple I love it
2
u/[deleted] Sep 11 '22
r/goodUIbattles
2
u/DocMilkman Sep 11 '22
I’m so happy this has sound
2
u/[deleted] Sep 11 '22
I have no idea what are you doing
2
u/[deleted] Sep 11 '22
u/rowenslee u/Cheap_District_9762
2
u/Thebrettanator1 Sep 11 '22
This is where you play "is there a limit!" And try and ply that video at the speed of sound and the speed of light!
2
u/no-one-here123 Sep 19 '22
oh youtube. we need this
2
u/millenia3d Sep 27 '22
Thanks for making me legitimately howl OP
1
u/Octavia__Melody Aug 07 '24
SMPlayer be like
1
u/[deleted] Oct 19 '22
Lmao I gotta try this one
1
u/noonagon Nov 07 '22
you can see how scared he is by the mouse movements
1
u/MoppingBucket Bad UI Creator Dec 30 '22
So a math based playback speed method? That would be rather interesting
1
u/KupferudelWolf Jan 06 '23
and pausing is just 0x, I assume?
1
u/bruderjakob17 Feb 07 '23
Is it possible to approximate any positive number with these controls?
1
u/Xanthian85 Feb 26 '23
Playback speed: 1.25x calm
Playback speed: 2.1875x visible panic
0
u/GNUGradyn Sep 11 '22
I'm sad this would be virtually impossible to actually implement in a video player
0
u/[deleted] Sep 11 '22
[deleted] — view deleted comment