[英]How to get file from cloud storage and process as local file without downloading?
I am working on a project where I have to extract frames from a video by using ffmpeg (node.js). 我正在一个项目中,我必须使用ffmpeg(node.js)从视频中提取帧。 I first upload video to firebase storage from my client, and then I want to process it in the backend server.
我先从客户端将视频上传到Firebase存储,然后再在后端服务器中对其进行处理。 However, ffmpeg only accept file as if it is stored locally.
但是,ffmpeg仅接受文件,就好像文件存储在本地一样。
const ff =new ffmpeg('C:/Users/alexh/Desktop/alex/name.avi');
It will not work with url. 不适用于url。 I am wondering is any way I can get file from url as if it is stored locally or firebase can provide me a way to get the file?
我想知道有什么办法可以从url获取文件,就像它存储在本地还是firebase可以为我提供一种获取文件的方法吗? I don't want to use filebase trigger event because I want to send http request to backend server.
我不想使用文件触发事件,因为我想将HTTP请求发送到后端服务器。
Thank you so much 非常感谢
如果您是在Linux或OS X上运行的,则可以使用GCS Fuse将存储桶安装到文件系统上,然后直接将FFmpeg指向它。
The fluent-ffmpeg package supports operating on readable streams instead of just files. fluent-ffmpeg软件包支持对可读流进行操作,而不仅仅是文件。 The GCS Client library supports creating a readable stream for a GCS object .
GCS客户端库支持为GCS对象创建可读流 。 By combining these you can has ffmpeg operate directly from GCS.
通过组合这些,可以使ffmpeg直接从GCS运行。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.