You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from moviepy import VideoFileClip
def convert_webm_to_mp4(input_path, output_path=None):
if output_path is None:
output_path = input_path.rsplit('.', 1)[0] + '.mp4'
try:
clip = VideoFileClip(input_path)
clip.write_videofile(output_path, codec='libx264', audio_codec='aac')
print(f"Conversion complete! MP4 saved to: {output_path}")
except Exception as e:
print(f"Error during conversion: {e}")
if __name__ == "__main__":
convert_webm_to_mp4("input_file.webm")
Expected Behavior
convert the file and save it in the output_path
Actual Behavior
print me this error
Error during conversion: Error passing ffmpeg -i command output:
Input #0, matroska,webm, from 'convert_site.webm':
Metadata:
encoder : QTmuxingAppLibWebM-0.0.1
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0(eng): Video: vp8, yuv420p(progressive), 1920x1016, SAR 1:1 DAR 240:127, 29.75 fps, 29.75 tbr, 1k tbn (default)
At least one output file must be specified
The last moviepy release was 2.1.2, and the code in master has already moved on, too – could you please check if you're running into the same issue when using the latest code? Thx.
my code
Expected Behavior
convert the file and save it in the output_path
Actual Behavior
print me this error
Error during conversion: Error passing
ffmpeg -i
command output:Steps and code to Reproduce the Problem
ffmpeg -y -i input.webm -movflags faststart -pix_fmt yuv420p -c:v libx264 -preset fast -crf 23 -c:a aac -b:a 192k output.mp4
Specifications
The text was updated successfully, but these errors were encountered: