Skip to content
Permalink
Browse files
fix(sipi): extract frames from video even without aspect ratio (DEV-802
…) (#2041)
  • Loading branch information
kilchenmann committed Apr 13, 2022
1 parent f72e7a0 commit 57d40f79beed8035ee461562b54abc347746237b
Showing with 10 additions and 7 deletions.
  1. +10 −7 sipi/scripts/export-moving-image-frames.sh
@@ -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

0 comments on commit 57d40f7

Please sign in to comment.