so101-block-in-bin-100ep / resize_videos.sh
lipsop's picture
Fix: Resized all wrist-camera videos to 1280x960
2cfb10f
raw
history blame contribute delete
553 Bytes
#!/bin/bash
# The folder with the high-resolution videos
VIDEO_DIR="videos/chunk-000/observation.images.wrist"
# Loop through all mp4 files in the directory
for file in "$VIDEO_DIR"/*.mp4; do
echo "Processing $file ..."
# Use ffmpeg to re-encode the video to a temporary file, then replace the original.
# This is safer than overwriting. The "-loglevel error" keeps the output clean.
ffmpeg -loglevel error -i "$file" -vf "scale=1280:960" -c:a copy "temp.mp4" && mv "temp.mp4" "$file"
echo "Done."
done
echo "All videos have been resized."