WyattBlue / auto-editor

Auto-Editor: Efficient media analysis and rendering
https://auto-editor.com
The Unlicense
2.86k stars 418 forks source link

Remove segments of duration less than a number of seconds #478

Closed sharno closed 3 months ago

sharno commented 3 months ago

Can you add a feature that removes segments that have a duration that's less than a number of seconds?

example command:

auto-editor video.mkv --edit audio:0.05 --drop-segment-dur 0.8sec

which would remove the segments that have the audio less than threshold of 5% and drop the segments that are less than 0.8 seconds in duration

If it's helpful the feature is here too: https://videosilenceremover.web.app/

WyattBlue commented 3 months ago

You can use:

auto-editor video.mkv --edit "(minclip audio:0.5 0.8sec)"
sharno commented 3 months ago

Thank you!

This is impressive, didn't think about using Palet at all for that! Would be great if you can add some of these examples in the Readme

sharno commented 3 months ago

Does this work with exporting? seems that I get an empty Resolve timeline when I use minclip the way you mentioned

WyattBlue commented 3 months ago

The edits stay the same regardless of what export method you choose.

For DaVinci Resolve, you import with "File > Import > Timeline"

sharno commented 3 months ago

Yep, that's indeed how it works but trying out this exact command:

auto-editor.exe ".\2024-05-15 21-19-54.mkv" --edit "(minclip audio:0.5 0.8sec)" --export resolve

gave me a 1KB FCPXML file (just an empty timeline when I import it in Resolve)

while

auto-editor.exe ".\2024-05-15 21-19-54.mkv" --edit audio:0.05 --export resolve

works (167KB FCPXML file)

WyattBlue commented 3 months ago

Edit: discard my previous message, it wasn't correct.

WyattBlue commented 3 months ago

It looks like you accidentally typed 0.5 instead of 0.05.