我打算将 ffmpeg 和 ffprobe 安装到我的 Google App Engine Flex 环境中,如何使用requirements.txt 作为包来执行此操作?
我目前正在使用 ffmpeg-python,这只是一个包装器。
ffmpeg-python==0.2.0
ffprobe-python==1.0.3
下面是我尝试使用 ffmpeg-python 包装器时出现的错误,这是预期的,因为没有 ffmpeg 和 ffprobe 可用:
2020-05-03 11:42:36 default[20200503t112932] [03/May/2020 11:42:36] ERROR [log.py:228] Internal Server Error: /capture_thumbnail/
2020-05-03 11:42:36 default[20200503t112932] Traceback (most recent call last): File "/env/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner response = get_response(request) File "/env/lib/python3.6/site-packages/django/core/handlers/base.py", line 115, in _get_response response = self.process_exception_by_middleware(e, request) File "/env/lib/python3.6/site-packages/django/core/handlers/base.py", line 113, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/home/vmagent/app/core/views.py", line 62, in capture_thumbnail generate_thumbnail(request, blob_uuid) File "/home/vmagent/app/core/videointelligence1.py", line 264, in generate_thumbnail probe = ffmpeg.probe(video_url) File "/env/lib/python3.6/site-packages/ffmpeg/_probe.py", line 20, in probe p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE) File "/opt/python3.6/lib/python3.6/subprocess.py", line 729, in __init__ restore_signals, start_new_session) File "/opt/python3.6/lib/python3.6/subprocess.py", line 1364, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: 'ffprobe': 'ffprobe'
您能否建议一种方法,以便我可以在 Google App Engine 上使用 ffprobe。
在您的要求.txt中
将这些添加到 .yaml 的 env_variables 下:
env_variables: FFMPEG_PATH: /usr/bin/ffmpeg FFPROBE_PATH: /usr/bin/ffprobe