Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I wonder if its possible to losslessly download & cut video from remote server. Currently i'm using a bash script with ffmpeg i've got from stackoverflow to download a small portion of video from the likes of YouTube. But currently, it has to re-encode the video on the fly while downloading. For now, I assume it's impossible to losslessly download & cut this kind of video because we don't have the information about the video locally (keyframes, etc). But I like to be proven wrong!



I've used this before with yt-dlp to extract some video (313 is only the 4k video stream but I assume it would work with videos that have audio streams as well):

    ffmpeg -ss 5:40 -i $(yt-dlp -f 313 -g  https://www.youtube.com/watch?v=3SykjY3GdMs) -acodec copy -vcodec copy -t 20 waterdrop_mountainlake.mkv




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: