Page 1 of 1

libvlc_media_player_set_rate doesn't work

Posted: 21 Jul 2014 10:31
by spider58
Hello. Im using 2.2.0 nighty building. I want to change video rate while play.

Public Sub libvlc_media_player_set_rate(Byval player as Intptr, Byval Speed as Double)
End Sub

In i can call this sub such as

Player.libvlc_media_player_set_rate(playerhandle, 1.5F)

This code must be set rate to 1.5 But doesn't work. Player continuing play normally. Doesn't gives any error.

Can someone have an any idea?

Best regards

Re: libvlc_media_player_set_rate doesn't work

Posted: 21 Jul 2014 13:45
by sherington
Hmm... that LibVLC API function still works just fine for me with latest VLC 2.2.0-git.

Re: libvlc_media_player_set_rate doesn't work

Posted: 21 Jul 2014 15:15
by spider58
Hmm... that LibVLC API function still works just fine for me with latest VLC 2.2.0-git.
thanks for reply. can you share function defining and usage code please? I want to check my code for differences.

Best regards.

Re: libvlc_media_player_set_rate doesn't work

Posted: 21 Jul 2014 16:52
by sherington
Hmm... that LibVLC API function still works just fine for me with latest VLC 2.2.0-git.
thanks for reply. can you share function defining and usage code please? I want to check my code for differences.

Best regards.
Well, I don't know what language you're using so I don't think I can help you with that, I simply use the "C" function declared in the header file and an equivalent function mapped in Java. A parameter value of 2.0f doubles the speed, 0.5f halves it, just as you'd expect.

Re: libvlc_media_player_set_rate doesn't work

Posted: 21 Jul 2014 17:02
by spider58
Hmm... that LibVLC API function still works just fine for me with latest VLC 2.2.0-git.
thanks for reply. can you share function defining and usage code please? I want to check my code for differences.

Best regards.
Well, I don't know what language you're using so I don't think I can help you with that, I simply use the "C" function declared in the header file and an equivalent function mapped in Java. A parameter value of 2.0f doubles the speed, 0.5f halves it, just as you'd expect.
using vb.net. anyway thanks.

Re: libvlc_media_player_set_rate doesn't work

Posted: 21 Jul 2014 17:45
by RĂ©mi Denis-Courmont
Not all inputs can have their rate changed. For instance, it obviously cannot work for live streams.

Re: libvlc_media_player_set_rate doesn't work

Posted: 22 Jul 2014 10:25
by spider58
Not all inputs can have their rate changed. For instance, it obviously cannot work for live streams.
yes you're right. but i dont work with live streams. Recording live streams to disk as TS format. And playing from disk.

Re: libvlc_media_player_set_rate doesn't work

Posted: 23 Jul 2014 07:53
by spider58
An interesting situation, how it worked i don't know but

tried to set rate value as 1.9f it's working but such as 20f , too fast. not like 1.9f, my video has 2 minutes length. It finishing to play in 3-4 seconds with 1.9f speed.

tried to set rate 1.89f it's working too, but such as 0.03f, so slow, my video finishing to play in ~20 minutes with 1.89f speed

tried to set rate 0.5f or 5f, not working, no speed changing, play as normal speed

sometimes get_Rate returns 4.17f, or 3,68f sometimes returns 0f, but video plays normal speed

i can't understand anything, weird

Re: libvlc_media_player_set_rate doesn't work

Posted: 23 Jul 2014 09:26
by sherington
What about Float vs Double in vb.net, is that a thing?

Code: Select all

Public Sub libvlc_media_player_set_rate(Byval player as Intptr, Byval Speed as Float) End Sub

Re: libvlc_media_player_set_rate doesn't work

Posted: 23 Jul 2014 09:38
by spider58
What about Float vs Double in vb.net, is that a thing?

Code: Select all

Public Sub libvlc_media_player_set_rate(Byval player as Intptr, Byval Speed as Float) End Sub
in vb.net we use double instead of float. its same. No float type can define in vb.net

Re: libvlc_media_player_set_rate doesn't work

Posted: 23 Jul 2014 09:46
by spider58
What about Float vs Double in vb.net, is that a thing?

Code: Select all

Public Sub libvlc_media_player_set_rate(Byval player as Intptr, Byval Speed as Float) End Sub
oh man. thanks for the tip. In google i found single variable type. and i tried to use SINGLE instead of DOUBLE. This is working perfect!! Thanks for idea :)