Recordly icon indicating copy to clipboard operation
Recordly copied to clipboard

Recordly Recording Failure Report

Open soufian3hm opened this issue 7 months ago • 2 comments

Recordly Recording Failure Report

User-facing symptoms

Recordly stopped working after my very first successful recording.

At first, I had to restart the PC every time before Recordly would record again. After a while, even restarting stopped fixing it. Every new recording would open in Recordly with an error like "failed to load video" or "video format not supported".

What was actually happening

The app was creating .mp4 files that looked like recordings, but the files were invalid. The failed files were only 261 bytes and contained no video stream, no duration, and no playable media.

Examples found in:

C:\Users\AZUS TUF\AppData\Roaming\Recordly\recordings

The broken MP4s had:

  • nb_streams=0
  • duration=N/A
  • file size around 261 bytes
  • MP4 container metadata only, written by FFmpeg/Libavformat

Cursor sidecar JSON files existed and contained cursor activity for several seconds, so the app believed a recording was happening. The failure was specifically that no valid video frames made it into the final MP4.

I also tested the bundled Windows native capture helper directly:

C:\Users\AZUS TUF\AppData\Local\Programs\recordly\resources\app.asar.unpacked\electron\native\wgc-capture\build\Release\wgc-capture.exe

That helper was able to produce a valid H.264 MP4 when run directly against the display. So the native helper itself was not completely broken. The issue was in how the Electron app was routing capture/finalization and how it handled invalid output.

Root causes found

  1. Recordly allowed invalid recordings to proceed.

    The main process had validation logic, but failed validation was treated as a warning in one path. That meant a zero-stream MP4 could still be returned as a successful recording and opened in the editor.

  2. The Windows capture path could use a fragile window-handle capture mode.

    Direct display capture worked, but the app-selected Windows capture route could create empty MP4s. For this system, the safer path was display-coordinate capture.

  3. The frontend had a bad fallback after Windows mux/finalization.

    If muxNativeWindowsRecording failed or returned no valid path, the frontend could still fall back to the original path and open it anyway. That is how the unsupported-format error reached the editor.

  4. Audio muxing could overwrite a good raw capture with a bad muxed output.

    The mux step created a temporary muxed MP4 and then replaced the original file. It did not validate the muxed file before replacement.

Fix implemented locally

The installed app archive was patched here:

C:\Users\AZUS TUF\AppData\Local\Programs\recordly\resources\app.asar

Backups of previous archives were kept in the same folder as:

app.asar.bak-*

Changes made:

  1. Made video validation strict.

    Invalid MP4 output now throws an error instead of being allowed through as a successful recording.

  2. Forced Windows capture to use display capture coordinates.

    The patched Windows start path now uses displayId, displayX, displayY, displayW, and displayH instead of the fragile windowHandle branch.

  3. Blocked the frontend fallback to an invalid path.

    If Windows mux/finalization fails or does not return a valid path, the editor is not opened with the broken MP4.

  4. Validated mux output before replacing the raw recording.

    The muxed file is now checked with the same video validation before it replaces the original recording.

  5. Ignored tiny invalid recordings during recovery lookup.

    The app no longer treats very small MP4 files as usable recent recordings.

  6. Quarantined existing broken recordings.

    The invalid zero-stream files were moved to:

    C:\Users\AZUS TUF\AppData\Roaming\Recordly\recordings\invalid-zero-stream

Result

After the patch, Recordly started recording successfully again and no longer opens the broken 261-byte MP4s in the editor.

Suggested upstream fix

The app should not ever return success: true for a recording until the final video file has been validated to contain at least one playable video stream and a valid duration.

Recommended permanent fixes:

  • Validate native capture output before returning success from stop/finalize handlers.
  • Validate muxed output before replacing the raw recording.
  • Do not fall back to an unvalidated path in the renderer/frontend.
  • Avoid or repair the Windows window-handle capture path when it produces zero-frame MP4s.
  • Add diagnostics when output size is tiny or ffprobe reports nb_streams=0.
  • Consider falling back to display capture automatically when window capture fails.

soufian3hm avatar Apr 21 '26 13:04 soufian3hm

Sounds good, I'd be happy to accept a PR for this seeing as you managed to get it fixed locally

webadderall avatar Apr 21 '26 15:04 webadderall

Thanks, I opened a PR with the source-level fix here: https://github.com/webadderall/Recordly/pull/314
It makes recording finalization stricter so invalid zero-stream MP4s are not returned as successful recordings, validates muxed output before replacing the raw capture, prevents the renderer from opening an unvalidated fallback path, skips tiny invalid recordings during recovery, and routes Windows native capture through display-coordinate capture instead of the fragile window handle path.

soufian3hm avatar Apr 21 '26 16:04 soufian3hm