From 23e25b0b2e7a33e5b698cce604d5d11c7335ba99 Mon Sep 17 00:00:00 2001 From: jan Date: Sun, 12 Feb 2023 19:54:49 +0100 Subject: [PATCH] Add ffmpeg AR test function --- zsh/ffmpeg | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/zsh/ffmpeg b/zsh/ffmpeg index 2ed6ceb..6cff9dc 100644 --- a/zsh/ffmpeg +++ b/zsh/ffmpeg @@ -62,6 +62,16 @@ function ff-ar4-3() { mv "$1" "_$1" && mv "temp_$1" "$1" } +# ffmpeg fix 4:3 AR ($1 = file, $2 1/1, $4:3) +function ff-ar-custom() { + if [ $# -lt 3 ]; then + >&2 echo "Not enough arguments (\$1 = 'file', \$2 '1/1', \$3 '4:3')" + return 0 + else + ffmpeg -i "$1" -c copy -map 0 -bsf:v "h264_metadata=sample_aspect_ratio=$2" -aspect $3 -movflags faststart "_$1" + fi +} + # ffmpeg fix Non-monotonous DTS function ff-dts() { ffmpeg -fflags +igndts -i "$1" -c copy -movflags faststart "temp_$1"