Posts

Showing posts from September, 2024

"allowed_paths" in Gradio

 I need to open a video file under a Gradio chatbot app via URL: < siteURL >/file={ output_video_filename }. By default, Gradio not allows to open a file under the app folder, and so I added "allowed_paths" in "launch()" function.  Sample code as below. demo.launch(server_name="127.0.0.1", server_port=8000, allowed_paths=["output_video.mp4"])

Error " [WinError 5] Access is denied" when running Moviepy

Image
 I received error "PermissionError: [WinError 5] Access is denied" when running Python code "AudioFileClip(...)" a function from "moviepy" package. My code environment: OS: Windows Python:  3.12.5 Moviepy: 1.0.3 After I investigated the issue, I found the moviepy returns "..\Lib\site-packages\moviepy" from  the code "FFMPEG_BINARY = get_exe()" in "config.py" file. This is not the correct path points to "ffmpeg.exe" , and so I manually set the value of "FFMPEG_BINARY" to  the path of  "ffmpeg-win64-v4.2.2.exe" in "config_defaults.py" file. FFMPEG_BINARY = r"..\\Lib\\site-packages\\imageio_ffmpeg\binaries\\ffmpeg-win64-v4.2.2.exe" Related screenshot shows the origin value from the code “FFMPEG_BINARY = get_exe()”:   After  this change, the "AudioFileClip(audio_path)" running successfully.