Page 1 of 1

input.position question

Posted: 24 Aug 2010 08:06
by Yansky
I'm having some trouble understanding one of the plugin API methods. Specifically input.position

The docs say:
vlc.input.position: normalized position in multimedia stream item given as a float value between [0.0 - 1.0]
http://wiki.videolan.org/Documentation: ... put_object

I had to look up the term "normalized" cause I didn't understand what that meant: http://en.wikipedia.org/wiki/Scientific ... d_notation

I don't quite understand how vlc.input.position works. Is it the relative position of the player in relation to the bytestream?

I called the vlc.input.position method just after the video started playing to see what it would show and I got this: 0.0018034265376627445

How I interpret that number?

Re: input.position question

Posted: 24 Aug 2010 20:52
by ams.fwd
Normalized means that the value has been converted to within a set range. For e.g. if your video/stream is 10 mins long when its at the 1 min mark while playing the value would be 0.100000 as the position is normalized to 1 (i.e. the value will be between 0 and 1 and is calculated as current time/total time).

So 0.0018034265376627445 means that its played 0.18% of the total video. Taking the abovementioned example of a 10 min video, it means that the video is now at ~1.1s from the beginning. 10 * 60 * .0018

HTH
AM