Code: Select all
libvlc_media_player_get_length (libvlc_media_player_t *, libvlc_exception_t *)
//Get the current movie length (in ms).
libvlc_media_player_get_time (libvlc_media_player_t *, libvlc_exception_t *)
//Get the current movie time (in ms).
libvlc_media_player_get_position (libvlc_media_player_t *, libvlc_exception_t *)
//Get movie position.
libvlc_media_player_get_fps (libvlc_media_player_t *, libvlc_exception_t *)
//Get movie fps rate.
libvlc_media_player_get_rate (libvlc_media_player_t *, libvlc_exception_t *)
//Get movie play rate.
These are the results:
length: as expected, always '40000' (milliseconds)
time: start: 0, end: 7148; so this is obviously the time in milliseconds that has passed since the playback of the file was started.
position: start: 0.0, end: 0.1787; Very strange! I had expected this value to range from 0.00(start of file / 0%) to 1.00(end of file / 100%). Instead, the maximum value was much lower which leads to the conclusion that the current position is calculated incorrectly using the following formula:
position = time / length;
Using the end values, this assumption was verified: 7148 / 40000 = ...0.1787
This will compute correct values, as long as you just playback videos at their regular playback rate, but will return incorrect values,
as soon as the playback speed differs from 1.0 as it is the case during Transcoding.
To calculate the position percentage correctly, libvlc_media_player_get_position should use the relation between the total file length and current read position.
fps: always 25; okay so thats the nominal fps value of the video
rate: always 1; mmh shouldn't this be the actual playback/ transcoding rate, so in my case ~5.5? If this would return the current playback rate, one could also easily determine the current transcoded fps by multiplying rate * fps.
During debugging I found out that it is definitely NOT the wrapper that returns the controversial values, but the above mentioned libvlc methods.
Has anyone experienced similar issues and can provide help or a workaround for this? Any chance that this will be fixed in the near future?
Greetings
Thomas