Simple pipeline results in non-deterministic frames on macOS for (some?) ProRes videos
Reproduce:
- Build the attached
do.cpp
source file byclang++
with GStreamer v1.20.3 as noted in the file's top comment (nothing special, just substitute the real path to theGStreamer.framework
— the output binary will be./a.out
). - Put the attached
clark-render.mov
video file to the current directory. - Open the current directory in Finder (in order to observe the resulting image dumps).
- Launch the attached
loop.sh
script in the same directory (it's nothing special, it just simplifies multiple attempts and counts them). - In Finder, select the newly generated file
clark-render_frame30.ppm
in order to see its thumbnail preview. - In the running
loop.sh
script, press,
if you see30
(the correct result) in the image thumbnail, repeat as needed; press.
to quit.
Expected: every invocation of ./a.out
results in frame 30, however many times we launch it.
Actual: approx. once in 4—20 invocations the result is frame 33 (or, rarely, frame 32 or even 31 sometimes). After the initial compilation (or after other relatively heavy operations), the wrong result is often seen in the very first attempt.
Note 1: the issue reproduces both on x86_64 (tested in macOS 11.6.8, 11.6.7) and on arm64 (tested on M1 Mini 2020 in macOS 12.5.1).
Note 2: the issue is not new to v1.20, it reproduces with our custom build of v1.18.5 (with AVFoundation-based ProRes support added to vtenc
by Nirbheek Chauhan).