JoelSjogren

Untitled

May 7th, 2022
1,123
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.40 KB | None | 0 0
  1. import ffmpeg
  2.  
  3. in_file = ffmpeg.input(path)
  4.  
  5. import time
  6. t0 = time.time()
  7. (
  8.     ffmpeg
  9.     .concat(*[
  10.         in_file
  11.         .filter_('atrim', start=start, end=end)
  12.         for kind, start, end in segmentation
  13.         if kind == 'music' and end - start > 30
  14.     ], v=0, a=1)
  15.     .output(path.replace('mp4', 'mp3'))
  16.     .run()
  17. )
  18. t1 = time.time()
  19. print(f"audio written in {t1 - t0} seconds")
Advertisement
Comments
  • User was banned
Add Comment
Please, Sign In to add comment