A
A
accountnujen2022-02-26 17:13:34
fmpeg
accountnujen, 2022-02-26 17:13:34

How to cut a video knowing the final file size?

Depending on the picture on the video - the file has a different size. Video compression did not work , so I decided to go the other way: by cutting the video into pieces.

If the file size exceeds 49MB, then I need to cut it into pieces equal to 49. If the file weighs, conditionally, 89MB with a duration of 315 seconds, then you can get two files this way: 315/(89/49) . It turns out that I have to divide the video into 175 seconds and 140. And everything would be fine, but for the test I took a video for 315 seconds and cut it into pieces of 10 seconds: the files have a size of 2 to 3mb. You can, of course, play it safe and divide by 40, but I'm not sure that a scenario is impossible in which part of the video will have a larger size than the rest.

If we assume that there will not be a huge difference and I will always receive ~ 40mb files, then I have a second problem: I would like the length of the last file to be more than 10 seconds. I mean such a scenario, when the video, when divided into equal pieces, has a conditional remainder of 3 seconds. I would like to clarify whether it is possible to somehow increase the last piece, due to the penultimate one: the last one is 7 more, the penultimate one is 7 less.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question