Answers.Body: <p>For those coming across this, this is using ffmpeg 6.1.1 and allows from and to timestamps and appears to be very efficent</p>
  <pre><code>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
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-03-21T03:35:15.977Z
Answers.LastActivityDate: 2024-03-21T03:35:15.977Z
Answers.UserDisplayName: kiwicmc
Answers.Body: <p>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.</p>
  
  <p>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):</p>
  
  <pre><code>ffmpeg -ss &lt;start-position&gt; -i &lt;source-filename&gt; -vcodec copy -acodec copy -t &lt;duration&gt; &lt;destination-filename&gt;
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2012-02-12T02:15:25.500Z
Answers.Text: 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`...?
Answers.UserDisplayName: Questioner
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2012-02-12T06:48:00.807Z
Answers.Text: The documentation for ffmpeg is at http://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.
Answers.UserDisplayName: Miguel
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2012-02-12T08:46:14.907Z
Answers.Text: 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.
Answers.UserDisplayName: Questioner
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2012-02-11T18:14:06.523Z
Answers.LastActivityDate: 2012-02-12T06:48:18.497Z
Answers.LastEditDate: 2012-02-12T06:48:18.497Z
Answers.UserDisplayName: Miguel
Body: <p>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.</p>
  
  <p>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).</p>
  
  <p>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.</p>
  
  <p>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?</p>
  
  <p>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.</p>
  
  <p>Additional note, in case it matters: I don't need the sound, just the image.</p>
  
Tags: <editing>
Title: What is a good efficient way to isolate clips from long movies?
UserDisplayName: Questioner
ThreadText: # What is a good efficient way to isolate clips from long movies?
  
  (Asked by: username_0 on 2012-02-11)
  
  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.
  
  **Tags:** editing
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2012-02-11. Score: 3 | Accepted answer
  
  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>
  
  ```
  
  > **Comments:**
  > **username_0**: 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`...?  
  > **username_2**: The documentation for ffmpeg is at http://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.  
  > **username_0**: 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.  
  
  ---
  
  ### Answer by username_1 on 2024-03-21. Score: 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
  
  ```
  
  
  ---
  
  