Skip to content

mp4decrypt error code -8 does not report "no space left on device" – misleading and frustrating #999

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

Open
PatrykMis opened this issue Mar 26, 2025 · 0 comments

Comments

@PatrykMis
Copy link

PatrykMis commented Mar 26, 2025

Summary

When mp4decrypt fails with error code -8, it gives no meaningful context. After extensive debugging and false leads (thinking it’s a DRM/PSSH/key mismatch), it turns out the root cause is often simply no space left on device.

Even worse: the tool actually writes as much as possible until the disk is full, then throws a generic Decryption failed (error code -8) — without mentioning anything about disk I/O or write errors. This strongly suggests an issue with:

  • the decryption key or KID,
  • file integrity,
  • encrypted fragment mismatch,

...when in reality, it's just the filesystem saying "I'm full, bro."

This behavior is incredibly misleading and can waste hours of debugging time.

How to reproduce

  1. Attempt to decrypt a large .mp4 file using a valid key:
    mp4decrypt --key <kid:key> input.mp4 output.mp4
    
  2. Ensure the target filesystem is nearly full (less than required output size)
  3. Observe the error:
    Decryption failed (error code -8)
    

Expected behavior

The tool should report something like:

Decryption failed: no space left on device (error code -8)

Or at least mention that this can be caused by disk space issues.

Why it matters

The current error message leads users to believe it’s a problem with encryption, licensing, or input file validity — when in fact, the issue is purely local and unrelated to DRM.

Suggested fix

Check for write() errors related to ENOSPC and either:

  • Print a more specific message when detected
  • Add a short hint to the error code -8 message

Let me know if this can be addressed. I’d be happy to help test a fix.

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

No branches or pull requests

1 participant