1
0
Fork 0

scripts: strip-metadata helper

This commit is contained in:
Daniel Kempkens 2024-03-08 20:15:18 +01:00
parent 39ebb798c8
commit bd73f5d40d
Signed by: daniel
SSH key fingerprint: SHA256:Ks/MyhQYcPRQiwMKLAKquWCdCPe3JXlb1WttgnAoSeM

View file

@ -0,0 +1,21 @@
#!/usr/bin/env nu
def main [path: string] {
glob $path | each { |item|
match ($item | path parse | get extension | str downcase) {
"jpg" | "jpeg" | "png" => {
exiftool -all= -overwrite_original_in_place $item
},
"mp4" => {
let tmp_item = $"($item)_out.mp4"
ffmpeg -i $item -map_metadata -1 -c:v copy -c:a copy $tmp_item
rm $item
mv $tmp_item $item
},
_ => {
error make { msg: 'Unsupported file extension' }
}
}
}
}