Spaces:
Runtime error
Runtime error
Update app.py
Browse files2 unmodified lines3456789101112137 unmodified lines2122232425262728292 unmodified linesimport zipfileimport rarfilefrom PyPDF2 import PdfReader, PdfWriterfrom moviepy.editor import VideoFileClipfrom pydub import AudioSegmentfrom PIL import Imageimport pdf2imageimport streamlit as stdef convert_file(input_path, output_path):if input_path.endswith('.pdf'):7 unmodified lineswebp_images[0].save(output_path, 'PDF', resolution=100.0, save_all=True, append_images=webp_images[1:])elif input_path.endswith('.mp4'):# Convert MP4 to MKVvideo = VideoFileClip(input_path)video.write_videofile(output_path, codec='libx264')elif input_path.endswith('.wav'):# Convert WAV to MP32 unmodified lines3456789101112137 unmodified lines21222324252627282 unmodified linesimport zipfileimport rarfilefrom PyPDF2 import PdfReader, PdfWriterfrom pydub import AudioSegmentfrom PIL import Imageimport pdf2imageimport streamlit as stimport ffmpegdef convert_file(input_path, output_path):if input_path.endswith('.pdf'):7 unmodified lineswebp_images[0].save(output_path, 'PDF', resolution=100.0, save_all=True, append_images=webp_images[1:])elif input_path.endswith('.mp4'):# Convert MP4 to MKV using ffmpegffmpeg.input(input_path).output(output_path, codec='libx264').run()elif input_path.endswith('.wav'):# Convert WAV to MP3
app.py+3-4