Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用example的video.js 报错 #20

Open
ycjtd opened this issue May 27, 2022 · 9 comments
Open

使用example的video.js 报错 #20

ycjtd opened this issue May 27, 2022 · 9 comments

Comments

@ycjtd
Copy link

ycjtd commented May 27, 2022

使用example的video.js 报错如下,cache文件夹里不会生成任何文件,请问该怎么解决

FFCreatorLite progress: 0%
FFCreatorLite progress: 8%
FFCreatorLite progress: 13%
FFCreatorLite progress: 17%
FFCreatorLite progress: 21%
FFCreatorLite progress: 26%
FFCreatorLite progress: 32%
FFCreatorLite progress: 38%
FFCreatorLite progress: 45%
FFCreatorLite progress: 51%
FFCreatorLite progress: 58%
FFCreatorLite progress: 64%
FFCreatorLite progress: 70%
ffmpeg -f concat -safe 0 -i /usr/local/lite/examples/cache/qlzfa87azzc4rang.txt -y -hide_banner -map_metadata -1 -map_chapters -1 -c copy -c:v libx264 -profile: v main -preset medium -crf 20 -movflags faststart -pix_fmt yuv420p -r 24 527stlq rdn9q3sih.mp4
FFCreatorLite error::
Error: ffmpeg exited with code 1: /usr/local/lite/examples/cache/qlzfa87azzc4ra ng.txt: Invalid data found when processing input

stdout:
stderr: /usr/local/lite/examples/cache/qlzfa87azzc4rang.txt: Invalid data found when processing input

@drawcall
Copy link
Owner

稍后查看

@ycjtd
Copy link
Author

ycjtd commented May 30, 2022

ffmpeg版本号 N-56870-g5d06d26be3-static
centOS 7.6 64bit

@xeoshow
Copy link

xeoshow commented Jun 3, 2022

遇到同样类似问题。用的示例代码(下面相关路径已经配置好,且对应目录有对应文件,文件来自于本项目examples下的assets目录)。cache里有scene1.mp4和scene2.mp4生成,但output下没看到真正生成的结果文件。另外,只是第一次cache可以生成,删掉cache后,再次运行就不再生成scene1.mp4和scene2.mp4了
image

`
const { FFCreatorCenter, FFScene, FFImage, FFText, FFCreator } = require('ffcreatorlite');

let cacheDir = '/usr/local/FFCreatorLite/cache';
let outputDir = '/usr/local/FFCreatorLite/output';
let bg1 = '/usr/local/FFCreatorLite/assets/imgs/wallp/05.jpeg';
let img1 = '/usr/local/FFCreatorLite/assets/imgs/01.png';
let font = '/usr/local/FFCreatorLite/assets/font/jdnt.ttf';
let bg2 = '/usr/local/FFCreatorLite/assets/imgs/wallp/03.jpeg';
let logo = '/usr/local/FFCreatorLite/assets/imgs/logo/small/logo3.png';
let audio = '/usr/local/FFCreatorLite/assets/audio/01.wav';

// create creator instance
const creator = new FFCreator({
cacheDir,
outputDir,
width: 600,
height: 400,
log: true,
});

// create FFScene
const scene1 = new FFScene();
const scene2 = new FFScene();
scene1.setBgColor('#ff0000');
scene2.setBgColor('#b33771');

// scene1
const fbg = new FFImage({ path: bg1 });
scene1.addChild(fbg);

const fimg1 = new FFImage({ path: img1, x: 300, y: 60 });
fimg1.addEffect('moveInRight', 1.5, 1.2);
scene1.addChild(fimg1);

const text = new FFText({ text: '这是第一屏哈哈哈', font, x: 100, y: 100 });
text.setColor('#ffffff');
text.setBackgroundColor('#000000');
text.addEffect('fadeIn', 1, 1);
scene1.addChild(text);

scene1.setDuration(8);
creator.addChild(scene1);

// scene2
const fbg2 = new FFImage({ path: bg2 });
scene2.addChild(fbg2);
// logo
const flogo = new FFImage({ path: logo, x: 100, y: 100 });
flogo.addEffect('moveInUpBack', 1.2, 0.3);
scene2.addChild(flogo);

scene2.setDuration(4);
creator.addChild(scene2);

creator.addAudio(audio);
creator.start();

creator.on('progress', e => {
console.log(FFCreatorLite progress: ${(e.percent * 100) >> 0}%);
});

creator.on('complete', e => {
console.log(FFCreatorLite completed: \n USEAGE: ${e.useage} \n PATH: ${e.output});
});
`

@victorWuxz
Copy link

使用example的video.js 报错如下,cache文件夹里不会生成任何文件,请问该怎么解决

FFCreatorLite progress: 0% FFCreatorLite progress: 8% FFCreatorLite progress: 13% FFCreatorLite progress: 17% FFCreatorLite progress: 21% FFCreatorLite progress: 26% FFCreatorLite progress: 32% FFCreatorLite progress: 38% FFCreatorLite progress: 45% FFCreatorLite progress: 51% FFCreatorLite progress: 58% FFCreatorLite progress: 64% FFCreatorLite progress: 70% ffmpeg -f concat -safe 0 -i /usr/local/lite/examples/cache/qlzfa87azzc4rang.txt -y -hide_banner -map_metadata -1 -map_chapters -1 -c copy -c:v libx264 -profile: v main -preset medium -crf 20 -movflags faststart -pix_fmt yuv420p -r 24 527stlq rdn9q3sih.mp4 FFCreatorLite error:: Error: ffmpeg exited with code 1: /usr/local/lite/examples/cache/qlzfa87azzc4ra ng.txt: Invalid data found when processing input

stdout: stderr: /usr/local/lite/examples/cache/qlzfa87azzc4rang.txt: Invalid data found when processing input

麻烦提供一下复现代码,本地试了一下没有复现

@yhd123456
Copy link

我也遇到了 同样的问题

@drawcall
Copy link
Owner

drawcall commented Jul 6, 2022

我也遇到了 同样的问题

麻烦提供下代码

@victorWuxz
Copy link

ffmpeg版本号 N-56870-g5d06d26be3-static centOS 7.6 64bit

ffmpeg -v查看一下
刚试了2.8.5没有问题

@victorWuxz
Copy link

遇到同样类似问题。用的示例代码(下面相关路径已经配置好,且对应目录有对应文件,文件来自于本项目examples下的assets目录)。cache里有scene1.mp4和scene2.mp4生成,但output下没看到真正生成的结果文件。另外,只是第一次cache可以生成,删掉cache后,再次运行就不再生成scene1.mp4和scene2.mp4了 image

` const { FFCreatorCenter, FFScene, FFImage, FFText, FFCreator } = require('ffcreatorlite');

let cacheDir = '/usr/local/FFCreatorLite/cache'; let outputDir = '/usr/local/FFCreatorLite/output'; let bg1 = '/usr/local/FFCreatorLite/assets/imgs/wallp/05.jpeg'; let img1 = '/usr/local/FFCreatorLite/assets/imgs/01.png'; let font = '/usr/local/FFCreatorLite/assets/font/jdnt.ttf'; let bg2 = '/usr/local/FFCreatorLite/assets/imgs/wallp/03.jpeg'; let logo = '/usr/local/FFCreatorLite/assets/imgs/logo/small/logo3.png'; let audio = '/usr/local/FFCreatorLite/assets/audio/01.wav';

// create creator instance const creator = new FFCreator({ cacheDir, outputDir, width: 600, height: 400, log: true, });

// create FFScene const scene1 = new FFScene(); const scene2 = new FFScene(); scene1.setBgColor('#ff0000'); scene2.setBgColor('#b33771');

// scene1 const fbg = new FFImage({ path: bg1 }); scene1.addChild(fbg);

const fimg1 = new FFImage({ path: img1, x: 300, y: 60 }); fimg1.addEffect('moveInRight', 1.5, 1.2); scene1.addChild(fimg1);

const text = new FFText({ text: '这是第一屏哈哈哈', font, x: 100, y: 100 }); text.setColor('#ffffff'); text.setBackgroundColor('#000000'); text.addEffect('fadeIn', 1, 1); scene1.addChild(text);

scene1.setDuration(8); creator.addChild(scene1);

// scene2 const fbg2 = new FFImage({ path: bg2 }); scene2.addChild(fbg2); // logo const flogo = new FFImage({ path: logo, x: 100, y: 100 }); flogo.addEffect('moveInUpBack', 1.2, 0.3); scene2.addChild(flogo);

scene2.setDuration(4); creator.addChild(scene2);

creator.addAudio(audio); creator.start();

creator.on('progress', e => { console.log(FFCreatorLite progress: ${(e.percent * 100) >> 0}%); });

creator.on('complete', e => { console.log(FFCreatorLite completed: \n USEAGE: ${e.useage} \n PATH: ${e.output}); }); `

应该需要安装升级ffmpeg版本,可参考下文
https://linuxize.com/post/how-to-install-ffmpeg-on-centos-7/
升级到3.x版本以上

@victorWuxz
Copy link

使用example的video.js 报错如下,cache文件夹里不会生成任何文件,请问该怎么解决

FFCreatorLite progress: 0% FFCreatorLite progress: 8% FFCreatorLite progress: 13% FFCreatorLite progress: 17% FFCreatorLite progress: 21% FFCreatorLite progress: 26% FFCreatorLite progress: 32% FFCreatorLite progress: 38% FFCreatorLite progress: 45% FFCreatorLite progress: 51% FFCreatorLite progress: 58% FFCreatorLite progress: 64% FFCreatorLite progress: 70% ffmpeg -f concat -safe 0 -i /usr/local/lite/examples/cache/qlzfa87azzc4rang.txt -y -hide_banner -map_metadata -1 -map_chapters -1 -c copy -c:v libx264 -profile: v main -preset medium -crf 20 -movflags faststart -pix_fmt yuv420p -r 24 527stlq rdn9q3sih.mp4 FFCreatorLite error:: Error: ffmpeg exited with code 1: /usr/local/lite/examples/cache/qlzfa87azzc4ra ng.txt: Invalid data found when processing input

stdout: stderr: /usr/local/lite/examples/cache/qlzfa87azzc4rang.txt: Invalid data found when processing input

应该需要安装升级ffmpeg版本,可参考下文
https://linuxize.com/post/how-to-install-ffmpeg-on-centos-7/
升级到3.x版本以上

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants