Skip to content

Instantly share code, notes, and snippets.

@vinodnimbalkar
Created July 7, 2021 15:39
Show Gist options
  • Save vinodnimbalkar/107de5dbce669ec3f1c0d500158c7a8d to your computer and use it in GitHub Desktop.
Save vinodnimbalkar/107de5dbce669ec3f1c0d500158c7a8d to your computer and use it in GitHub Desktop.
Create Video clip from youtube video
#!/bin/bash
# make sure you have 'ffmpeg & youtube-dl' installed.
# Create Video clip from youtube video
read -p "Enter Url to Create Video Clip : " URL
read -p "Enter start time in HH:MM:SS format : " start_time
read -p "Enter duration in seconds from start time : " duration
read -p "Enter Video Clip name with .mp4 extension : " filename
ffmpeg -i $(youtube-dl -f best --get-url "$URL")\
-ss $start_time -t $duration $filename
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment