Last active
March 2, 2020 21:27
-
-
Save kmundnic/9701f4dbd0ef1833a690a717d12e06c1 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
# Extract frames from the videos of the RECOLA data set. The images are then cropped to squares and resized to 50%. | |
# The script requires ffmpef and imagemagick installed. | |
for file in train_*.mp4 | |
do | |
echo $file | |
DIR="frames_${file%.*}" | |
mkdir $DIR | |
ffmpeg -i $file -frames 300 "$DIR/frame_%d.png" | |
for image in $DIR/*.png | |
do | |
echo $image | |
convert $image -crop 720x720+280+0 $image # Crop image to a square | |
convert $image -resize 50% $image # Resize image | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment