Opening MP4 file stream takes like 20-30 seconds. How to improve?

This forum is about all development around libVLC.
maztan
Blank Cone
Blank Cone
Posts: 10
Joined: 13 Apr 2018 12:54

Opening MP4 file stream takes like 20-30 seconds. How to improve?

Postby maztan » 14 Apr 2018 01:12

I have a stream accessible through imem extension. It's an MP4 stream - there is about 400MB of data in it. vlclib reads about 6MB of data from the stream before even starting playback. Is there any way I can set it up so that playback starts in max couple seconds (again, I know what the format is exactly).

I am decrypting a file on the fly hence I can only provide it to the lib as seek-able stream. Maybe there is a way that would make this stream to be treated as a file by vlclib? MP4 files initialize fast, streams are very slow. Thanks

Rémi Denis-Courmont
Developer
Developer
Posts: 15266
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Opening MP4 file stream takes like 20-30 seconds. How to improve?

Postby Rémi Denis-Courmont » 14 Apr 2018 08:38

Make sure you provide a working seek callback.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

maztan
Blank Cone
Blank Cone
Posts: 10
Joined: 13 Apr 2018 12:54

Re: Opening MP4 file stream takes like 20-30 seconds. How to improve?

Postby maztan » 14 Apr 2018 10:47

Yes, I do. I have been debuging it for a long time. First data is read from the beginning of file and later a seek is made to the near-end of file and reading continues. It reads about ~6MB of data before it starts playback. It's all metadata/atoms of MP4 but it takes like 20-30 seconds. Playback of an MP4 file passed as a resource (not stream) to libvlc is fast on the other hand.

Rémi Denis-Courmont
Developer
Developer
Posts: 15266
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Opening MP4 file stream takes like 20-30 seconds. How to improve?

Postby Rémi Denis-Courmont » 14 Apr 2018 11:15

It sounds your callbacks are too slow.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

maztan
Blank Cone
Blank Cone
Posts: 10
Joined: 13 Apr 2018 12:54

Re: Opening MP4 file stream takes like 20-30 seconds. How to improve?

Postby maztan » 15 Apr 2018 02:44

I specifically recompiled VLC with imem having buffer of 1MB to make it just read a bigger chunk at once. It did nothing. The callbacks were just called less often, like if vlclib didn't need the data at this pace. Thanks for all the replies y the way.

maztan
Blank Cone
Blank Cone
Posts: 10
Joined: 13 Apr 2018 12:54

Re: Opening MP4 file stream takes like 20-30 seconds. How to improve?

Postby maztan » 15 Apr 2018 02:56

OK, just checked. You are completely right. My callbacks are slow for some reason.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 25 guests