Make a clip from a video with FFMPEG

kollo

I want to make a clip from a video with FFmpeg with 2-second video every m minutes, where

m = video_length / 5

For example I have a video that is 10 minutes long. The video clip will have 10 seconds total length (5 segments by 2 seconds) and will be composed of these video timestamp ranges:

00:00 - 00:02
02:00 - 02:02
04:00 - 04:02
06:00 - 06:02
08:00 - 08:02

This will produce a sort of trailer from the video.

I know I can achieve that with segment but can't figure out the whole process.

Gyan

You can do this using the select filter, in one go

ffmpeg -i in.mp4
       -vf select='lt(mod(t,120),2)',setpts=N/FRAME_RATE/TB
       -af aselect='lt(mod(t,120),2)',asetpts=N/SR/TB
       out.mp4

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Create thumbnail from video using ffmpeg

From Dev

How to capture/record clip from Video URL in Android and save to phone

From Dev

Extract alpha from video ffmpeg

From Dev

Make video from images with ffmpeg/imagemagic

From Dev

ffmpeg, how to extend video, the same clip multiple times concat

From Dev

ffmpeg- make video from images in different folders

From Dev

Command of FFMPEG to make a video from Image(JPEG) + Audio(.mp3) & Share video in Whatsapp

From Dev

Clip a video texture into two

From Dev

ffmpeg-python: Test if video clip has audio

From Dev

ffmpeg crop video from top screen

From Dev

FFmpeg make video from images skip middle or rear range

From Dev

FFMPEG add audio to a video but clip it to the video length

From Dev

How to clip a movie from specified start time in ffmpeg?

From Dev

How to resize a video to make it smaller with FFmpeg

From Dev

FFMPEG | How to encode a video to make it faster

From Dev

How to open a video clip from command line using VLC Player?

From Dev

FFmpeg Using Java Runtime to Make Video From PNG on Mac with Spaces in Directory Names

From Dev

Make images to video using FFMPEG on android not working

From Dev

how to create an audio clip from a video file using command line?

From Dev

Rails using ffmpeg to make a screenshot of a video

From Dev

FFMPEG: Error Making A Video Clip: Invalid duration specification for t:

From Dev

ffmpeg is not removing some seconds from the beginning of this video. Why and how can I make it do so?

From Dev

Make Multiple thumbnails from video with ffmpeg

From Dev

FFMPEG not extracting all the frames from a video

From Dev

Using puppeteer to screenshot page and using ffmpeg to generate a video from the screenshot images. how to make smoothly video?

From Dev

Extract final frame from a video using ffmpeg

From Dev

Make total video duration instantly known in video player (ffmpeg / html)

From Dev

Can't import to Unity video clip rendered using FFmpeg for Unity

From Dev

ffmpeg video scale and padding to make it work for twitter

Related Related

  1. 1

    Create thumbnail from video using ffmpeg

  2. 2

    How to capture/record clip from Video URL in Android and save to phone

  3. 3

    Extract alpha from video ffmpeg

  4. 4

    Make video from images with ffmpeg/imagemagic

  5. 5

    ffmpeg, how to extend video, the same clip multiple times concat

  6. 6

    ffmpeg- make video from images in different folders

  7. 7

    Command of FFMPEG to make a video from Image(JPEG) + Audio(.mp3) & Share video in Whatsapp

  8. 8

    Clip a video texture into two

  9. 9

    ffmpeg-python: Test if video clip has audio

  10. 10

    ffmpeg crop video from top screen

  11. 11

    FFmpeg make video from images skip middle or rear range

  12. 12

    FFMPEG add audio to a video but clip it to the video length

  13. 13

    How to clip a movie from specified start time in ffmpeg?

  14. 14

    How to resize a video to make it smaller with FFmpeg

  15. 15

    FFMPEG | How to encode a video to make it faster

  16. 16

    How to open a video clip from command line using VLC Player?

  17. 17

    FFmpeg Using Java Runtime to Make Video From PNG on Mac with Spaces in Directory Names

  18. 18

    Make images to video using FFMPEG on android not working

  19. 19

    how to create an audio clip from a video file using command line?

  20. 20

    Rails using ffmpeg to make a screenshot of a video

  21. 21

    FFMPEG: Error Making A Video Clip: Invalid duration specification for t:

  22. 22

    ffmpeg is not removing some seconds from the beginning of this video. Why and how can I make it do so?

  23. 23

    Make Multiple thumbnails from video with ffmpeg

  24. 24

    FFMPEG not extracting all the frames from a video

  25. 25

    Using puppeteer to screenshot page and using ffmpeg to generate a video from the screenshot images. how to make smoothly video?

  26. 26

    Extract final frame from a video using ffmpeg

  27. 27

    Make total video duration instantly known in video player (ffmpeg / html)

  28. 28

    Can't import to Unity video clip rendered using FFmpeg for Unity

  29. 29

    ffmpeg video scale and padding to make it work for twitter

HotTag

Archive