user33635: 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?


user38154: Based on a ffmpeg users IRC conversation, looks like silenceremover doesn't keep the presentation timestamps after doing its thing, probably because it was thought to be used only for audio, so the muxer afterwards has no way to know that some frames should be dropped. So no, ffmpeg is not going to work like this.
I found a few github repos doing this kind of thing, and I had the best result with this one. Looks like it might even do some of you nice-to-haves.

33635: <h3>Goal:</h3>
<p>Remove silent parts from video (while complying with the constraints below)</p>
<h3>Constraints:</h3>
<ol>
<li>Keep audio and video in sync.</li>
<li>Don't remove silent parts smaller than x seconds.</li>
<li>nice2have: treat sound with duration &lt; x seconds as silence</li>
<li>nice2have: add audio fading effect at cut points (with the length of x seconds, video can be hard-cut). Example:  <a href="https://i.stack.imgur.com/aigTS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aigTS.png" alt="Visual explanation for fading effect" /></a></li>
<li>super nice2have: only re-encode video at cut points</li>
</ol>
<h3>What I tried so far:</h3>
<ul>
<li><code>silenceremove</code>: removes silence, but
<ol>
<li>❌ does not keep AV sync.</li>
<li>✅ I think <code>start_duration</code> did this trick</li>
<li>✅ I think <code>stop_duration</code> did this trick</li>
<li>~ </li>
<li>~ </li>
</ol>
</li>
<li>`silencedetect:
<ul>
<li>I couldn't get this to work. I expected, that I could get some &quot;frame stamps&quot;, that I could use to automatically get the video cut by ffmpeg.</li>
</ul>
</li>
<li>I tried the software <code>Reaper</code>, which can actually do the job. However,
<ol>
<li>It needs to re-encode the whole video</li>
<li>The saved video is huge ( = very poorly compressed). Therefore I need another full reencoding.</li>
<li>The process is manual</li>
</ol>
</li>
</ul>
<h3>Misc:</h3>
<ul>
<li>Currently I'm using the following line to normalize audio. I would like to combine the silence removing with this one:
<code>ffmpeg -i &quot;input.avi&quot; -af loudnorm -codec:v copy &quot;output.mp4&quot;</code></li>
</ul>
<h3>Questions:</h3>
<ol>
<li>Is this possible in ffmpeg only?</li>
<li>How would a command for that look like?</li>
<li>If not ffmpeg: are there other tools, that would accomplish the task?</li>
</ol>
 38154: <p>Based on a ffmpeg users IRC conversation, looks like silenceremover doesn't keep the presentation timestamps after doing its thing, probably because it was thought to be used only for audio, so the muxer afterwards has no way to know that some frames should be dropped. So no, ffmpeg is not going to work like this.</p>
<p>I found a few github repos doing this kind of thing, and I had the best result with <a href="https://github.com/WyattBlue/auto-editor" rel="nofollow noreferrer">this one</a>. Looks like it might even do some of you nice-to-haves.</p>
