Use Viddl to quickly download, cut, crop and resize videos
Viddl can be used at the command line or in Ruby
Viddl requires that both youtube-dl and ffmpeg are installed before using.
Install Viddl using gem
gem install viddl
or using Bundler by adding the following to your Gemfile
gem "viddl"
Running Viddl generates video clip files in the current directory
The command line usage and options are as follows
With no options, Viddl will download the original video
viddl https://www.youtube.com/watch?v=6g4dkBF5anU
This will start the clip at 10 seconds into the original video and run for five seconds
viddl https://www.youtube.com/watch?v=6g4dkBF5anU -s 10 -d 5
Alternatively, this will also start the clip at 10 seconds into the original video and stop at 15 seconds
viddl https://www.youtube.com/watch?v=6g4dkBF5anU -s 10 -e 15
This will resize to 640 x 480
viddl https://www.youtube.com/watch?v=6g4dkBF5anU -w 640 -h 480
This will crop a 40 x 40 pixel box at position 20 x 20
viddl https://www.youtube.com/watch?v=6g4dkBF5anU --cx 20 --cy 20 --cw 40 --ch 40
This will make the clip silent
viddl https://www.youtube.com/watch?v=6g4dkBF5anU --no-audio
Any or all of these options can be used together
viddl https://www.youtube.com/watch?v=6g4dkBF5anU -s 15 -e 22 --no-audio --cx 20 --cy 20 --cw 40 --ch 40 -w 640 -h 480
Similar to the command line, Ruby usage and options are as follows
options = {
start: 15,
end: 22,
audio: false,
crop: {
x: 20,
y: 20,
width: 40,
height: 40
},
width: 640,
height: 480,
output_path: "assets/video"
}
video = Viddl::Video.download("https://www.youtube.com/watch?v=6g4dkBF5anU")
video.create_clip(options)
Licensed under Apache 2.0, See the file LICENSE
Copyright (c) 2017 Ari Russo