0
1
I use this command on ffmpeg to convert a video into images:
ffmpeg -i video.mp4 -q:v 1 -r 1 -f image2 frame-03d%.jpg
What I want to do is to skip the first x seconds and the last y seconds of the video from frame convertion, witch basically are intro and ending. Every video have different lenght but intro and ending are always the same in every video (about 30 seconds). Is there a way to do this?
It should be noted that for videos of varying length, you have to use a shell script or batch file to figure out the total duration in seconds and then subtract the 30 seconds from the end before calling ffmpeg. This is the "trickier" part of the question. – slhck – 2015-05-13T08:00:45.763
Its just en example. Anyways he is going to get intro and ending period. He can get clip duration from same iteration. – Alam – 2015-05-13T18:40:10.383
Yes, he can, but like I said, this is the more complicated issue here. So your answer would be more helpful if it showed how to get the duration, do the math, then pass that to ffmpeg. – slhck – 2015-05-14T14:56:05.697
@slhck I added command to get duration of video. Hope it helps. – Alam – 2015-05-14T16:51:09.313
Ok so the command should be -t x where x is calculated as VIDEO DURATION - 60 (30 seconds from the begin and 30 seconds from the end). But i don't get what the trim command does, what is 09:69? – Hyperion – 2015-05-14T17:17:10.923
@Hyperion It trims from 9 to 69 seconds. – slhck – 2015-05-14T17:32:48.410