Create Video Clips with FFmpeg in Seconds

preview_player
Показать описание
Provide a file plus a start / end time and ffmpeg will do the rest. We'll also make a wrapper script.

Hit the subscribe button to receive more videos like this!

REFERENCE LINKS
---------------------------------------------------

COURSES
---------------------------------------------------
Courses I've created that focus on web dev and deployment topics.

THE TOOLS I USE / GEAR
---------------------------------------------------

FOLLOW ME ELSEWHERE
---------------------------------------------------

TIMESTAMPS
---------------------------------------------------
0:00 -- Intro
0:31 -- Installing FFmpeg
1:06 -- Learning how to make peanut butter and jelly
1:26 -- Cutting out the fluff
1:40 -- Building up the FFmpeg command
3:10 -- Viewing the clipped video
3:23 -- The command is a bit hard to remember
4:04 -- Using the wrapper script
5:20 -- Seeing the output of the script
6:01 -- Splitting the filename from the extension
6:44 -- The script works with absolute paths too
Рекомендации по теме
Комментарии
Автор

Hi, Nick! Me again 🙂. Do you know a way to split video with ffmpeg based on size not on time? Say, I got a huge file - +40G, and I want to split it to manageable chunks of 500Mbs. Yeap, I can do it manually sort of, calculating time. Or try and error with setting start and end time for each part. But there should be a way to split by size as easy as by timestamps.

samoylov
Автор

yes yes if you allready know what to cut lol. im going use video software find frames i need then use ffmeg cut it. yes you can or use that editing software ring away cut it lol. yes you can do it ffmpeg is like that. it do if tell if know what lol

JarppaGuru
Автор

Nice, I usually do something like this instead of firing up an entire linear editor just to cut some initial / final hiccups

Автор

I read the blog post and it confuses me. The end time seems to be earlier than the start time? ./mkclip example.mp4 -1 01:55:42 01:16:00

MoreChannelNoise
Автор

Thanks! Been using ffmpeg in a dialog like multipart script. It asks me whether I want to listen to a podcast or just download it. If downloaded it suggests to clip part of it. Most of the time it will be "The Making of a Nation" program. The clip part realized via:: ffmpeg -ss $seconds -i $currentDate2".mp3" $currentDate2"a.mp3"
And then I insert an image that accompanies the story + some additional metadata:: ffmpeg -i "$currentDate2"a.mp3 -i $image -map 0:0 -map 1:0 -c copy -id3v2_version 3 -metadata:s:v title="$title" -metadata:s:v comment="$comment"

samoylov
Автор

And one more thing IFS variable is very interesting in your script. If it is not too much to ask, could you explain, how it works, please? So, you declare a variable IFS, it by itself never used in the script. And what comes after "." is like magic. read -r -a input_split <<< "${input}" transforms your initial input into an array or list and you latter use input_split[0] to get first part (name of the file). I get what happens. But how this particular line works? It is the first time I encounter such notation.

samoylov