-
-
Notifications
You must be signed in to change notification settings - Fork 55
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
FFMPEG streams still prematurely closing on Windows #63
Comments
Can you give a code sample? How prematurely are we talking here? |
It closes almost immediately after stream initialization.
There may be some parts I left out, I can't say I'm super familiar with prism-media itself, I just found it originated from here when trying to find the problem. I also want to mention when I run the exact same code on Debian, it runs with no issues, except for it crashing when multiple effects are set using the |
Could you try this: import { pipeline } from 'stream';
const transcoder = new FFmpeg(
args: FFMPEGargs // Some args defined in irrelevant code. Args are correct, I've validated this by running prism media 1.2.4
});
const input = ytdl(url, options);
if (options && !options.opusEncoded) {
return pipeline(input, transcoder);
} else {
const opus = new Opus.Encoder({
rate: 48000,
channels: 2,
frameSize: 960
});
return pipeline(input, transcoder, opus);
}
|
Sorry I haven't responded. The arguments I'm passing through are dynamically created, but I do check them before passing them through to make sure they work. Normally, they are just simple arguments such as |
Hi @BR88C. I've released v1.2.8 today. I think the issue was due to enabling const ffmpeg = new prism.FFmpeg({ args, shell: false }); Hope this helps, let me know if it fixes your issue! Edit: I still highly recommend using pipeline even if this does fix your issue. Pipeline ensures proper clean-up of the streams after they end, and it results in shorter code. |
Thanks, it works like a charm now! I also implemented pipeline, thanks for the tip on that. |
No problem, glad to hear! I'll close this issue now. |
Issue:
FFMPEG streams still prematurely closing on Windows.
Steps to reproduce:
Created an opus stream, which instantly closes after initialization. I have made no changes to my code, except for jumping from prism-media
1.2.4
to1.2.7
.Further details:
Windows 10 build 20H2
14.15.0
1.2.7
(361cb91)4.3.1
(Using ffmpeg-static version4.2.7
)The text was updated successfully, but these errors were encountered: