Feature Request: Download a Portion of Video with youtube-dl #26735

Open
opened 2026-02-21 14:27:39 -05:00 by deekerman · 3 comments
Owner

Originally created by @progressive-galib on GitHub (Nov 9, 2023).

Feature Request: Download a Portion of Video with youtube-dl

Description:
I would like to request a new feature for youtube-dl that allows users to download a specific portion of a video by specifying a start time and an end time. This feature would be particularly useful for users who want to download only a certain segment of a longer video.

Proposed Implementation:
One way to implement this feature could be by introducing additional command-line arguments, such as --start-time and --end-time, to youtube-dl. Users would provide the start and end times in the format "HH:MM:SS," and youtube-dl would download the video from the specified start time to the end time.

Suggested Behavior:

  • Add an option to specify the start time and end time when downloading a video. For example:
youtube-dl --start-time 01:30 --end-time 02:00 https://www.youtube.com/watch?v=VIDEO_ID
Originally created by @progressive-galib on GitHub (Nov 9, 2023). **Feature Request: Download a Portion of Video with youtube-dl** **Description:** I would like to request a new feature for youtube-dl that allows users to download a specific portion of a video by specifying a start time and an end time. This feature would be particularly useful for users who want to download only a certain segment of a longer video. **Proposed Implementation:** One way to implement this feature could be by introducing additional command-line arguments, such as `--start-time` and `--end-time`, to youtube-dl. Users would provide the start and end times in the format "HH:MM:SS," and youtube-dl would download the video from the specified start time to the end time. **Suggested Behavior**: - Add an option to specify the start time and end time when downloading a video. For example: ```bash youtube-dl --start-time 01:30 --end-time 02:00 https://www.youtube.com/watch?v=VIDEO_ID ```
Author
Owner

@dirkf commented on GitHub (Nov 9, 2023):

  1. #30839
  2. Review #4821
@dirkf commented on GitHub (Nov 9, 2023): 1. #30839 2. Review #4821
Author
Owner

@progressive-galib commented on GitHub (Nov 10, 2023):

it'd be really really nice to have it natively, do you mind if i implement it myself and submit a pull request ?

@progressive-galib commented on GitHub (Nov 10, 2023): it'd be really really nice to have it natively, do you mind if i implement it myself and submit a pull request ?
Author
Owner

@dirkf commented on GitHub (Nov 29, 2023):

As originally suggested in #4821, there isn't see a realistic way to do this internally: an implementation will have to rely on ffmpeg (or something similar).

You could review the --split-chapters function of yt-dlp and maybe adapt that, with some way of specifying the clip region in the yt-dl command line.

Probably better is what I suggested in #4821: back-port the NAME: modifier for the various --...-args ... options: then it's straightforward to formulate --external-downloader-args so that ffmpeg downloads just the wanted time range.

What happens now is ffmpeg -i URL ARGS DEST; if -ss ... is in the ARGS position the whole stream is downloaded.

What we want is ffmpeg -ss START -i URL -t DURATION ARGS DEST or ffmpeg -ss START -to END -i URL ARGS DEST. The latter can be specified in yt-dlp by '--downloader-args ffmpeg_i "-ss START -to END"`.

Also review stale PR #30850.

@dirkf commented on GitHub (Nov 29, 2023): As originally suggested in #4821, there isn't see a realistic way to do this internally: an implementation will have to rely on _ffmpeg_ (or something similar). You could review the `--split-chapters` function of yt-dlp and maybe adapt that, with some way of specifying the clip region in the yt-dl command line. Probably better is what I suggested in #4821: back-port the `NAME:` modifier for the various `--...-args ...` options: then it's straightforward to formulate `--external-downloader-args` so that _ffmpeg_ downloads just the wanted time range. What happens now is `ffmpeg -i URL ARGS DEST`; if `-ss ...` is in the `ARGS` position the whole stream is downloaded. What we want is `ffmpeg -ss START -i URL -t DURATION ARGS DEST` or `ffmpeg -ss START -to END -i URL ARGS DEST`. The latter can be specified in yt-dlp by '--downloader-args ffmpeg_i "-ss START -to END"`. Also review stale PR #30850.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/youtube-dl-ytdl-org#26735
No description provided.