Bink Media Player - SetRate does not really work?

After spending a bunch of time trying to figure out why attempting to call SetRate with any number of different values in an attempt to speed up, or slow down playback didnt work (AS I THINK MOST PEOPLE WOULD EXPECT), I went and took a look at the C++ to find out what I was doing wrong.
[BinkMediaPlayer.cpp - line 197]

The gist of the C++ is 3 cascading if…else if… else if statements
and the if clause for each contains a hardcoded test for the rate value you specified.
(plus some other condition)

2 of the clauses have the same rate, so if I understand things correctly, we can say the following:

  • If the rate you attempt to set is 0, then your video will be paused
  • if you attempt to set a rate of 1, then it jumps to the first frame (goto)
  • if you attempt to set a rate of ANYTHING ELSE it DOES NOTHING

There is no actual RATE being set anywhere, which is why if you subsequently call GetRate, you will most likely get a value of 1.0 returned (or maybe 0 if you are not actually playing anything)

Now come on… does this really sound like a SetRate function to you?
That’s at best just another PLAY and PAUSE, and yes, semantically you could argue that those are ‘rates’, but if you did argue that, someone needs to take you aside and explain to you why you don’t get invited to parties any more.

Anyone wanna jump in and let me know what is going on with this?

  • Is there some secret technique I am just not getting?
  • Why would someone write a function accepting a FLOAT as a parameter to have the body of that function ONLY work with values of 0 or 1? (Where I come from that’s a bool, you know?)
  • Why would someone leave commented out code in there, but not add a comment to explain why?
  • Am I in fact being splendidly dumb and totally failing to understand how that code functions?
  • Is there another technique for speeding up, or slowing down bink media playback?
    (Even though it appears to be updating on Tick(), I somehow doubt messing with the Tick frequency would have the desired effect)
  • Is it actually not realistically possible to control the playback rate of Bink media - and that dangling a function called SetRate under my nose was in fact just a cruel and nasty joke to waste my (and several other judging by some forum posts) time - and that the function should really just be removed, or at the very least renamed to something like SetPausedOrPlayingBecauseRateIsNotActuallyAffected()

Sorry, I cannot help you with this for two reasons: 1) it’s more of a rant than a questions, and 2) I don’t blame you for being annoyed because I’m stuck using bink, and your problem is just one of many I have with it.

It’s simply not as easy to use or polished as the standard media player and, while bink may be an excellent codec at compression, a lot of things I could really use don’t work right.

For example, looping will look jumpy, even if the first and last frames were made with the same image (I guess it has to do with progressive encoding). Jumping to a frame seems kind of random - I need to loop from the end to a specific frame. The lead-in video is a few seconds, then there’s a looping part. The end event only seems to triggers once, even if I re-attach the event listener on each iteration. If all the videos I had to play were a fixed length, it wouldn’t be a problem, but they are dynamically loaded.

I don’t know what to say - just jumping on the bandwagon. We use it for broadcast because I’m stuck with huge files that need to be as efficient as possible, but then (as the programmer) I get stuck with all the drawbacks of things that work just fine with the standard media player.

It’s quite the headache.

Well, it may not suit your particular situation, but what we are doing in regards to the looping thing…
We break the file into sections, the ‘lead-in’ part, and the ‘loop body’, and we use sequencer to string them back together and play it.
Yes, we have sequencer events, but those are for other things.
Just by itself, if the bk2 asset is set to looping, then it loops when you trigger it.

(Which incidentally, is totally hilarious when you have a video with audio of the most ANNOYING ringtone ever, and the guy editing it triggers it in the sequencer and cant figure out how to make the noise stop :laughing: )

If the BK2 asset is marked in the asset as looping, then they seem to loop just fine
(sometimes a little ‘shaving’ is required in the source video in situations where you need ‘beat perfect’ loops maybe)

The other thing which seemed to effect the loop playback is the bink buffer mode; stream, stream until resident, preload.

Thanks for the tips.