0

a simple code like this is creating a corrupted audio file for some reasons:

from moviepy import *

clip = VideoFileClip("cut.mp4")
audio = clip.audio
audio.to_audiofile('temp-audio.mp3')

Expected Behavior Audio should be the same as the audio in the video

Actual Behavior audio is corrupted in the end (repeats the end segment a few times like a broken record)

Steps to Reproduce the Problem:

Run the code above on this video with latest moviepy version (don't make fun it's just a trial lol) and you will get this audio which is corrupted (I compressed it in a zip): here

Specifications

Python Version: Python 3.9.9

Moviepy Version: 1.0.3

Christoph Rackwitz
  • 11,317
  • 4
  • 27
  • 36
NotSoShabby
  • 3,316
  • 9
  • 32
  • 56

1 Answers1

1

may this will help you

from moviepy import *

clip = VideoFileClip("cut.mp4").subclip(0,1) 
#subclip mean video duration its from the place to start to the end
audio = clip.audio
audio.to_audiofile('temp-audio.mp3')

I hope I've been helpful

hmody3000
  • 47
  • 1