JoelSjogren icon

Untitled

JoelSjogren | PRO | 05/07/22 01:18:15 PM UTC | 0 ⭐ | 1091 👁️ | Never ⏰ | []
Python |

400 B

|

None

|

0 👍

/

0 👎

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

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎