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

无法发布视频 #12

Open
PonderK opened this issue May 30, 2022 · 1 comment
Open

无法发布视频 #12

PonderK opened this issue May 30, 2022 · 1 comment

Comments

@PonderK
Copy link

PonderK commented May 30, 2022

image

server is starting........!
(node:10656) DeprecationWarning: collection.count is deprecated, and will be removed in a future version. Use Collection.countDocuments or Collection.estimatedDocumentCount instead
3===>>C:\Users\wang\Desktop\shida-main\server\public\resource
4===>>3pjmJKDzn8R.png===>>C:\Users\wang\Desktop\shida-main\server\public\images\3pjmJwgmeUw\3pjmJKDzn8R.png===>>\resource\images\3pjmJwgmeUw\3pjmJKDzn8R.png
FFCreator start
[FF] FFVideo Audio preProcessing errorffmpeg exited with code 1: C:\Users\wang\Desktop\shida-main\server\public\resource\resource\files\3pjh8UJ4Dc9.mp4: No such file or directory

FFCreator error: ffmpeg exited with code 1: C:\Users\wang\Desktop\shida-main\server\public\resource\resource\files\3pjh8UJ4Dc9.mp4: No such file or directory

[FF] Creator production error. FFEvent {
type: 'error',
pos: 'preProcessing',
error:
'ffmpeg exited with code 1: C:\Users\wang\Desktop\shida-main\server\public\resource\resource\files\3pjh8UJ4Dc9.mp4: No such file or directory\n' }
events.js:167
throw er; // Unhandled 'error' event
^

Error: ffmpeg was killed with signal SIGKILL
at ChildProcess. (C:\Users\wang\Desktop\shida-main\node_modules\fluent-ffmpeg\lib\processor.js:180:22)
at ChildProcess.emit (events.js:182:13)
at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12)

Emitted 'error' event at:
at emitEnd (C:\Users\wang\Desktop\shida-main\node_modules\fluent-ffmpeg\lib\processor.js:424:16)
at endCB (C:\Users\wang\Desktop\shida-main\node_modules\fluent-ffmpeg\lib\processor.js:544:13)
at handleExit (C:\Users\wang\Desktop\shida-main\node_modules\fluent-ffmpeg\lib\processor.js:170:11)
at Socket. (C:\Users\wang\Desktop\shida-main\node_modules\fluent-ffmpeg\lib\processor.js:209:9)
at Socket.emit (events.js:187:15)
at Pipe._handle.close (net.js:606:12)

[nodemon] app crashed - waiting for file changes before starting...

上面报错中的3,4===>>是对server/sevice/file.js输出部分文件路径
module.exports = app => ({
async upload(file, folder = "images") {
const { $config } = app;

const fileData = fs.readFileSync(file.path);

const folderPath = path.join(path.join(__dirname, "../public/resource/"), folder); // 拼接文件夹

console.log("1===>>"+folderPath)
await fs.ensureDir(folderPath);

const filePath = path.join(folderPath, file.name);
fs.writeFileSync(filePath, fileData);

console.log("2===>>"+$config.baseUrl + `/resource/${folder}/${file.name}`)

return {
  fileName: file.filename,
  localPath: filePath,
  url: $config.baseUrl + `/resource/${folder}/${file.name}`
};

},

async fileUpload({ file, folder = "images" }) {
const { $config } = app;

const resource = path.join(__dirname, "../public/resource/");
console.log("3===>>"+resource)

const fileData = fs.readFileSync(file.path);
const folderPath = path.join(resource, folder);
await fs.ensureDir(folderPath);

const name = shortid.gen();
const ext = file.name.split(".").pop();
const fileName = `${name}.${ext}`;
const filePath = path.join(folderPath, fileName);
await fs.outputFile(filePath, fileData);

console.log("4===>>"+fileName+"===>>"+filePath+"===>>"+path.join($config.baseUrl || "", "/resource/", folder, fileName))

return {
  fileName,
  localPath: filePath,
  //url: path.join($config.baseUrl || "",folder, fileName)
  url: path.join($config.baseUrl || "", "/resource/", folder, fileName)
};

}
});

==================================================》》》》
感谢回复!

@aliaszz
Copy link
Collaborator

aliaszz commented May 31, 2022

看起来是上一步创建文件夹或文件失败了,可以排查一下你的文件权限相关问题。

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

2 participants