Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I have list of video files (loaded from database), each with start and end time of requested interval:

  # file   begin  end
  v1.mp4   1:01   2:01
  v2.mp4   3:02   3:32
  v3.mp4   2:03   5:23

And I need to create single video file containing these intervals:

 [0:00]---v1---[2:00]---v2---[2:30]---v3---[5:50]

I preffer usig ffmpeg, since it is installed on server. Caller program is written in PHP.

It is easy to cut one input to one output (argument escaping removed for clarity):

  exec("ffmpeg -ss $begin -i $input_file -ss $begin -c copy $output_file");

I there any easier way than executing ffmpeg for each interval and then execute it once more to concatenate prepared clips together? I really do not like to have a lot of temporary files or dealing with complex process handling.

share|improve this question
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.