VLC for Unity skips first second

This forum is about all development around libVLC.
Odyssey
New Cone
New Cone
Posts: 4
Joined: 21 Sep 2024 21:22

VLC for Unity skips first second

Postby Odyssey » 21 Sep 2024 21:43

Hi all!

I'm trying to play some Bink video via VLC in Unity and faced a problem, for which unable to found solution.
Player works fine, however by unknown reason it skips nearly second (900 - 1000 milliseconds) with normal rate before starting to play video (this values reports first Time call in Update() during first frame receiving). Tried to change file caching time, enable hardware decoding, change a way media provided, etc - nothing worked.
However, when I tried to change playback rate, situation changed: with 0.125 rate skipped just 100 milliseconds, so no video plays from the start but really slow.

Player implementation based on basic examples from https://github.com/videolan/vlc-unity (based currently on demo version of VLC for Unity), for output used VisualElement background,
Media created from byte array: new(new StreamMediaInput(new MemoryStream(value))), tried also with file - situation is the same.

Did I missed some option or anything else in setup of player/media assignment while checking docs, examples and code?

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

Re: VLC for Unity skips first second

Postby mfkl » 07 Oct 2024 11:13

do you have this issue when playing a media from a URL as well?
https://mfkl.github.io

Odyssey
New Cone
New Cone
Posts: 4
Joined: 21 Sep 2024 21:22

Re: VLC for Unity skips first second

Postby Odyssey » 07 Oct 2024 13:46

do you have this issue when playing a media from a URL as well?
No, will try later today and provide test results, thank you!

Odyssey
New Cone
New Cone
Posts: 4
Joined: 21 Sep 2024 21:22

Re: VLC for Unity skips first second

Postby Odyssey » 08 Oct 2024 00:49

do you have this issue when playing a media from a URL as well?

Used link from example and used the easiest way to set it:

Code: Select all

player.Media = new(new Uri("https://download.blender.org/peach/bigbuckbunny_movies/big_buck_bunny_1080p_stereo.avi"));

Yes, first player.Time value has range from 1000 to 1200.

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

Re: VLC for Unity skips first second

Postby mfkl » 08 Oct 2024 06:39

If you need more precise time, I think you will need to write some custom code.
First read https://code.videolan.org/videolan/vlc/ ... uests/2312 comments and commits. Then see how to use these functions from libvlcsharp in unity.
https://mfkl.github.io

Odyssey
New Cone
New Cone
Posts: 4
Joined: 21 Sep 2024 21:22

Re: VLC for Unity skips first second

Postby Odyssey » 09 Oct 2024 23:54

Thank you, will try this approach.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 14 guests