Fastest way to validate media file

⚓ Rust    📅 2025-09-27    👤 surdeus    👁️ 8      

surdeus

Warning

This post was published 33 days ago. The information described in this article may have changed.

I have lots (tens of thousands) media files, some of which are corrupted. I'm thinking of way to check their integrity in Rust, so I need a non-panicking way to parse them (and to validate that, given resolution w by h, there are indeed w*h pixels).

Those files are mostly jpeg, png, mp4, with a few files of other formats also present.

What solution would be the fastest? I'm considering

  1. Invoking ffmpeg -i ... -f null /dev/null and checking exit code;
  2. image Rust crate, and something else for video.

1 post - 1 participant

Read full topic

🏷️ Rust_feed