-
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
Output stream closed when stream passed to aws s3 #1199
Comments
I can see that there is timeout in node_modules |
Ever since I've switched the Docker image from |
@mariyan-borisov I did the same workaround as you. First upload file to local storage (without using stream as output) and when processing is finished then I start upload to aws s3. I do not like this workaround either it should work with streams, but it does not. Library maintainer also do not care, library last time was updated 5 years ago. I very doubt it that he will fix this issue now. This is basically dead library. Unfortunately I did'n manage to find any replacement for this library :( |
I ran into this as well with AWS SDK v3 (AWS SDK v2 does not seem to be affected). As a workaround, I'm calling the const { spawn } = require('child_process')
const { Upload } = require('@aws-sdk/lib-storage')
const ffmpeg = spawn('ffmpeg', ['-i', 'input.mp4', 'pipe:1'])
const upload = new Upload({
params: {
Body: ffmpeg.stdout
}
}) |
I had some luck with telling fluent-ffmepg not to close the output stream and then manually calling .end() on the output stream when the ffmpeg command is ended. Something like: const outputStream = new PassThrough();
ffmpeg(input)
.noVideo()
.outputFormat('wav')
.output(outputStream, { end: false })
.on('end', () => {
outputStream.end();
})
.run();
const upload = new Upload({
params: {
Body: outputStream
}
}) |
The terminateTimeout option (PR #1292) could solve this issue. |
Version information
Code to reproduce
When I run this I am getting
Error: Output stream closed
(fromfluent-ffmpeg
), error occurs afterend
event is emitted. Looks like that Passthrough closes stream before is finished (I am using@aws-sdk/client-s3
)The text was updated successfully, but these errors were encountered: