0

Goal:

Remove silent parts from video (while complying with the constraints below)

Constraints:

  1. Keep audio and video in sync.
  2. Don't remove silent parts smaller than x seconds.
  3. nice2have: treat sound with duration < x seconds as silence
  4. nice2have: add audio fading effect at cut points (with the length of x seconds, video can be hard-cut). Example: Visual explanation for fading effect
  5. super nice2have: only re-encode video at cut points

What I tried so far:

  • silenceremove: removes silence, but
    1. ❌ does not keep AV sync.
    2. ✅ I think start_duration did this trick
    3. ✅ I think stop_duration did this trick
    4. ~
    5. ~
  • `silencedetect:
    • I couldn't get this to work. I expected, that I could get some "frame stamps", that I could use to automatically get the video cut by ffmpeg.
  • I tried the software Reaper, which can actually do the job. However,
    1. It needs to re-encode the whole video
    2. The saved video is huge ( = very poorly compressed). Therefore I need another full reencoding.
    3. The process is manual

Misc:

  • Currently I'm using the following line to normalize audio. I would like to combine the silence removing with this one: ffmpeg -i "input.avi" -af loudnorm -codec:v copy "output.mp4"

Questions:

  1. Is this possible in ffmpeg only?
  2. How would a command for that look like?
  3. If not ffmpeg: are there other tools, that would accomplish the task?
3
  • Just to clarify, when sound is removed, the video part of the same length should be removed too and you'd have a hard cut, right? Maybe this helps for combining multiple video chunks into a file without reencoding: stackoverflow.com/questions/7333232/… – Matt Jan 23 at 11:53
  • Also, apparently Reaper can be automated, you can start it by command line and autorun an action after opening when you have the sws-extension installed and use the "project startup" action. However, I have never tried it. – Matt Jan 23 at 11:56
  • @Matt Yes, same video length should be cut. Hard video cuts are no problem. Concatenating videos would be ok, if I'd have a way to cut out all parts without silence. Reaper: Reaper enforces a re-encoding of its created result. I.e. a 1.5h video takes about 1.5h to 2.5h to process (too slow). – DarkTrick Jan 23 at 14:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.