node.js 未从 m3u8 文件生成完整的 m3u8 剪辑

问题描述

index.js

const ffmpegPath = require('@ffmpeg-installer/ffmpeg').path;
const ffmpeg = require('fluent-ffmpeg');
const process = require('process');

const args = process.argv.slice(2);
if (args.length !== 4) {
  console.error('Incorrect number of arguments');
  process.exit(1);
}

const startTime = args[0];
const timeDuration = args[1];
const inputFile = args[2];
const outputFile=args[3];

ffmpeg.setFfmpegPath(ffmpegPath);

ffmpeg(inputFile)
  .setStartTime(startTime)
  .setDuration(timeDuration)
  .output(outputFile)
  .on('end',function(err) {
    if(!err) { 
      console.log('conversion Done') 
    }
  })
  .on('error',function(err){
    console.log('error: ',err)
  }).run();

我在终端上运行此命令以从 m3u8 文件生成剪辑 node index.js 00:00:10 46 ./path/sample.m3u8 ./path/output.m3u8

主要问题是它没有创建超过 13 秒的剪辑。例如,上面的命令应该生成一个 46 秒的剪辑,但它接近 13 秒。所以我不明白这是什么问题。任何小于 13 的剪辑都可以正常工作。有什么办法可以解决吗?

这是 m3u8 文件链接 https://mp4.to/downloads/0cb552cd749c4cf4b

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...