I have several training videos. All .MP4s.
I want to remove 3.5 seconds from the beginning and 4.5 seconds from the end of the entire folder of them...
I know of ffmpeg and ffprobe - but my knowledge and mastery of them both is limited.
Can someone provide a script for this, or, at least a program that will make this easy for me? I keep searching and I reach dead-ends everytime or scripts that do not work.
I am also open to using Linux/Windows but not mac.
edit: First part completed. Will keep on studying this command further in order to learn batch; Here's the easy part, how to batch trim an entire folder of MP4s:
for %%a in ("*.mp4") do ffmpeg -i "%%a" -ss 00:00:03.5 -vcodec copy -acodec copy "newfiles\%%~na.mp4"
pause
I kindly thank everyone here for encouraging me to keep searching, I found a solution that is perfect. Here it is. I am afraid the examples given even in the comments elude me but I will still try to read up and educate myself on how those commands work. Thanks again. Replace 8.25 (end trim) and 4.25 (beginning trim) and change the values until you are satisfied with the outputs.
Eric Lalonde script was good enough, thank you!
For those who can't or don't like installing ffmpeg, I added ffmpeg path variable. In my scenario I am cutting the 14 seconds from the beginning and 9 seconds at the end.
I solved it. I don't mind helping you, but I'm not going to provide the full solution. I will, however, give you hints with the trickiest parts. I'll leave it up to you to fill in the blanks.
ffmpeg
will let you do what you want. The-ss
switch specifies the start position.-t
specifies duration. Unfortunately, there's no switch or program substitution variable that'll internally perform the needed math on the video length to trim-right. You'll have to compute that via scripting.First you'll need the total length of the unmodified video:
To calculate the value for the
-t
switch, you can invoke PowerShell to determine newLength = totalLength - (leftTrim + rightTrim). Here's the secret sauce:Once you get your target length calculated, plug it into
ffmpeg
like this: