Hacker News new | ask | show | jobs
by haunter 1602 days ago
I wish any of the projects would implement a feature to download parts of a video. Currently that's not possible

Request is open since 2013 https://github.com/ytdl-org/youtube-dl/issues/622

2 comments

It's possible with yt-dlp:

    --downloader ffmpeg --downloader-args "ffmpeg_i:-ss start_time -to end_time"
Though the ffmpeg downloader is quite slow and has no parallelization.
I have no idea what the code looks like for ytdl, but the concept seems straightforward enough for DASH/HLS segmented encodes. Determine the duration of each segment, do the math to find which segments would be required for the requested part, then do ytdl magic. I'd be more than happy to be forced to have a few seconds before/after the requested time just to avoid the necessity of breaking segments. Just straight download/concat.

We all know how well concept to working code goes though

Not so sure that'll work due to the fact that the first segment in a subset of segments is not the init segment (thus missing atoms like moov, ...)
Just cut it with ffmpeg? Ok you will have to download the whole thing first... but yeh