Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. @Echo Off
  2. SetLocal
  3.  
  4. Set "ext=mp4"
  5.  
  6. Set "opts=-v quiet"
  7.  
  8. Set "opts=%opts% -print_format "compact=print_section=0:nokey=1:escape=csv"
  9.  
  10. Set "opts=%opts% -show_entries "format=duration""
  11.  
  12. If Exist *.%ext% (If Not Exist "Trimmed" MD Trimmed)
  13.  
  14. For %%a In (*.%ext%) Do Call :Sub "%%~a"
  15.  
  16. Exit/B
  17.  
  18. :Sub
  19.  
  20. For /f "Tokens=1* Delims=." %%a In (
  21. 'FFProbe %opts% %1') Do (Set/A "ws=%%a-7.85" & Set "ps=%%b")
  22.  
  23. rem If %ws% Lss 20 GoTo :EOF
  24.  
  25. Set/A hh=ws/(60*60), lo=ws%%(60*60), mm=lo/60, ss=lo%%60
  26.  
  27. If %hh% Lss 10 Set hh=0%hh%
  28.  
  29. If %mm% Lss 10 Set mm=0%mm%
  30.  
  31. If %ss% Lss 10 Set ss=0%ss%
  32.  
  33. FFMpeg -i %1 -ss 00:00:04.5000 -to %hh%:%mm%:%ss%.%ps:~,3% -c:v copy -c:a copy "Trimmed%~1"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement