Answers.Body: <p>To correctly detect the scene changes (almost correctly some changes were still not detected) I used Davinci Resolve. Then I had to type the wanted scene's start frame and end frame into a program that automatically cut it.</p>
  
  <p>From Davinci Resolve it was extremely hard to copy the frame numbers as they could not be selected. I am sure there is a better way of getting the start frames and end frames from Davinci Resolve but I couldn't find it.</p>
  
  <p>The cutting can be done using <code>ffmpeg</code>:</p>
  
  <p><code>ffmpeg -i example.mp4 -vf trim=start_frame=10:end_frame=50 -an -fflags +genpts output.mp4</code></p>
  
  <p>But it takes really long to get a clip from the end of a long movie for example.</p>
  
  <p>It can also be done using applescript and that is much faster:</p>
  
  <pre><code>tell application "QuickTime Player"
      activate
  
      set startFrame to 84361
      set endFrame to 84452
  
      set fps to 23.976
  
      set startTime to startFrame / fps
      set endTime to endFrame / fps
  
      set inFile to "Users:me:Documents:folder:infile.mov"
      set outFile to "Users:me:Documents:folder:outfile.mov"
  
      try
          set theOpenedFile to open for access file outFile with write permission
          set eof of theOpenedFile to 0
      end try
  
      open file inFile
      trim front document from startTime to endTime
      export front document in outFile using settings preset "1080p"
  
      try
          close access theOpenedFile
      end try
  
      close every document saving no
  end tell
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-03-01T21:41:40.453Z
Answers.LastActivityDate: 2019-03-01T21:41:40.453Z
Answers.UserDisplayName: Hadus
Body: <p>I have a long live feed recorded.</p>
  
  <p>It has different camera angles switching after one another but unpredictable timing.</p>
  
  <p>The cameras do not zoom or move so what is recorded has parts that don't change that could be used to identify camera angles. There should be a way to cut the film into small segments and group them by angle.</p>
  
  <p>I could do this using iMovie by hand but that would take forever as I would like to do this for many hours of this live feed.</p>
  
  <p>Is there a way to do this using some free software?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-02-28T16:20:56.490Z
Comments.Text: https://pyscenedetect.readthedocs.io/en/latest/ seems like a free option, if it works ill write it as an answer...
Comments.UserDisplayName: Hadus
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-02-28T21:03:03.810Z
Comments.Text: It works but doesn't seem to correctly slice it
Comments.UserDisplayName: Hadus
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-02-28T22:11:55.397Z
Comments.Text: To almost perfectly slice it I used davinci resolve but that makes exporting the small individual scenes not viable. I think from there I will somehow copy the time of the scene changes and use another program to cut it.
Comments.UserDisplayName: Hadus
Tags: <editing><software-recommendation>
Title: How to slice a video at camera angle changes
UserDisplayName: Hadus
ThreadText: # How to slice a video at camera angle changes
  
  (Asked by: username_0 on 2019-02-28)
  
  I have a long live feed recorded.
  
  It has different camera angles switching after one another but unpredictable timing.
  
  The cameras do not zoom or move so what is recorded has parts that don't change that could be used to identify camera angles. There should be a way to cut the film into small segments and group them by angle.
  
  I could do this using iMovie by hand but that would take forever as I would like to do this for many hours of this live feed.
  
  Is there a way to do this using some free software?
  
  **Tags:** editing, software-recommendation
  
  > **Comments:**
  > **username_0**: https://pyscenedetect.readthedocs.io/en/latest/ seems like a free option, if it works ill write it as an answer...  
  > **username_0**: It works but doesn't seem to correctly slice it  
  > **username_0**: To almost perfectly slice it I used davinci resolve but that makes exporting the small individual scenes not viable. I think from there I will somehow copy the time of the scene changes and use another program to cut it.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2019-03-01. Score: 0 | Accepted answer
  
  To correctly detect the scene changes (almost correctly some changes were still not detected) I used Davinci Resolve. Then I had to type the wanted scene's start frame and end frame into a program that automatically cut it.
  
  From Davinci Resolve it was extremely hard to copy the frame numbers as they could not be selected. I am sure there is a better way of getting the start frames and end frames from Davinci Resolve but I couldn't find it.
  
  The cutting can be done using `ffmpeg`:
  
  `ffmpeg -i example.mp4 -vf trim=start_frame=10:end_frame=50 -an -fflags +genpts output.mp4`
  
  But it takes really long to get a clip from the end of a long movie for example.
  
  It can also be done using applescript and that is much faster:
  
  ```
  tell application "QuickTime Player"
      activate
  
      set startFrame to 84361
      set endFrame to 84452
  
      set fps to 23.976
  
      set startTime to startFrame / fps
      set endTime to endFrame / fps
  
      set inFile to "Users:me:Documents:folder:infile.mov"
      set outFile to "Users:me:Documents:folder:outfile.mov"
  
      try
          set theOpenedFile to open for access file outFile with write permission
          set eof of theOpenedFile to 0
      end try
  
      open file inFile
      trim front document from startTime to endTime
      export front document in outFile using settings preset "1080p"
  
      try
          close access theOpenedFile
      end try
  
      close every document saving no
  end tell
  
  ```
  
  
  ---
  
  