首页 > 解决方案 > python视频编辑器库接收文件对象而不是文件路径

问题描述

我在django项目中工作,我想从保存到defult_storage的视频文件中制作缩略图,我需要python视频编辑器库来接收文件对象而不是文件路径我检查moviepy和opencv但不能很好的解决方案如果我会很感激有人可以帮我解决这个问题,这是模型:

class BusinessVideo(ModificationLogMixin, models.Model):
video = models.FileField(upload_to='business_videos', null=True, blank=True)

这就是我想将视频传递给编辑器的方式

video_cap = cv.VideoCapture(default_storage.open(
os.path.relpath(self.video_url, settings.MEDIA_URL)))

我需要一些库来接收文件对象,因为我的 default_storage 基于 minio,我不知道如何获取视频路径

标签: djangopython-3.x

解决方案


推荐阅读