Output video has no sound

后端 未结 2 1900
忘了有多久
忘了有多久 2021-01-14 09:23

When I concatenate videos in Moviepy I get no sound in the output file, I try using various parameters but no clue.

This is my code:

import moviepy.         


        
2条回答
  •  青春惊慌失措
    2021-01-14 09:53

    I solved this by adding a temporary audio file path. Just change your final line of code to this:

    final_clip.write_videofile(output_movie, temp_audiofile='temp-audio.m4a', remove_temp=True, codec="libx264", audio_codec="aac")
    

    You're specifying where MoviePy can store its temp audio file. Also, change the parameter remove_temp to True so the temp file will be cleaned up automatically.

提交回复
热议问题