Page 1 of 1
Opening MP4 file stream takes like 20-30 seconds. How to improve?
Posted: 14 Apr 2018 01:12
by maztan
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
Re: Opening MP4 file stream takes like 20-30 seconds. How to improve?
Posted: 14 Apr 2018 08:38
by Rémi Denis-Courmont
Make sure you provide a working seek callback.
Re: Opening MP4 file stream takes like 20-30 seconds. How to improve?
Posted: 14 Apr 2018 10:47
by maztan
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.
Re: Opening MP4 file stream takes like 20-30 seconds. How to improve?
Posted: 14 Apr 2018 11:15
by Rémi Denis-Courmont
It sounds your callbacks are too slow.
Re: Opening MP4 file stream takes like 20-30 seconds. How to improve?
Posted: 15 Apr 2018 02:44
by maztan
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.
Re: Opening MP4 file stream takes like 20-30 seconds. How to improve?
Posted: 15 Apr 2018 02:56
by maztan
OK, just checked. You are completely right. My callbacks are slow for some reason.