New to using streamlit, and really enjoying how easy it is to get projects running.
I have a project I am building out to create videos from text using several of the OpenAI API’s (DALLE, TTS, 3.5T) and have made it work locally with no problems. However, when deploying to streamlit cloud, I receive the error “No such file or directory: ‘ffprobe’” although I have ffmpeg in my packages.txt and ffmpeg-python==0.2.0 ffprobe==0.5 in my requirements.txt. Anyone experience a problem like this and know a solution?
Yes. I actually see it being installed in the logs here:
Stored in directory: /tmp/pip-ephem-wheel-cache-mg566x2y/wheels/ba/39/54/c8f7ff9a88a644d3c58b4dec802d90b79a2e0fb2a6b884bf82
Building wheel for ffprobe (setup.py): started
Building wheel for ffprobe (setup.py): finished with status ‘done’
Stored in directory: /tmp/pip-ephem-wheel-cache-mg566x2y/wheels/77/95/42/ec9cdac2db6ff5c7fafb2f430715681009ddd232c7704f517f
I solved this problem by using ffmpeg python wrapper rather than calling the binary. I made this helper function and called it in place of subprocess.run(ffmpeg).
def merge_audio_video(avi_video_path, full_narration_path, output_file_path):
“”"
Merge AVI video and MP3 narration into a final MP4 video using ffmpeg-python.
Parameters:
- avi_video_path: Path to the AVI video file.
- full_narration_path: Path to the MP3 narration audio file.
- output_file_path: Path for the output MP4 video file.
"""
try:
# Input streams
video_input = ffmpeg.input(avi_video_path)
audio_input = ffmpeg.input(full_narration_path)
# Merge video and audio with the specified output format and codec options
(
ffmpeg
.output(video_input['v'], audio_input['a'], output_file_path, vcodec='copy', acodec='aac', strict='experimental', shortest=None)
.run(overwrite_output=True)
)
print("Video processing completed successfully.")
except ffmpeg.Error as e:
print(f"ffmpeg command failed: {e.stderr.decode()}")
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.