Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(sipi): extract frames from video even without aspect ratio (DEV-802) #2041

Merged
merged 2 commits into from Apr 13, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 10 additions & 7 deletions sipi/scripts/export-moving-image-frames.sh
Expand Up @@ -108,13 +108,16 @@ fps=$(expr "scale=2;${numerator}/${denumerator}" | bc)
# read aspect ratio from input file
aspect=$(ffprobe -v error -select_streams v:0 -show_entries stream=display_aspect_ratio -of csv=s=x:p=0 ../"${file}")

echo $aspect

# --
# split the aspect ratio to have two separated numbers for calculating
IFS=':' read -a array <<<"$aspect"
aspectW="${array[0]}"
aspectH="${array[1]}"
# if aspect ratio does not exist in video file metadata
if [ ! -z {$aspect} ]; then
# get aspect ratio from video dimension (width and height)
aspectW=$(ffprobe -v error -select_streams v:0 -show_entries stream=width -of csv=s=x:p=0 ../"${file}")
aspectH=$(ffprobe -v error -select_streams v:0 -show_entries stream=height -of csv=s=x:p=0 ../"${file}")
else
IFS=':' read -a array <<<"$aspect"
aspectW="${array[0]}"
aspectH="${array[1]}"
fi

# --
# framesize
Expand Down