Here is how to make one of these:
https://youtu.be/
You need ffmpeg.. this script below will take a input filename, and output filename (I just launch it towards a "clips" subdirectory).. then it yanks out just the last 4 seconds of the video.. if you want more or less time, just edit the line:
set /A starttime = VIDEO_LENGTH_S - 4
cut.cmd:
Code: Select all
rem @echo off
set input=%1
set output=%2
ffmpeg -i "%input%" 2> output.tmp
rem search " Duration: HH:MM:SS.mm, start: NNNN.NNNN, bitrate: xxxx kb/s"
for /F "tokens=1,2,3,4,5,6 delims=:., " %%i in (output.tmp) do (
if "%%i"=="Duration" call :calcLength %%j %%k %%l %%m
)
goto :EOF
:calcLength
set Var=%3
FOR /F "tokens=* delims=0" %%A IN ("%Var%") DO SET Var=%%A
set /A s=%Var%
set /A s=s+%2*60
set /A s=s+%1*60*60
set /A VIDEO_LENGTH_S = s
set /A VIDEO_LENGTH_MS = s*1000 + %4
echo Video duration %1:%2:%3.%4 = %VIDEO_LENGTH_MS%ms = %VIDEO_LENGTH_S%s
rem ** 2:00 for the start, 4:00 from the end
set /A starttime = VIDEO_LENGTH_S - 4
set /A stoptime = VIDEO_LENGTH_S
set /A duration = stoptime - starttime
rem --stop-time %stoptime%
c:\util\ffmpeg -i "%input%" -ss %starttime% -c copy "%output%"
rem "C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" -vvv --start-time %starttime% "%input%" --sout=#transcode{vcodec=h264,vb=1200,acodec=mp3,ab=128}:standard{access=file,dst=%output%} vlc://quit
loop.cmd:
Code: Select all
md snips
for %%f in (*.avi) do (
echo %%~nf
cut.cmd %%~nf.avi snips\%%~nf.avi
)
Code: Select all
sample command line to fix non-standard ones:
-ss (starttime)
-t (duration)
ffmpeg -i Outlaws_Round1_Heat3.avi -ss 8 -t 3.2 -c copy snips\Outlaws_Round1_Heat3.avi
Once it processed and uploaded, I went to youtube, and added some ad sponsored audio to it..
Wahlah..
I'd love to see other's videos.. maybe my camera angle isn't the best..