import ffmpeg
in_file = ffmpeg.input(path)
import time
t0 = time.time()
(
ffmpeg
.concat(*[
in_file
.filter_('atrim', start=start, end=end)
for kind, start, end in segmentation
if kind == 'music' and end - start > 30
], v=0, a=1)
.output(path.replace('mp4', 'mp3'))
.run()
)
t1 = time.time()
print(f"audio written in {t1 - t0} seconds")
Comments
0 B
|👍
/👎