Frame extraction yielding different images on android vs desktop ffmpeg build
02:57 05 Nov 2025

I'm trying to implement an android version of my code which runs ffmpeg to extract frames from videos. I've noticed that extracting frames from the same video on an android vs a desktop ffmpeg build yielded slightly different images. Every pixel value in extracted frames are slightly off. I am not to my knowledge using hardware acceleration.

I've tried to build ffmpeg from source using identical libraries and library versions on both platforms, and still get the same result. To build ffmpeg binaries for android, I've used ffmpeg-android-maker, and modified the code to integrate the exact same versions of every lib and ffmpeg source files for both builds.

The video I've encoutered this issue on is an mp4 with HEVC codec. Note that I've encountered issues building ffmpeg with x265 library, and have thus disabled it on ffmpeg builds of both platforms.

To extract frames from the video files in a "lossless" manner, I've ran ffmpeg -vsync 2 -i file.mp4 -f image2 %3d.bmp . I am then reading the extracted frames on a single desktop (Win11) using OpenCV. Note that all builds were made on a docker container running Ubuntu22.04 on a Win11 host machine.

What could be causing the frame difference if the libraries I've installed are the same ?

video ffmpeg codec android-ffmpeg