-
Notifications
You must be signed in to change notification settings - Fork 45
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 stream unpipes around 20 seconds before end of audio file #10
Comments
For more information, the encoder initialization is: this.encoder = voiceConnection.createExternalEncoder({
type: 'ffmpeg',
source: this.url,
format: 'opus',
outputArgs: ['-ab', '64000'],
debug: true,
}); |
Found some log output:
I discovered I forgot to track when the stream from |
How often does that happen? Also for debugging stuff like this I'd additionally recommend logging all library events using |
It happens with every non-Opus passthrough song. I am going to debug this with the methods you provided. Thanks for the quick response! |
Okay tested it out on https://www.youtube.com/watch?v=rGd7IEOjk-0 It stopped at 2:41 out of 2:48. No disconnect event fired. EDIT: Classify the event better. |
I screwed up my logging comment from before. I am sorry. The song never ends, but the timestamp stops updating. I had to manually trigger the EDIT: Updated issue post with more accurate information. |
Seems to be an issue with stream behavior changes in newer nodejs versions, can consistently reproduce on v5.11.0+. |
This commit seems to be a part of the issue: nodejs/node#6023. v5.11.0:
v5.11.0 with commit rolled back:
|
Pushed a workaround a7de2f4 to dev branch, will push to master and npm if that fixes it. Doesn't fix the actual source of the bug, but it seems too deep for me to hunt it down and keeps only happening with ffmpeg processes, things like |
Thanks for the investigation. I did upgrade my Arch system between restarts of my bot, and I wasn't playing a lot of non-Opus songs so I never noticed. |
Testing now |
Yep that fixes it! I know it is a hack, but thank you for figuring it out. |
YouTube does not always have an Opus audio file available and any other format I pass to Discordie's
FFmpegEncoder
. This has been happening recently after some of the SIGTERM and SIGKILL changes were implemented, but I am uncertain if this issue is caused by those changes.I noticed that the stream never fires an
unpipe
orend
event. The timestamp shows the audio file stopped around 8 seconds from the end of the audio file for a full-length song (approx. 3 minutes).I am still investigating the cause of this. Turning on
FFmpegEncoder
's debug does not show an error, but I may need to increase the log verbosity.The text was updated successfully, but these errors were encountered: