Friday, July 23, 2021

Download Part of Youtube video instead of whole

 This is a way to download selective frame of the youtube video that you need rather than downloading the whole video and trim it locally.

The sample command below start downloading at 00:06:40.00 and for the duration of 40 secs then output it to a file with filename of out.mp4.  

-f 22 is setting the resolution of the video to 720p. You can also use -f 18 for 360p mp4 resolution or -f 137 for 1080p mp4 resolution.

ffmpeg -ss 00:06:40.00 -t 40 -i $(youtube-dl -f 22 -g "") -acodec copy -vcodec copy -c copy out.mp4