Goal:
Remove silent parts from video (while complying with the constraints below)
Constraints:
- Keep audio and video in sync.
- Don't remove silent parts smaller than x seconds.
- nice2have: treat sound with duration < x seconds as silence
- nice2have: add audio fading effect at cut points (with the length of x seconds, video can be hard-cut). Example:
- super nice2have: only re-encode video at cut points
What I tried so far:
silenceremove
: removes silence, but- ❌ does not keep AV sync.
- ✅ I think
start_duration
did this trick - ✅ I think
stop_duration
did this trick - ~
- ~
- `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,- It needs to re-encode the whole video
- The saved video is huge ( = very poorly compressed). Therefore I need another full reencoding.
- 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:
- Is this possible in ffmpeg only?
- How would a command for that look like?
- If not ffmpeg: are there other tools, that would accomplish the task?