Advertisement
metalx1000

FFMPEG combine all videos into one file BASH

Jul 21st, 2019
800
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.51 KB | None | 0 0
  1. #!/bin/bash
  2. #Combines all videos in current folder with given extension
  3. #into single file
  4. #Created by Kris Occhipinti
  5. #Copyright July 21th 2019
  6. #License: GPLv3 - https://www.gnu.org/licenses/gpl-3.0.txt
  7.  
  8. if [ "$#" -eq 0 ];then
  9.   echo "Extension needed"
  10.   echo "Example: $0 MOV"
  11.   exit 1
  12. else
  13.   ext="$1"
  14. fi
  15.  
  16. echo "Combining $ext files"
  17.  
  18. tmp="videos.tmp"
  19. rm $tmp
  20. ls *.$ext|while read v
  21. do
  22.   echo "file $v" >> $tmp
  23. done
  24.  
  25. ffmpeg -f concat -safe 0 -i $tmp -c copy output.$ext
  26. mpv "output.$ext"
  27. rm $tmp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement