AIM
I am working on a small project that chunks an audio file and then uploads the chunks to a cloud server.
PROCESS
This works well with audio files lesser than 15Mb but on larger files the chunk doesn't get to the end. For example, in trying to upload a 40+Mb file the chunk stops at number 153, but when I use my commandline to run the ffmpeg, I get 328 chunked files. What could be wrong
Here is my code:
const muxer = child_process.spawn('ffmpeg', transformArgs, {
cwd: `${cwd}/transforms`,
});
console.log('creating stream (read)...');
fs.createReadStream(
`${cwd}/transforms/stream${path.extname(
fileSrc.filename,
)}`,
)
.pipe(muxer.stdin)
.on('error', (e) => {
console.log(e);
}).on('close', async () => {
console.log('ended');
muxer.stdin.end();
muxer.kill();})
finally got it to work by adding
muxer.stderr.on('data', (data) => {
console.log(data)
})
But still don't know what this does exactly...