VLCKit: Player time callback is relatively infrequent

This forum is about all development around libVLC.
deeds
New Cone
New Cone
Posts: 1
Joined: 16 Mar 2019 07:18

VLCKit: Player time callback is relatively infrequent

Postby deeds » 16 Mar 2019 07:26

I'm trying to use VLCKit to loop a portion of a video, without showing any extra frames beyond the provided bounds.
I figured I could pay attention to the mediaPlayerTimeChanged callback, and rewind once I get to the end of the portion of the video that I want to repeat.
Unfortunately it looks like mediaPlayerTimeChanged is only called every 250ms or so— is that the normal behavior? Is there something I could do to get the player's time more frequently, ideally every frame?

Thanks

MikOfClassX
Blank Cone
Blank Cone
Posts: 48
Joined: 29 Dec 2018 10:23

Re: VLCKit: Player time callback is relatively infrequent

Postby MikOfClassX » 18 Apr 2019 09:22

see my post: https://forum.videolan.org/viewtopic.php?f=32&t=148843

The aim of slow event notification is probably to save lazy coders from packing events and firing them to a gui (but almost every repaint manager coalesces very frequent repaints()).
What's less clear is why the libvlc_media_player_get_position() is not returning the real accurate position.

I would opt for a silly api extension:
libvlc_media_player_get_position(mediaplayer, bool accurate);
libvlc_media_player_get_time(mediaplayer, bool accurate);

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: VLCKit: Player time callback is relatively infrequent

Postby Jean-Baptiste Kempf » 18 Apr 2019 20:55

because the info depends on the demuxing packets. So for audio only or low fps, or low bitrate the updated info comes less often.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

MikOfClassX
Blank Cone
Blank Cone
Posts: 48
Joined: 29 Dec 2018 10:23

Re: VLCKit: Player time callback is relatively infrequent

Postby MikOfClassX » 19 Apr 2019 09:13

I am confused: libVLC explicitly sets a next_update time delay to 250ms.

For confirmation, I checked the static void *vlc_demux_chained_Thread(void *data) in demux_chained.c:
next_update = vlc_tick_now() + VLC_TICK_FROM_MS(250);

Many developers are reporting the same issue. Is there a way to get a more accurate timing ?

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: VLCKit: Player time callback is relatively infrequent

Postby Jean-Baptiste Kempf » 19 Apr 2019 09:57

demux_chained is not the same at all.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

MikOfClassX
Blank Cone
Blank Cone
Posts: 48
Joined: 29 Dec 2018 10:23

Re: VLCKit: Player time callback is relatively infrequent

Postby MikOfClassX » 19 Apr 2019 11:41

do you mean it has been improved in 4.0 ?

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: VLCKit: Player time callback is relatively infrequent

Postby Jean-Baptiste Kempf » 22 Apr 2019 15:17

It will be, yes.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

MikOfClassX
Blank Cone
Blank Cone
Posts: 48
Joined: 29 Dec 2018 10:23

Re: VLCKit: Player time callback is relatively infrequent

Postby MikOfClassX » 24 Apr 2019 09:33

Ehehe, ok... so it's only matter of time and patience. Any estimation ?

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: VLCKit: Player time callback is relatively infrequent

Postby Jean-Baptiste Kempf » 24 Apr 2019 14:36

3 months to be usable.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

MikOfClassX
Blank Cone
Blank Cone
Posts: 48
Joined: 29 Dec 2018 10:23

Re: VLCKit: Player time callback is relatively infrequent

Postby MikOfClassX » 28 Apr 2019 12:19

Starting timers..


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 10 guests