-
Notifications
You must be signed in to change notification settings - Fork 888
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
Stream input doesn't work with .ogg audio file #1309
Comments
I've tried with .wav file and It works! I think it just happen with .ogg const inputReadStream = fs.createReadStream(`input.wav`);
const outputWriteStream = fs.createWriteStream(`output.wav`);
ffmpeg(inputReadStream)
.inputFormat("wav")
.setStartTime(400)
.outputFormat("wav")
.on("start", () => {
console.log("Processing....");
})
.on("error", (err: any) => {
console.error("An error occurred: " + err.message);
})
.on("end", () => {
console.log("Processing finished !");
})
.pipe(outputWriteStream, { end: false }); ResultsBtw, my audio is 2 channels. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version information
Code to reproduce
(note: if the problem only happens with some inputs, include a link to such an input file)
Expected results & Observed results
I want to trim the audio starting from 400 seconds to the end. It seems that FFmpeg does not work when using an input stream, but it functions properly with an input file path. It's strange that it can cut the audio by a few seconds (like 3-4 seconds) but not by 400 seconds and no errors appear.
Here's the result
With stream:
input.ogg
output.ogg (4 seconds was cut)
Without stream:
input.ogg
output.ogg (Cut correctly)
PS.
This is an example code to reproduce the bug. In my use case, I need to read the input file from AWS S3, then pass it to FFMPEG to cut the audio before uploading it again.
So, It's important to give an input as a stream input to FFMPEG.
Checklist
The text was updated successfully, but these errors were encountered: