2

I am making a video that is an analysis of various films. My hope is to get clips from the movies to demonstrate various points I'm talking about.

I'm using Kdenlive on Ubuntu. One issue is that it seems like loading a whole movie length video slows it down making it hard to move around to the right frames (the computer is an i5 with 4GB RAM, so it's not a particularly slow computer).

The main problem, though, is that I want to select sections and edit them out so I can have them as clips ready to include in my master edit. However, if I go through the render process, I'll end up affecting the compression and video quality settings.

Is there a way I can specify a start and end point in hours, minutes, and seconds, and then output that portion into a new file, without changing the quality of the video?

Perhaps something at the command line? That way I could scan through the video using a more efficient player like VLC or something, and pick out my start and stop times there.

Additional note, in case it matters: I don't need the sound, just the image.

2 Answers 2

3

What format is your long video? The seeking performance problem may not be in Kdenlive but in your movie. If you aren't yet, you should consider using a container format that has index tables.

Now regarding extracting a clip from a movie, I believe you can do that with ffmpeg, specifying a codec named "copy" and setting a start position and a duration (in seconds):

ffmpeg -ss <start-position> -i <source-filename> -vcodec copy -acodec copy -t <duration> <destination-filename>
3
  • The videos are in a variety of formats - matroska, MP4, and avi. Thank you for the code, I'm trying to make it work, though it seems to be balking on the audio output codec. Also, I assume the time format is hh:mm:ss...?
    – Questioner
    Commented Feb 12, 2012 at 2:15
  • 1
    The documentation for ffmpeg is at ffmpeg.org/ffmpeg.html. It looks like you should put the -ss option before the -i as that does a direct seek into the start position. The format of -ss and -t can be in seconds or hh:mm:ss.xxx.
    – Miguel
    Commented Feb 12, 2012 at 6:48
  • Cheers for that. I think eventually I'll be able to tweak the settings to be able to extract clips as needed. This looks like the way to go.
    – Questioner
    Commented Feb 12, 2012 at 8:46
0

For those coming across this, this is using ffmpeg 6.1.1 and allows from and to timestamps and appears to be very efficent

ffmpeg -i original.mp4 -ss 00:00:02.285 -to 00:00:12.925 -c copy first_clip.mp4 -ss 00:00:19.905 -to 00:00:53.245 -c copy second_clip.mp4 -ss 00:01:03.065 -to 00:01:14.625 -c copy third_clip.mp4 -ss 00:01:17.615 -to 00:01:53.585 -c copy fourth_clip.mp4 -ss 00:03:14.345 -to 00:03:43.73 -c copy fifth_clip.mp4

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.