Groups | Search | Server Info | Login | Register


Groups > comp.sys.dec > #4212

[Extra Quality] Download M3u8 Files Ffmpeg

Newsgroups comp.sys.dec
Date 2024-01-21 09:52 -0800
Message-ID <6af54277-db91-4e56-ab9b-ae6ae5f9090cn@googlegroups.com> (permalink)
Subject [Extra Quality] Download M3u8 Files Ffmpeg
From Thi Barnacle <barnaclethi@gmail.com>

Show all headers | View raw


<div>where the generate the filelist.txt from the index.m3u8 file, it complains about not being able to read various files. But converting the ts files themselves seem to work fine. I think I'm not using ffmpeg properly.</div><div></div><div></div><div></div><div></div><div></div><div>download m3u8 files ffmpeg</div><div></div><div>DOWNLOAD: https://t.co/CnEIqzjNZQ </div><div></div><div></div><div>If you're too lazy to read my first link, you basically have to create a .txt file listing all the files you want to combine like so (which my first link gives instructions on how to do easily) in the folder where you're doing the concatenation:</div><div></div><div></div><div>Using Juan Aquino's answer (and correcting the first command to be compatible with Bash and using the natural ordering of files), plus 7vujy0f0hy's answer, a simple working script for a Linux Bash shell is:</div><div></div><div></div><div>All the popular answers to this question that mislead readers to concatenate the TS files before running ffmpeg are incorrect. To ensure the audio and video do not fall out of sync during the assembly of the mp4 stream, the poorly documented but important "-f concat" feature of ffmpeg should be used.</div><div></div><div></div><div>Aergistal's answer works, but I found that converting to mp4 can make some m3u8 videos broken. If you are stuck with this problem, try to convert them to mkv, and convert them to mp4 later.</div><div></div><div></div><div>The main issue with this is that the m38u file is always missing the last segment: ffmpeg creates restreamed0.ts, there is no m3u8 file. After given time, the (restreamed)0.ts is done, and it starts another chunk 1.ts. At this point, m3u8 is created, but it only has 0.ts in it. When the 1.ts if finished, another chunk 2.ts is started, and the 1.ts is written to the m3u8 file, and so on. This obviously creates the delay of the length of one segment, which is too much.</div><div></div><div></div><div></div><div></div><div></div><div></div><div>I had no success loading that m3u8 file in vlc or in bowser (html video element). (However, if I try to play one of the .mjpg files, it's working as expected (except it plays faster, but I think that's caused by the source stream being 10fps, I can deal with this later)). The m3u8 file looks like this:</div><div></div><div></div><div>Concerning HLS: The .m3u8 file always only contains the finished segments, so the one just being created is never in the list. Due to consumption via a browser this is necessary and can't be circumvented.</div><div></div><div></div><div>Also, I came a across a recent live stream which I am trying to download the VOD of and as shown in the screenshot there's no master m3u8 file for that one, but a bunch of playlists. Do I have to create one myself?</div><div></div><div></div><div>However, if your streams are not, you need to find a workaround. Generally, playlists of playlists are not a great idea (M3U containing references to M3U8). One option is to use a pipe:// URI in the M3U to call ffmpeg to convert the stream from HLS to MPEG-TS.</div><div></div><div></div><div>1. Use the "Automatic IPTV network" type in Tvheadend to create a network from an M3U file. In that M3U file, you format it as:</div><div></div><div>#EXTM3U#EXTINF:-1 tvh-chnum="",pipe:// -i -c copy -f mpegts pipe:1#EXTINF:-1 tvh-chnum="",pipe:// -i -c copy -f mpegts pipe:1...</div><div></div><div>Replace the with the channel number you want the stream to be assigned in Tvheadend, replace with what you want the service (and the channel) to be named in Tvheadend, replace with the path to your ffmpeg executable, and gets replaced with the URL to the M3U8 playlist of your IPTV channel.</div><div></div><div></div><div>I had forgotten that ffmpeg will provide a generic service and network name. Those can be changed by modifying the ffmpeg command line the add the appropriate option after the -f mpegts option. I can't recall what it is, but there are posts on the forum here with it, and of course you can check ffmpeg's extensive documentation:</div><div></div><div></div><div>The quality of your stream being sent to Tvheadend can be modified by ffmpeg and transcoded. Again, read their documentation to find the appropriate options and what will work best for your situation.</div><div></div><div></div><div>1. Use the "Automatic IPTV network" type in Tvheadend to create a network from an M3U file. In that M3U file, you format it as:</div><div></div><div>[...]</div><div></div><div>Replace the with the channel number you want the stream to be assigned in Tvheadend, replace with what you want the service (and the channel) to be named in Tvheadend, replace with the path to your ffmpeg executable, and gets replaced with the URL to the M3U8 playlist of your IPTV channel.</div><div></div><div></div><div>You accomplish your task using a single FFmpeg command in which you can read all the files and combine all the streams from different files using a filter, and output m3u8 using segment format from FFmpeg but it would be hacky and prone to errors.</div><div></div><div></div><div>The output.m3u8 m3u8 playlist file will be located in the same directory as your MP4 files following the execution of this command. The separate segments made during the conversion are referred to in this playlist.</div><div></div><div></div><div>M3U8 files are often seen in apps' downloads (e.g. video downloaded in UC browser) and streaming videos and lives. However, they are not playback-friendly. On occasion, you might be troubled with an M3U8 cannot load error because M3U8 files are not general videos. They are comprised of media list and location and are stored in plain text format.</div><div></div><div></div><div>Be it a M3U8 streamed video or a M3U8 broadcasting video stored in a .m3u8 link, VideoProc Converter AI always can read and download the video sources from any website in a click. Another important tidbit to know is that VideoProc Converter AI downloads M3U8 to MP4 directly. That said, you don't have to do conversions because VideoProc Converter AI saves M3U8 files as MP4 automatically.</div><div></div><div></div><div>Open the live video through a browser like Google Chrome or Firefox. Right-click on the live video (or hit F12 key on the keyboard), and go to Inspect >Network. Find your M3U8 file, and copy the link with a suffix of ".m3u8".</div><div></div><div></div><div>VLC is a popular media player that can also help users in converting videos to accessible formats. A unique thing about VLC is that it is compatible with webcams, discs, files, streams, and devices without any user tracking or pesky advertisement interruptions. Whether you are working on a Mac or Android device, you can use this tool for converting your M3U8 file to MP4 by simply following the steps laid down below.</div><div></div><div></div><div>Compared to AnyConv, Video Online Converter has more customizable options such as resolution, file size, bitrate, etc. And you can import M3U8 by uploading from local storage and pasting a URL. In a nutshell, AnyConv for simple conversion of local M3U8 files, while Video Online Converter for advanced conversion of both online and local M3U8.</div><div></div><div></div><div>FFmpeg is an open-source multimedia framework compatible with Windows, Linux, macOS, and iOS and Android in mobile devices. It empowers you to download record, stream, edit and convert video/audio files in an efficient way. With an advanced codec library libavcodec, FFmpeg is capable of converting M3U8 files without quality loss.</div><div></div><div></div><div>Go to www.ffmpeg.org to download a program package in terms of the operating system. Then create a folder for this program as well as its unpacked files. Finally set the Environmental Variables to C:\FFmpeg\bin.</div><div></div><div></div><div>Get the M3U8 link in Inspect > Network on your browser. Then type the command line "ffmpeg -i -c copy -bsf:a aac_adtstoasc output.mp4 " on a Text Document, and replace by the link you just copy online.</div><div></div><div></div><div>You can use online m3u8 players, Chrome extensions, or desktop programs like 5KPlayer, VLC media player to play M3U8 streams directly. After getting the URL of an m3u8 video, paste it to the player, and then you can watch it on your computer.</div><div></div><div></div><div>M3U8 files conversion involves mainly 2 situations: converting local M3U8 files to MP4 and saving M3U8 stream to local .mp4 videos by downloading. VlC, FFmpeg, online converters, and mobile apps tend to complete either of them. But you can tell from the tutorial above that VideoProc Converter AI performs both M3U8 conversion and download successfully. To prevent tripping up on these issues, try VideoProc Converter AI and solve all your video processing tasks in one-stop.</div><div></div><div></div><div>Streaming the live data</div><div></div><div>You can write the response from the FFMPEG process, back to the key value storage and stream it to client. Keep in mind that unlike streaming files, it will take a lot of memory. It is also FILO, so you will need to reverse the list.</div><div></div><div></div><div>Another option which I use in the example, is to stream the files that FFMPEG created. When a client request the live stream, serve the playlist.m3u8 file and it will contain a list of all the *.ts video files.</div><div></div><div></div><div>Make sure the ipcamera.m3u8 file is created in the ffmpeg output directory you have defined in the thing setup.</div><div></div><div>Also have an eye on the switch for starting the streaming (Channel startStream - Create the switch item and keep an eye on the item in the log). This switch should turn ON automaticly, when you request the stream from your Chromecast, and ffmpeg should start creating/updating the .m3u8 file and its .TS files in the output directory.</div><div></div><div></div><div>I don't FFmpeg is the issue here. The problem is that he has a playlist nested inside a playlist; i.e. his local playlist (/home/bojan/Glasba/Net radio.xspf) points to another playlist ( -lh.akamaihd.net/i/RadioM2o_Live_1 42518/master.m3u8). Audacious doesn't support this.</div><div></div><div></div><div>Where VIDEOURL is the webpage where the video player resides and VIDEOURL is the stream URL (the m3u8 url).</div><div></div><div>I need a way to forward the webpage URL as well as the stream URL to the playing system in Kodi.</div><div></div><div></div><div>The video will play automatically once the .m3u8 file has been loaded. However, as you can see, I set the muted property as such because for some reason (as seen on Stackoverflow), Chrome needed it to be set for the video to play automatically.</div><div></div><div></div><div>I'm trying to download a playlist with links which are gathered from custom scraper. The links mainly consist of m3u8 files, however occasionally I have youtube links. Now, for the m3u8 files I use an external downloader ffmpeg with this command yt-dlp --downloader ffmpeg (this is part of the command). If I don't use the external downloader I get this warning WARNING: Live HLS streams are not supported by the native downloader. If this is a livestream, please add "--downloader ffmpeg --hls-use-mpegts" to your command.</div><div></div><div> df19127ead</div>

Back to comp.sys.dec | Previous | Next | Find similar


Thread

[Extra Quality] Download M3u8 Files Ffmpeg Thi Barnacle <barnaclethi@gmail.com> - 2024-01-21 09:52 -0800

csiph-web