#!/usr/bin/env bash # Contrôle d'un rendu (écrit par Claude, 20/10/2026) : durée, résolution, codecs (ffprobe de Remotion), # une image toutes les PAS secondes (ffmpeg de Remotion), puis planche avec ImageMagick (magick montage). # Usage : bash scripts/controle.sh out/video.mp4 [pas=1.5] set -euo pipefail cd "$(dirname "$0")/.." V="$1"; PAS="${2:-1.5}" FF=$(pwd -W)/node_modules/@remotion/compositor-win32-x64-msvc/ffmpeg.exe FP=node_modules/@remotion/compositor-win32-x64-msvc/ffprobe.exe NOM=$(basename "$V" .mp4) D=out/controle/$NOM rm -rf "$D"; mkdir -p "$D" "$FP" -v error -show_entries format=duration,size:stream=codec_type,codec_name,width,height,r_frame_rate,sample_rate,channels -of default=nw=1 "$V" | tee "$D/ffprobe.txt" DUR=$("$FP" -v error -show_entries format=duration -of csv=p=0 "$V") python -c " import subprocess d=float('$DUR'); p=float('$PAS'); t=0.2; i=0 while t < d: subprocess.run(['$FF','-v','error','-y','-ss',f'{t:.2f}','-i','$V','-frames:v','1','-vf','scale=360:-1','$D/i%03d.png'%i],check=True) t+=p; i+=1 print(i,'images') " magick montage "$D"/i*.png -tile 6x -geometry +6+6 -background '#cccccc' "$D/planche.png" echo "planche : $D/planche.png"