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

This forum is about all development around libVLC.
myxingkong
New Cone
New Cone
Posts: 4
Joined: 29 May 2018 05:02
VLC version: 2.2.8
Operating System: Windows7/macOS10.12

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

Postby myxingkong » 29 May 2018 05:07

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
.....

mfkl
Developer
Developer
Posts: 740
Joined: 13 Jun 2017 10:41

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

Postby mfkl » 10 Jul 2018 05:25

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?
https://mfkl.github.io


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 34 guests