我有以下代码来创建InMemoryUploadedFile。我这样做的原因是因为我使用firebase并在那里保存图像和视频。可以认为它类似于S3存储。。。在我的测试中,我有以下内容:
file = BASE_DIR + '/static/samy-assets/img/landing/small.mp4'
video = SimpleUploadedFile(file, open(file, 'rb').read(), content_type="video/mp4")
response = self.client.post('/media/upload/', {'file': video}, follow=True)
这是为了上传视频到firebase,但是现在我需要从视频中获取一帧作为“预览”显示。我有这个代码:
^{pr2}$但是我收到的错误是:
an integer is required (got type InMemoryUploadedFile)
任何帮助都将不胜感激。。。在
目前没有回答
相关问题 更多 >
编程相关推荐