简体   繁体   English

Python FileNotFoundError: [Errno 2] No such file or directory: Synology 上的“ffprobe”

[英]Python FileNotFoundError: [Errno 2] No such file or directory: 'ffprobe' on Synology

I was making a small python 3.8 script to sort photos and videos according to their metadata on my Synology NAS (working on DSM 7.0), overall it works well on ubuntu but it fails on the NAS with this error:我正在制作一个小的 python 3.8 脚本来根据我的 Synology NAS 上的元数据对照片和视频进行排序(在 DSM 7.0 上工作),总体而言它在 ubuntu 上运行良好,但在 NAS 上失败并出现以下错误:

FileNotFoundError: [Errno 2] No such file or directory: 'ffprobe' FileNotFoundError:[Errno 2] 没有这样的文件或目录:'ffprobe'

I've been searching everywhere for help on this issue, I saw this post and tried the solutions but I still got the error on any video I try to read metadata from.我一直在到处寻找有关此问题的帮助,我看到了这篇文章并尝试了解决方案,但我尝试从中读取元数据的任何视频仍然出现错误。

ffmpeg is installed and so are ffmpeg-python and ffprobe-python ffmpeg 已安装,ffmpeg-python 和 ffprobe-python 也已安装

Here's my test code:这是我的测试代码:

from datetime import datetime
import ffmpeg

name = "VID_20200130_185053.mp4"
path = "/volume1/photo/phone/DCIM/Camera/"
data_keys = ["DateTimeOriginal", "DateTime", "creation_time"]
file = f"{path}{name}"
print(file)
vid = ffmpeg.probe(file)['streams']
# vid = ffprobe.FFProbe(file).streams
for key in data_keys:
    if key in vid[0]['tags']:
        print(datetime.strptime(vid[0]['tags'].get(key).split('T')[0], "%Y-%m-%d"))

If you have VideoStation installed in your NAS you can use ffprobe from the following directory:如果您的 NAS 中安装了 VideoStation,您可以使用以下目录中的 ffprobe:

/var/packages/VideoStation/target/bin/ffprobe

Alternatively you can use exiftool, which is a Perl script that can be executed if you install Perl support via Package Center.或者,您可以使用 exiftool,这是一个 Perl 脚本,如果您通过 Package 中心安装 Perl 支持,则可以执行该脚本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 FileNotFoundError: [Errno 2] 没有这样的文件或目录: 'ffprobe': 'ffprobe' - FileNotFoundError: [Errno 2] No such file or directory: 'ffprobe': 'ffprobe' Errno 2 没有这样的文件或目录:'ffprobe':'ffprobe' - Errno 2 No such file or directory: 'ffprobe': 'ffprobe' Python 3-FileNotFoundError:[Errno 2]没有这样的文件或目录 - Python 3 - FileNotFoundError: [Errno 2] No such file or directory python:FileNotFoundError:[Errno 2]没有这样的文件或目录 - python: FileNotFoundError: [Errno 2] No such file or directory Python FileNotFoundError:[错误2]没有这样的文件或目录 - Python FileNotFoundError: [Errno 2] No such file or directory Python FileNotFoundError: [Errno 2] 没有这样的文件或目录: - Python FileNotFoundError: [Errno 2] No such file or directory: FileNotFoundError: [Errno 2] 没有这样的文件或目录 [Python] - FileNotFoundError: [Errno 2] No such file or directory [Python] Python 3:如何修复FileNotFoundError:[Errno 2]没有这样的文件或目录 - Python 3: How to fix FileNotFoundError: [Errno 2] No such file or directory Heroku Python FileNotFoundError:[Errno 2] 没有这样的文件或目录 - Heroku Python FileNotFoundError: [Errno 2] No such file or directory FileNotFoundError: [Errno 2] 没有这样的文件或目录(python 错误) - FileNotFoundError: [Errno 2] No such file or directory (python error)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM