Skip to content

fix crash when ffmpeg fails during hitsound rendering#65

Draft
ILW8 wants to merge 1 commit intoLeaPhant:mainfrom
ILW8:hitsound-handle-ffmpeg-error
Draft

fix crash when ffmpeg fails during hitsound rendering#65
ILW8 wants to merge 1 commit intoLeaPhant:mainfrom
ILW8:hitsound-handle-ffmpeg-error

Conversation

@ILW8
Copy link
Copy Markdown

@ILW8 ILW8 commented Dec 26, 2021

This just adds a catch to a Promise.all in renderHitsounds() in render_frame.js. Without it, the render would get stuck forever after ffmpeg exits unexpectedly instead of either failing completely or recovering. The specific issue we ran into was with a hitsound audio file that ffmpeg couldn't handle (ogg vorbis inside a .wav container). Command to reproduce the issue: !render https://osu.ppy.sh/beatmapsets/1276314#osu/2651771 strains 60s.

Still testing various maps, will edit to a full PR once I feel confident this doesn't introduce any regressions.

The output from when ffmpeg exited with exit code 1:

Error: Command failed: /path/to/node_modules/ffmpeg-static/ffmpeg <..truncated..>
<..truncated..>
Input #6, wav, from '/tmp/frames/519695412/map/drum-hitclap.wav':
  Metadata:
    encoder         : Slicex
  Duration: 00:00:04.00, bitrate: 92 kb/s
  Stream #6:0: Audio: none (Og[0][0] / 0x674F), 44100 Hz, 2 channels, 128 kb/s
<..truncated..>
Stream mapping:
  Stream #0:0 (pcm_s16le) -> adelay
  Stream #0:0 (pcm_s16le) -> adelay
  Stream #0:0 (pcm_s16le) -> adelay
  <..truncated..>
  Stream #4:0 (pcm_s16le) -> adelay
  Stream #5:0 (pcm_s16le) -> adelay
  Stream #5:0 (pcm_s16le) -> adelay
  Stream #5:0 (pcm_s16le) -> adelay
  Stream #6:0 (?) -> adelay
  dynaudnorm -> Stream #0:0 (pcm_s16le)
Decoder (codec none) not found for input stream #6:0

    at ChildProcess.exithandler (node:child_process:326:12)
    at ChildProcess.emit (node:events:365:28)
    at maybeClose (node:internal/child_process:1067:16)
    at Socket.<anonymous> (node:internal/child_process:453:11)
    at Socket.emit (node:events:365:28)
    at Pipe.<anonymous> (node:net:661:12) {
  killed: false,
  code: 1,
  signal: null,
  cmd: '<..truncated..>',
  stdout: '',
  stderr: '<..truncated..>'
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant