Advertisement
Guest User

Untitled

a guest
Jun 21st, 2019
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @echo off
  2.  
  3. rem === input ===
  4. set input="in.mp4"
  5. set output="out.mp4"
  6. set start=10
  7. set end=20
  8. set overlay="[0:v][1:v]overlay=10:10"
  9.  
  10. rem === get video duration ===
  11. ffprobe -v error -show_entries format=duration -of "default=nw=1:nk=1" %input% > temp.txt
  12. set /p duration=<temp.txt
  13. set /p tduration=<temp.txt
  14. set /A "tduration-=%start%+%end%"
  15.  
  16. ffmpeg -i %input% -i logo.png -t %start% -filter_complex %overlay% -y part_start.mp4
  17. ffmpeg -sseof -%end% -i %input% -i logo.png -filter_complex %overlay% -y part_end.mp4
  18. ffmpeg -i %input% -ss %start% -t %tduration% -c copy -y part_middle.mp4
  19. echo file 'part_start.mp4' > temp.txt
  20. echo file 'part_middle.mp4' >> temp.txt
  21. echo file 'part_end.mp4' >> temp.txt
  22. ffmpeg -f concat -safe 0 -i temp.txt -c copy -y %output%
  23. del temp.txt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement