Forum > Networking and Web Programming
How to download a video from an URL like *.m3u8 ?
TRon:
--- Quote from: Hartmut on April 04, 2024, 06:59:36 pm ---Do you mean, that each single downloaded segment file contains several control data from the MPEG transport stream (which must be deleted)? Looks like pure horror...
--- End quote ---
Yes and besides that synchronization frames.
It /is/ horror which is probably why (again afaik) there isn't a native solution. Let others worry about the nitty gritty details and let us (simply) make use of it :)
--- Quote ---I used ffmpeg manually in the past to download *.m3u8 videos. But multiple times these videos had gaps and were bumpy/jerky. Sometimes I saw messages like "HTTP error 404 Not Found" or "Failed to open segment of playlist" in the huge output of ffmpeg. It looks like ffmpeg does not retry on problems and simple continues... So I hesitate to trust on ffmpeg.
--- End quote ---
I am not sure how individual solutions solve it but it can be either the commandline or the library (the latter which provides more fine grained control). Note, that I do mention ffpmpeg but there are other libraries out there as well (it is just my limitation of not knowing others from mind).
Hartmut:
--- Quote from: TRon on April 04, 2024, 07:09:29 pm ---
--- Quote from: Hartmut on April 04, 2024, 06:59:36 pm ---I used ffmpeg manually in the past to download *.m3u8 videos. But multiple times these videos had gaps and were bumpy/jerky. Sometimes I saw messages like "HTTP error 404 Not Found" or "Failed to open segment of playlist" in the huge output of ffmpeg. It looks like ffmpeg does not retry on problems and simple continues... So I hesitate to trust on ffmpeg.
--- End quote ---
I am not sure how individual solutions solve it but it can be either the commandline or the library (the latter which provides more fine grained control).
--- End quote ---
Thank you TRon. How can I access ffmpeg through a library? Can you give me some details please? I'm a bloody beginner to that stuff.
TRon:
--- Quote from: Hartmut on April 04, 2024, 07:20:14 pm ---Thank you TRon. How can I access ffmpeg through a library? Can you give me some details please? I'm a bloody beginner to that stuff.
--- End quote ---
First of all there is a wiki page on multimedia/video here.
ffmpeg libraries can be "accessed" by Free Pascal by using/installing the ffmpeg header files, which is mentioned on that wiki-page and can be found here.
Other than that the installation of the ffmpeg libraries is required. How to do that (properly) depends on the platform.
If you are looking for example code then I would have to come up with something (new) because last time I did something like that I was still on windows (Linux now) so that might take quite some time due to time constraints at my side. There are probably plenty of c examples out there (and which usually can be translated into Pascal).
cdbc:
Hi
Search for user @Metis & ffmpeg here on the forum, he does a lot with ffmpeg
edit: See here:https://forum.lazarus.freepascal.org/index.php/topic,26666.msg464784.html#msg464784 Reply #140
Regards Benny
Hartmut:
Thank you TRon for those links. I checked them but got stuck at https://github.com/DJMaster/ffmpeg-fpc. Don't know what "headers binding" is (has it to do with C?). There are plenty of source files, I had a look in some of them, but did not see something which helped me.
Thanks cdbc for your post. My search got 26 matches, but I found nothing which helped me to access ffmpeg as a library.
I think ffmpeg as a library is far beyond my horizon. And as I said in reply #4, I hesitate to trust on ffmpeg.
So I'm looking for another solution. There exists a FPC unit for curl called 'libcurl'. Does somebody know, if curl can download a video from an URL like *.m3u8? If the answer is definetively 'yes' then I would dive into it.
Navigation
[0] Message Index
[#] Next page
[*] Previous page