0
votes

So i recently started using ffmpeg to download live streaming videos but the problem i am facing is that , the downloaded video stucks a lot especially for lengthy videos like 2 hours.

The command which i currently use to download streaming files :-

ffmpeg -i "https://link.m3u8" -c copy output.mkv

This command worked perfectly for 35 min lengthy video [without any stucking problem] but failed for 2 hours lengthy video

Also it showed "Invalid length" error when i tried to encode that 2 hour lenghty video using x264 lib command :-

ffmpeg -i output.mkv -c:v libx264 -preset slow -crf 22 -c:a -c:v copy ReOutput.mkv

[matroska,webm @ 00000000003d0940] Invalid length 0x29e39 > 0x1b55200a in parent

so is there any way to fix this problem through encoding ?

1

1 Answers

0
votes

First of all stucking is not the word you use , its called lag and encoding the video will not fix this issue. The problem to this lag is "Poor Connection" or "Low-End PC".

If you are having Poor Connection or Low-End PC then the video will delay or skip some seconds.

So i recommend you to download those live streaming videos using faster network with Mid-End or Decent PC.