Created
April 24, 2024 04:43
-
-
Save mmodrow/a97e1bbb64f219db698f30ec5aee268d to your computer and use it in GitHub Desktop.
Removes the last 5 seconds from all mp4 files in the directory using ffmpeg and stores them in an adjacent directory.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$videos = Get-ChildItem *.mp4 | |
foreach ($video in $videos) { | |
$duration = [float](ffprobe -i $video.fullName -show_entries format=duration -v quiet -of csv="p=0") | |
ffmpeg -i $video.fullName -ss 0 -to ($duration - 5) (Join-Path "..\trimmed" ($video.name)) | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment