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 ?