node.js - 在谷歌 App Engine : An error occurred: ffmpeg was killed with signal SIGABRT Error: ffmpeg was killed with signal SIGABRT 上部署

标签 node.js google-app-engine ffmpeg

我用 node-js 和 fluent-ffmpeg 编写了一个 node-js api:

'use strict';
require('babel-register');
const path = require('path');    
const ffmpeg = require('fluent-ffmpeg');
[...]
var infs = new ffmpeg

infs.addInput(doc.data().url).outputOptions([
            '-preset slow', '-g 48', '-sc_threshold 0',
            '-map 0:0', '-map 0:1', '-map 0:0', '-map 0:1',
            '-s:v:0 1280x720', '-c:v:0 libx264', '-b:v:0 2000k',
            // "-var_stream_map", "'v:0,a:0 v:1,a:1'",
            '-master_pl_name ./' + req.params.id + '/master' + req.params.id + '.m3u8',
            '-f hls', '-hls_time 6', '-hls_list_size 0',
            '-hls_segment_filename ./' + req.params.id + '/fileSequence|' + req.params.id + '|%d|v%v.ts',
            '-max_muxing_queue_size 1024',
        ]).output('./' + req.params.id + '/video' + req.params.id + '.m3u8')
            .on('start', function (commandLine) {
                console.log('Spawned Ffmpeg with command: ' + commandLine);
            })
            .on('error', function (err, stdout, stderr) {
                console.log('An error occurred: ' + err.message, err, stderr);
            })
            .on('progress', function (progress) {
                console.log('Processing: ' + progress.percent + '% done')
            })
            .on('end', function (err, stdout, stderr) {

                console.log('Finished processing!' /*, err, stdout, stderr*/)
            })
            .run()
        res.status(200).send('GG').end();
    } 
   });
[...]
那工作与

node app.js


在我的 macbook pro 上,但是当我这样做时

gcloud app deploy


我调用公共(public)网址,我有这个日志:
Processing: undefined% done
An error occurred: ffmpeg was killed with signal SIGABRT Error: ffmpeg was killed with signal SIGABRT 
这是我的 app.yaml :
    # Copyright 2017, Google, Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# [START gae_flex_quickstart_yaml]
runtime: nodejs
env: flex

# This sample incurs costs to run on the App Engine flexible environment.
# The settings below are to reduce costs during testing and are not appropriate
# for production use. For more information, see:
# https://cloud.google.com/appengine/docs/flexible/nodejs/configuring-your-app-with-app-yaml
manual_scaling:
  instances: 1
resources:
  cpu: 1
  memory_gb: 6
  disk_size_gb: 30

# [END gae_flex_quickstart_yaml]
enter image description here
如何在谷歌应用引擎上正确部署我的 node-js api?
提前致谢。
杰里米。

最佳答案

我们没有关于 doc.data().url 到底是什么的信息。 ,但是这将是您从 db 文档中获得的内容。所以调查 addInput documentation ,我猜,它必须是一些本地文件名。本地文件名也是 output 的参数方法。
这将适用于您的本地环境,但是当您在 App Engine 中处理文件时,您必须使用一些存储服务,这些服务已在 here 中进行了描述。 .

关于node.js - 在谷歌 App Engine : An error occurred: ffmpeg was killed with signal SIGABRT Error: ffmpeg was killed with signal SIGABRT 上部署,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63540784/

相关文章:

node.js - 将异步等待与 setImmediate 结合使用

python 不会为元组释放内存,是吗?

python - 在 Google App Engine 上过滤和排序音乐信息

ffmpeg 正确设置输出选项(-r)

c# - 如何向ffmpeg提供登录用户名和密码?

javascript - 需要对 nodejs 概念进行一些澄清

node.js - 在 sequelize getter 和 setter 函数中使用时出现 "Argument of type is not assignable to parameter of type"错误

javascript - Bower 与 NPM : Which is better for installing AngularJS?

bash - 如何替换 cloudbuild.yaml 中的替换字符串

php - 返回 shell_exec 作为字符串 PHP 使用 soundtouch/soundstrech 检测 BPM