ytdl-org / youtube-dl

Command-line program to download videos from YouTube.com and other video sites
http://ytdl-org.github.io/youtube-dl/
The Unlicense
131.39k stars 9.96k forks source link

whats the command that i want to download the 30 seconds of video thank you #19139

Closed asssdasad closed 5 years ago

asssdasad commented 5 years ago

whats the command that i want to download the 30 seconds of video thank you

dstftw commented 5 years ago

No such comand.

alexvong243f commented 5 years ago

@asssdasad

You can first download with youtube-dl and then use ffmpeg to cut the first 30 seconds of the video. See https://unix.stackexchange.com/questions/1670/how-can-i-use-ffmpeg-to-split-mpeg-video-into-10-minute-chunks for details.

alexvong243f commented 5 years ago

@asssdasad

I figure out how to download only the first 30 seconds of the video without cutting in #19166.

Assuming you have ffmpeg installed. The following shell command should download the first 30 seconds of the video and output it as out.mkv:

youtube-dl -o - -f best 'https://www.youtube.com/watch?v=BaW_jenozKc' | ffmpeg -i - -ss 0 -t 30 -c copy out.mkv

Does it work for you?