Giter Site home page Giter Site logo

final-cut-it-out's Introduction

Final Cut It Out

An automatic silence remover for Final Cut Pro X.

Origins

This project has its origins in jashmenn's final-cut-it-out.js script.

All credit goes to him and those who have left follow-up comments on his Gist.

Prerequisites

This script is meant to work with Final Cut Pro X (on a Mac), and requires the use of ffmpeg to detect silent portions of the clip.

You can install Final Cut Pro X from the app store, and ffmpeg using Homebrew: brew install ffmpeg.

You should clone or download this project to somewhere on your computer, and in the Terminal, change directories into this project's directory.

Usage

The following is how I use this script. You could have a simpler or more complex workflow, depending on your needs.

  1. Insert the video clip with silent portions into an open project timeline in Final Cut Pro X.
  2. Export the video to a low-resolution file that can be processed via ffmpeg.
  3. Run the following ffmpeg command to detect silence in your video: ffmpeg -i [exported video file here.mp4] -af silencedetect=n=-35dB:d=800ms -f s16le -y /dev/null 2>&1 | tee silence.txt
  4. Run ./final-cut-it-out.js silence.txt and watch as the script makes cuts through the timeline at the margins of each silent section, then goes back and deletes all the silent portions.
  5. Run through the timeline and adjust the gaps using the select/trim tool as desired.

Configuration

Before running this script, you should always have a backup Project/timeline in FCPX since this will make destructive edits to your video timeline! Cmd-Z should not be relied on in case of disaster—you've been warned!

I currently record at 23.98p, so some of the settings within moveToTimecode() have been changed accordingly. The original script was written with 60p footage in mind.

Someday it would be nice to modify the script to account for different frame rates... but for now, you'll need to modify the script if you shoot at 30p or 60p.

The other parameters you may wish to tweak, based on your own speaking style and the rhythm of your speech:

  • In the ffmpeg command, silencedetect=n=-35dB:d=800ms: change the dB setting to a higher or lower threshold if you have softer or louder audio and are getting parts cut out that you do not want cut. Adjust the d value (how long a portion is silent before it is marked for deletion) as needed.
  • In the script, adjust the startMargin and endMargin to your liking. I like a little bit of space before and after the audio, but some people like a bit more of a 'jump' cut style so should reduce these values a bit.

final-cut-it-out's People

Contributors

geerlingguy avatar

Stargazers

Jan avatar Nadav avatar Nathan Davenport avatar Louis Gan avatar Muhammad Tayyab Sheikh avatar Cyrus avatar Julien avatar Conor O'Sullivan avatar  avatar erikiado avatar  avatar  avatar Umar Hansa avatar Ryan avatar Hritvik Patel avatar Adam avatar Emilio P Egido avatar Deyson avatar Rodrigo Gouveia avatar Justin Woodward avatar Bhargav avatar  avatar Yuki Takeyama avatar Matt Manuel avatar Jacek Ciuba avatar TechStudent10 avatar Wolfgang avatar  avatar Ron Green avatar  avatar  avatar Christopher Felegy avatar Guillaume Dumoulin avatar Pendragonscode avatar Daniel Calderon avatar Conan avatar Ken Moini avatar  avatar

Watchers

 avatar Sean Johnson avatar James Cloos avatar  avatar

final-cut-it-out's Issues

Consider generating a .fcpXML file for the EDL instead

Instead of using Applescript to manually input tons of keypresses to do all the blade cuts and deletions (a process that is prone to error, if you accidentally screw anything up during the process), it would be nice if this script generated a valid .fcpXML file with the cuts in it, which you could import into FCPX and have it make the cuts for you.

See: https://developer.apple.com/documentation/professional_video_applications/fcpxml_reference/creating_fcpxml_documents

Make it so sound must exist for minimum amount of time to include

One thing I've noticed is this script will leave in a lot of bits when I set down an item, cough, or take a drink of water between takes.

It would be nice if it didn't. Maybe have a configurable threshold like "if the clip is less than 1 second, cut it"?

My solution right now is to select those spaces with the Range tool in Final Cut Pro before I export an audio file to process with ffmpeg, and mute the audio in them manually by dragging the audio volume to silence / 0.

Screen Shot 2023-04-03 at 2 52 07 PM

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.