I need a script to cut off the last 6 seconds of multiple videos. The videos do all have different length.
I can‘t find anything helpful online.
Does anyone know
It is almost impossible to do this for windows batch files. Here is the script for the Powershell:
$ListsFiles = Get-ChildItem "D:\VIDEOS\1\" -Filter *.avi;
Foreach ($file in $ListsFiles){
$input_d = [math]::round((ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 $file.Fullname));
$output_duration=$input_d-5;
$ArgumentList = '-i "{0}" -map 0 -c copy -t {1} "D:\VIDEOS\1\output\{2}"' -f $file.Fullname, $output_duration, $file;
Write-Host -ForegroundColor Green -Object $ArgumentList;
Start-Process -FilePath ffmpeg -ArgumentList $ArgumentList -Wait -NoNewWindow;
}