VideoHelp Forum




+ Reply to Thread
Results 1 to 8 of 8
  1. Member
    Join Date
    Apr 2015
    Location
    Lebanon
    Search PM
    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!
    Quote Quote  
  2. hi

    Code:
    ffmpeg -i "http://50.7.69.186:1935/edge/_definst_/fzasab6vz02yuf7/chunklist.m3u8?wowzasessionid=1419914830" -c copy video.ts
    or

    Code:
    livestreamer "hls://http://50.7.69.186:1935/edge/_definst_/fzasab6vz02yuf7/chunklist.m3u8?wowzasessionid=1419914830" best -o video.ts
    Quote Quote  
  3. Member
    Join Date
    Apr 2015
    Location
    Lebanon
    Search PM
    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.
    Quote Quote  
  4. Originally Posted by imadthemad View Post
    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.
    it's a live streaming i think it is not possible to download faster than the server broadcasts
    Quote Quote  
  5. Member
    Join Date
    Apr 2015
    Location
    Lebanon
    Search PM
    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
    Quote Quote  
  6. Originally Posted by imadthemad View Post
    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
    can you post original url page
    or maybe

    Code:
    livestreamer --hls-segment-threads 10 "hls://http://50.7.69.186:1935/edge/_definst_/fzasab6vz02yuf7/chunklist.m3u8?wowzasessionid=1419914830" best -o video.ts
    Quote Quote  
  7. hi imadthemad ,

    With livestreamer commands , have a look at :
    http://livestreamer.readthedocs.org/en/latest/cli.html#stream-transport-options

    Cheers .
    JE SUIS CHARLIE !!!
    Quote Quote  
  8. Member
    Join Date
    Apr 2015
    Location
    Lebanon
    Search PM
    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!
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!