Skip to content
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

Inconsistent Pixel Data Between WASM and Binary Executable in rawvideo Output #818

Open
DeltaFlyerW opened this issue Jan 13, 2025 · 0 comments

Comments

@DeltaFlyerW
Copy link

Describe the bug
The same ffmpeg command produces slightly different pixel data when executed in a WebAssembly (WASM) environment versus the binary executable.

  • WASM Output: [57, 87, 77, 46, 47, 57, 48, 62, 65, 42, ...]
  • Binary Output: [58, 88, 78, 47, 49, 58, 50, 63, 66, 43, ...]

This inconsistency is observed in the output of a rawvideo file using the gray pixel format.

To Reproduce
Run the following command in both the WASM and binary environments:

ffmpeg -i input_file.mp4 \
       -vf "crop=in_w*0.6:in_h*0.6:in_w*0.2:in_h*0.2,format=gray,scale=32:32" \
       -f rawvideo -pix_fmt gray gray.raw
  1. Replace input_file.mp4 with any valid input file.
  2. Compare the pixel data in the resulting gray.raw file from both environments.

Expected behavior
The pixel data in the rawvideo output (gray.raw) should be identical between the WASM and binary environments, as the same command is used with the same input file.

Desktop

  • OS: Windows
  • Browser (for WASM): Chrome
  • Browser Version: 115
  • FFmpeg Binary Version: 5.12, 7.1
  • FFmpeg WASM Version: 0.11.6, 0.12.15

Additional context

  • The issue is reproducible across multiple versions of both the WASM and binary implementations.
  • The input file remains consistent during testing.
  • It is unclear if this discrepancy arises from rounding, floating-point precision differences, or another internal factor.
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