0

I'm trying to create an mp4 clip from an HLS input stream that is over 36 hours long. My ffmpeg command looks more or less like this:

ffmpeg -live_start_index 0 -ss 32:22:19.82667 -i https://example.com/main.m3u8 -t 00:00:55.65625 output.mp4

I don't know why but ffmpeg is non-stop requesting segments even though I'm setting the length of this clip to be 55 seconds. Does anyone have an idea what I'm doing wrong here?

1
  • Hey just wondering if you came up with a solution for this? I also found this discussion but there was no definitive answer to why its happening and how to solve it stackoverflow.com/questions/38224809/…
    – jcaruso
    Commented Jun 15, 2021 at 15:38

1 Answer 1

0

I found that using the "HLS protocol" instead of the "HLS demuxer" worked better for seeking.

To use the "HLS protocol" prefix the HLS playlist url with hls+https:// instead of just https:// (which uses the HLS demuxer apparently), and doing that got the seek working for me. It was clearly not downloading the entire file as I noticed it made a fraction of the http requests that it was making before (with -loglevel verbose set)

Do note, if you use the hls protocol, ffmpeg reports this:

Using the hls protocol is discouraged, please try using the hls demuxer instead. The hls demuxer should be more complete and work as well as the protocol implementation. (If not, please report it.)

So maybe I should report the seeking issue to them if they're not already aware 😀

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.