Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 57d40f7
Showing 1 changed file with 10 additions and 7 deletions.
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

0 comments on commit 57d40f7

Please sign in to comment.