javascript - 在firebase云功能中通过fs JavaScript读取mp4
问题描述
我需要通过 fs 或 firebase 云函数中 JavaScript 中的任何其他包将 mp4 文件读取为 4D 数组(RGB、宽度、高度和时间)。
exports.readNewVideo = functions.storage
.object().onFinalize(async (object) => {
const bucket = admin.storage().bucket(object.bucket);
const tempFilePath = path.join(os.tmpdir(), object.name);
await bucket.file(object.name!).download({ destination: tempFilePath });
// read here by tempFilePath
});
解决方案
推荐阅读
- javascript - 在 JavaScript 中获取数组中对象的特定字段的总和
- python - Python:在一个 IF 语句中组合 NOT、AND、IN
- powershell - 用于检查 TPM 制造商版本的 Powershell 脚本(IF ELSE)
- javascript - Service Worker 的等待状态。
- python - Python Socket 接收/发送多线程
- javascript - Typescript 有静态导入吗?
- ubuntu - 如何通过 Apache 2 和 mod_wsgi 在 Ubuntu 上正确提供 Flask App?404 未找到错误
- ios - 我们可以从 WatchOS 2 扩展中调用 IBM worklight 7 适配器吗?
- r - 有没有一种方法可以让 sidebarMenu -> menuItems 动态化?
- jquery - 使用 sheet.js 插件将 HTML 表格转换为纯 JavaScript 中的 Excel 文件