Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Compression Techniques clipping selected portions of a video

  • clipping selected portions of a video

    Posted by Peter Robertson on June 5, 2012 at 7:08 pm

    I am able to clip 20 seconds of a video after the first minute of the video using the following:

    ffmpeg -ss 00:01:00.0 -t 00:00:20.0 -acodec copy -vcodec copy -i input.mov output.mov

    Is there a way to do the same but say clip 10 seconds (of a 1 hour video) EVERY THREE MINUTES and out put to a new video?

    Thanks.

    Pedro

    Pedro

    Peter Robertson replied 13 years, 11 months ago 2 Members · 3 Replies
  • 3 Replies
  • Stephen Dixon

    June 5, 2012 at 10:31 pm

    You’ll probably want to look at a shell script for that.

    What environment are you in? In a bash shell (eg on a linux or OSX machine) you might want to use a “for” loop like:

    for (( i=0; i<3600; i+=180 ))
    do ffmpeg -ss $i -t 10 -acodec copy -vcodec copy -i input.mov output_$i.mov
    done

    That will make separate movies however. You would have to use ffmpeg to join them all together if you wanted one movie as per this page.

  • Peter Robertson

    June 6, 2012 at 2:59 pm

    Thanks!

    That works like a charm. One more question. I’m trying to make my output files smaller–currently they are 1280 x 720 and I’d like to make them say 850 x 478. I don’t understand where to set that variable?

    Pedro

    Pedro

  • Peter Robertson

    June 6, 2012 at 4:08 pm

    This one i figured out by using the scale filter i.e.

    vf scale=800:450

    Thanks.

    Pedro

    Pedro

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy