Page 1 of 1

The a return time when VLC plays the HTTP stream is not correct

Posted: 29 May 2018 05:07
by myxingkong
This is my code, which is used to play a HTTP video and listen to the current playtime.
# -*- coding: utf-8 -*-

import vlc[*]
import sys
import os


def MediaPlayerTimeChanged(event, *args, **kwds):
print event.u.new_time

if __name__ == "__main__":
t_instance = vlc.Instance("-q")
t_mediaPlayer = t_instance.media_player_new()
vlc_events = t_mediaPlayer.event_manager()
vlc_events.event_attach(vlc.EventType.MediaPlayerTimeChanged, MediaPlayerTimeChanged, None)
t_movie_url = "http://pic.qiantucdn.com/58pic/video/27 ... 023_69.mp4"
t_media = t_instance.media_new_location(t_movie_url)
t_mediaPlayer.set_media(t_media)
t_mediaPlayer.play()
os.system("pause")
When playing a video without sound, its output is not the same as expected, and it can not get the right time to play.
Press any key to continue . . . 250
250
250
250
250
250
250
250
250
250
250
250
250
.....

Re: The a return time when VLC plays the HTTP stream is not correct

Posted: 10 Jul 2018 05:25
by mfkl
Time is off in VLC desktop 3.0.3 also it seems, so the problem is probably not in your code. Same issue with other players?