Problem with fragmented mp4

This forum is about all development around libVLC.
suckitdry
New Cone
New Cone
Posts: 4
Joined: 19 Apr 2021 03:51

Problem with fragmented mp4

Postby suckitdry » 24 Apr 2021 22:18

Hi, I downloaded a fragmented mp4 video, after inspecting it with mp4 viewer it looks something like this:
ftyp-moov-mdat-moof-mdat-moof-mdat-moof-...
So after the moov box there is a long sequence of mdat-moof pairs up to the end of file.I wanted to play this video from the net with libvlc, that is, by reading directly from memory through the libvlc_media_new_callbacks function but there is a problem, or perhaps more than a problem. Apparently libvlc tries to download all of the video first before playing it. I suppose that's because it is unable to seek in this context. And sitting to wait until it downloads maybe gigabytes of data is not a good idea. In this scenario, is there a way to tell libvlc to start playing inmediately from available data in memory instead of downloading/seeking the entire video first?

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

Re: Problem with fragmented mp4

Postby mfkl » 27 Apr 2021 04:12

Apparently libvlc tries to download all of the video first before playing it
I don't think that's true, can you share your code?
https://mfkl.github.io

suckitdry
New Cone
New Cone
Posts: 4
Joined: 19 Apr 2021 03:51

Re: Problem with fragmented mp4

Postby suckitdry » 28 Apr 2021 18:34

I use the same code shown here: https://forum.videolan.org/viewtopic.php?t=127796
It works well when you load the entire video into memory, but the problem comes when you try to play from an arbitrary position when the whole video is not available, for example from a remote host. As i said earlier, I think it is because the moov box lacks the tables which enable seeking (like the stts, stsz, stco and similar), forcing libvlc to parse the entire video


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 14 guests