入れるシェルスクリプト。
入れるとこんな感じ。
#!/bin/bash FILE="$1" echo "FILE=$FILE" MODEL=$(exiftool -p "\$Model + \$LensType" "$FILE") FocalLength=$(exiftool -p "\$FocalLengthIn35mmFormat" "$FILE" | tr -d ' ') BOTTOM_LINE=$(exiftool -p "$FocalLength f\$FNumber \$ShutterSpeed ISO\$ISO" "$FILE") RORATION=$(exiftool -p "\$Orientation" "$FILE" | awk '{print $2}') echo -e "$MODEL\n$BOTTOM_LINE" AREA="$(("$(exiftool -p "\$ImageWidth * \$ImageHeight" "$FILE")"))" echo "sqrt($AREA)" | bc FONT_SIZE=$(echo "sqrt($AREA) / 100" | bc) generate_drawtext() { local LINE="$1" local TEXT="$2" local Y=$((10 + $LINE * ($FONT_SIZE + 10))) echo "drawtext=text='$TEXT' \ :font=Sans \ :fontsize=$FONT_SIZE \ :fontcolor=white \ :bordercolor=black \ :x=w-tw-10 \ :y=h-th-$Y \ :line_spacing=10 \ :borderw=2 \ :fix_bounds=true" } DRAW_TEXT_0=$(generate_drawtext 0 "$BOTTOM_LINE") DRAW_TEXT_1=$(generate_drawtext 1 "$MODEL") OUTPUT_FILE="${FILE%.*}_exif.jpg" ffmpeg -i "$FILE" -map_metadata 0 -vf "$DRAW_TEXT_0,$DRAW_TEXT_1" \ -qscale:v 1 "$OUTPUT_FILE" exiftool -overwrite_original -TagsFromFile "$FILE" "$OUTPUT_FILE"