Created
December 29, 2021 19:55
-
-
Save Hermann-SW/364ccd490527555bbbd4ea94cbbebcb2 to your computer and use it in GitHub Desktop.
Bash script determines and shows the important frame from multiple exposure raspivid video
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function video_length { | |
ffprobe -v error -show_entries format=duration \ | |
-of default=noprint_wrappers=1:nokey=1 $1 | |
} | |
h264=`basename $1 .h264` | |
mp1=${h264}.mp4 | |
mp2=${h264}2.mp4 | |
rm -f $mp1 $mp2 | |
ffmpeg -loglevel -8 -r 57 -i $1 -c copy $mp1 | |
video_length $mp1 | |
ffmpeg -loglevel -8 -sseof -2 -i $mp1 -c copy $mp2 | |
video_length $mp2 | |
rm -f ${h264}.frame.* | |
ffmpeg -loglevel -8 -i $mp2 ${h264}.frame.%04d.png | |
frame=`ls -l ${h264}.frame.0* | grep "pi pi [^ ]" | head -1 | cut -f10- -d\ ` | |
echo $frame | |
eog $frame |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This script is for video recorded at framerate 57fps (Raspberry v1 camera mode 5, 1296x730).
374.8m/s (supersonic) pellet inflight captured with 10KHz PWM frequency and 2µs flash durations:
https://forums.raspberrypi.com/viewtopic.php?p=1955243#p1955243