TLDR: one can easily measure rolling shutter for any digital camera by... filming some flickering light!
Method: https://blog.kasson.com/nikon-z6-7/how-fast-is-the-z7-silent-shutter/
Code: https://www.magiclantern.fm/forum/index.php?topic=23040
Test setup (results provided by @kitor on the forum):
%%shell
wget -q -c https://kitor.pl/eos_r/eos.zip
unzip -o eos.zip
Bunch of files to be identified from metadata. 5D2 files are for cross-checking the method on a camera with known timings.
%%shell
for f in eos/*/*.MOV eos/*/*.MP4; do
echo -n "$f:"
ffprobe -i $f |& grep fps | grep -oE --color=never " [0-9][0-9]+x[0-9]+.* fps"
done
Checking 5D2 files. Will prefer MLV, as H.264 is upsampled from some lower resolution (close to 1872x1053, but not 100% sure). We already know the sensor readout timings for raw image capture, but we do not know exactly the resizing factors in the processing pipeline.
%%shell
for f in eos/5d2/*.MLV; do
echo -n "$f: "
mlv_dump $f --dng -f1-32 -v |& grep -im1 --color=never fps
done
Measuring the light frequency, knowing the readout timings in LiveView (Main Clock = 24 MHz, FPS timer A = 600 at 25p and 576 and 24/30p):
%%shell
echo -n > freq.log
for f in eos/5d2/M17-1739*.dng; do
octave rolling.m $f 24e6 600 | grep --color=never "measured" | tee -a freq.log
done
for f in eos/5d2/M17-174[01]*.dng; do
octave rolling.m $f 24e6 576 | grep --color=never "measured" | tee -a freq.log
done
%%shell
cat freq.log | cut -d ' ' -f 4 > freq.csv
freq = dlmread('freq.csv');
mean(freq)
std(freq)
Looks like our PWM is running at slightly below the expected 500 Hz. This can be confirmed by watching the video clips recorded at 25p and 50p - the PWM is not perfectly in sync. Ideally, the stripes should stay in the same place (they should not move).
Double-checked the Arduino code on my Micro board; its output is definitely 500 Hz and in perfect sync with both 5D2 and 5D3 at 1080p25 (and at 1080p50 on the latter). Not sure what happened on kitor's side; he ran the same code on an Arduino Uno. He did test the signal with an oscilloscope and found it to drift between 499.4 and 498.8 Hz.
Let's assume the PWM frequency is 499 Hz for now.
On EOS R, manual examination reveals the same amount of rolling shutter at some given resolution, regardless of frame rate.
In this case, let's group together all 4K files, all 1080p files, all regular 720p files and all slow-mo 720p files.
%%shell
cd eos/r/
mkdir -p 4K 1080p 720p 720p-sm
for f in *.MP4; do
if ffprobe -i $f |& grep fps | grep -q "3840x2160"; then
mv $f 4K/;
elif ffprobe -i $f |& grep fps | grep -q "1920x1080"; then
mv $f 1080p/;
elif ffprobe -i $f |& grep fps | grep -q "1280x720"; then
if ffprobe -i $f |& grep -q "Audio:"; then
mv $f 720p/
else
mv $f 720p-sm/
fi
fi
done
Let's extract the first 8 frames from each clip.
%%shell
cd eos/r
for f in */*.MP4; do
ffmpeg -loglevel quiet -hide_banner -i $f -vframes 8 $(dirname $f)/$(basename $f .MP4)-%d.png
done
First frames from each set (4K, 1080p, 720p, 720p slow-mo):
%%shell
for f in eos/r/*/*-1.png; do
convert $f -resize 50% -quality 80 $(dirname $f)/$(basename $f .png).jpg
done
We've also got a silent still picture, apparently read out pretty quickly:
%%shell
convert eos/r/2Q4A0211.JPG -resize 20% -quality 80 eos/r/2Q4A0211-small.jpg