Split the video using ffmpeg.

Asked 2 years ago, Updated 2 years ago, 99 views

When dividing a video with ffmpeg, can I divide the specified number of seconds by the specified number of times?
For example, suppose you have a 30-minute TS video.
Can I specify that the video should be split five times per minute from the beginning?

ffmpeg video

2022-09-30 21:26

1 Answers

I'm not going to give you an example because I don't know the environment, but you can do that by creating a script that dynamically generates time-sensitive options.

This section describes how ffmpeg alone can be used.By limiting the entire range of the video with the time specification -ss/-t and dividing it in the segment format, I think it is close to specifying the number of times.Specifically

$ffmpeg-i input.ts-ss0-t 300-f segment-segment_time 60 output_%02d.ts

as shown in .In this case, split the opening five minutes every minute, or five times, regardless of the input.ts time.The rest is

$ffmpeg-i input.ts-ss 300 output_remain.ts

available on the .

However, splitting without encoding is often not exactly splitting due to the constraints of the video codec.If you need to keep it in exactly one minute, specify an option to re-encode the video.

See the document for details on each option and format.I hope this will be helpful.


2022-09-30 21:26

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.