Skip to content

Useful tool for video editing include removing or keeping the silent parts and pre-timing subtitles.

License

Notifications You must be signed in to change notification settings

NickyAlan/pycutter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pycutter

Using Python: audio2numpy, NumPy, and MoviePy for Removing or Preserving Silent Parts in .mp4 or .mp3 Files

  • The idea behind this project is to find the threshold for the cut point in order to remove parts of the audio that are quieter.
  • By determining the shortest duration for cutting the silent parts, such as removing parts longer than 0.5 seconds of silence, we can extract the speech segments.
  • In addition, this idea can make creating .srt files for pre-timed subtitles make your life easier when making subtitles
  • This Python script can be used to process both MP4 and MP3 files.
  • You can either clone the repository or use it on Google Colab
  • For a demonstration of the functionality, please watch the demo video on YouTube

Removing or Preserving Silent Parts

cut = CutterIt(filepath='video.mp4')
array = cut.array
undercuts = cut.get_under_cuts(array)
keeps_sec = cut.get_keeps_sec(undercuts)
cut.cutter('keep_cutter.mp4', keeps_sec, file_type='mp4') # or .mp3

# if want only silent part
cut.cutter('silent_part.mp4', undercuts, file_type='mp4')

Pre-timed subtitles

tsub = Timesub(filepath='video.mp4')
keeps_sec_subtitle = tsub.get_timesub()
tsub.get_srtfile('timesub.srt', keeps_sec_subtitle)

About

Useful tool for video editing include removing or keeping the silent parts and pre-timing subtitles.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published