0

I want to split a large .mp4 video(length is unknown) into multiple small .mp4 videos. But I want to do it by dividing the length of the video by the number of parts required e.g:

largevideo.mp4 = 4 Minutes
n =  2

then I will have a two, 2 minutes small.mp4 video. Wherever I am looking is giving me a time-based splitting, while I want to do number-based splitting using FFmpeg. Can anybody help?

  • AFAIK ffmpeg doesn't directly have this capability. Achieving this requires a bit of scripting, and it depends on your OS and on your knowledge of script langages (bash etc...) – PierU Oct 05 '22 at 11:13
  • I want to use this command in a winform app – Farhan Basheer. Oct 05 '22 at 11:36
  • What is winform app? – Ricardo Bohner Oct 05 '22 at 11:45
  • Inside a script you could use ffprobe to get the duration, next divide that by number of parts you want, next use the result with -segment_time to divide the video. – Ricardo Bohner Oct 05 '22 at 11:47
  • How do i use the result of ffprobe with ffmpeg command? Can you share any example? – Farhan Basheer. Oct 05 '22 at 12:23
  • From [this question](https://superuser.com/questions/650291/how-to-get-video-duration-in-seconds) `ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 input.mp4`... How to use the result in Winform, I don't know, I know nothing about Winform. – PierU Oct 05 '22 at 13:02

0 Answers0