Hello
I'm trying to capture and record a live stream at this url: http://50.7.69.186:1935/edge/_definst_/fzasab6vz02yuf7/chunklist.m3u8?wowzasessionid=1419914830
I'm new to streaming but i have a decent enough background in programming and would like to figure a few things out.
First thing I noticed is when downloading this m3u8 and opening it with a text editor I will find something like this
#EXTM3U
#EXT-X-ALLOW-CACHE:NO
#EXT-X-TARGETDURATION:10
#EXT-X-MEDIA-SEQUENCE:6865
#EXTINF:10,
media_6865.ts?wowzasessionid=1419914830
#EXTINF:10,
media_6866.ts?wowzasessionid=1419914830
#EXTINF:7,
media_6867.ts?wowzasessionid=1419914830
Downloading these ts files manually with a download manager I get playable video files of 9s each which if I merge with ffmpeg I am able to get a high quality recording of the stream.
The other thing I notice about these files is that these links expire and so I guess this is how live streaming works: media packets are available on the server for a certain amount of time before they expire.
Now for my purposes I don't really care about being live I just want to be able to download the stream in high quality to watch it later. I'm willing to fall behind as much as the server would allow me without missing segments of video.
My internet unfortunately is not very fast and I noticed if I try to download with the download manager each ts file one at a time then many of them get expired by the time I get to them. However when downloading them 3-5 at a time overall speed is faster and I don't end up missing any.
Now I know manually downloading ts packets with a download manager then merging them is too much needless work because there are ways to record m3u8 streams out there, like ffmpeg.
I read about it and using the command line tool i figured out I can do this:
ffmpeg -i "http://50.7.69.186:1935/edge/_definst_/fzasab6vz02yuf7/chunklist.m3u8?wowzasessionid=1419914830" output.ts
and the stream starts saving to output.ts file.
the problem is the output ts file ends up skipping a lot of parts of the stream and on the command line log I see the following
"stream ends prematurely at...
skipping 3 segments, expired from playlist"
Also the output ts file doesn't have as good quality as the one I would get from downloading packets manually and merging them.
So this is where I need help.
I don't really care about catching the stream live and I am willing to fall behind as much as the stream would allow me to.
I need to know what settings I need to put on ffmpeg to maximize quality and also maximize download speed if possible (by downloading as many available packets as possible simultaneously, which is only achievable if I start downloading the last packet as soon as it becomes available even if the previous packets have not been completely downloaded yet)
I don't care if my recording is delayed with respect to the live stream as long as it's fully recorded.
So what settings should I put to optimize streaming with ffmpeg?
Sorry I am quite new at this and my post is probably more elaborate than it has to be but i'm trying to understand some things here.
Any help is appreciated.
Thank you!
+ Reply to Thread
Results 1 to 8 of 8
-
-
hi
Code:ffmpeg -i "http://50.7.69.186:1935/edge/_definst_/fzasab6vz02yuf7/chunklist.m3u8?wowzasessionid=1419914830" -c copy video.ts
Code:livestreamer "hls://http://50.7.69.186:1935/edge/_definst_/fzasab6vz02yuf7/chunklist.m3u8?wowzasessionid=1419914830" best -o video.ts
-
well that fixes the quality issue
but i'm still getting a lot of skipped segments
the download speed is too slow it seems to be downloading every packet sequentially
is there any way to make it download several packets at the same time? that would make it significantly faster. -
-
but the server broadcasts more than one packet at a time
if u start downloading all 3 packets at the same time it will be faster because total download speed is faster (much like a multithreaded download)
vs. if ur only using one thread and you don't start downloading the next packet till the current one finishes -
-
hi imadthemad ,
With livestreamer commands , have a look at :
http://livestreamer.readthedocs.org/en/latest/cli.html#stream-transport-options
Cheers .JE SUIS CHARLIE !!! -
yes! thank you!
--hds-segment-threads 10
this is exactly what i'm looking for. Download speed boosted by about 4x (from 30KB\s to 120KB\s) and it's enough to record without problem!
And thanks for that link to command line interface also it has that information and more customizable stuff that i'm sure to use.
you guys are awesome!
Similar Threads
-
How to record a M3U8 streaming on windows 7?
By cypherinfo in forum Video Streaming DownloadingReplies: 1Last Post: 2nd Jan 2015, 14:43 -
M3U8 FFMPEG Download Issue
By adi10289 in forum Video Streaming DownloadingReplies: 15Last Post: 10th Dec 2014, 01:42 -
FFMPEG HTTP Error 403 Forbidden for M3U8
By dmpiq in forum Video Streaming DownloadingReplies: 7Last Post: 23rd Jul 2014, 21:03 -
Issue with m3u8 playlist download using ffmpeg
By trinvh in forum Newbie / General discussionsReplies: 0Last Post: 5th Jun 2014, 09:23 -
how to decrypt m3u8 file using ffmpeg without merging the .ts chunks ?
By method in forum Video Streaming DownloadingReplies: 1Last Post: 21st May 2014, 06:57