Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. create mass videos for e.g. youtube, out of (music) files:
  2.  
  3. $cd ffmpeg folder, then:
  4.  
  5. 1. check if all files aren't corrupt so the 2nd script will run without stopping because of this kind of error:
  6.  
  7. for FILE in musicfiles/*; do \
  8. CUTEXTENSION=${FILE%.*}; \
  9. #LENGTH=`mp3info -p "00:%02m:%02s" "$FILE"`; \
  10. LENGTH=`./ffmpeg -i ./"$FILE" 2>&1 | awk '/Duration/ { print substr($2,0,length($2)-1) }'`; \
  11. echo $LENGTH $FILE; \
  12. done
  13.  
  14. 2. create mass vids:
  15.  
  16. for FILE in musicfiles/*; do \
  17. CUTEXTENSION=${FILE%.*}; \
  18. #LENGTH=`mp3info -p "00:%02m:%02s" "$FILE"`; \ #this is obsolete because works only on mp3 files
  19. LENGTH=`./ffmpeg -i ./"$FILE" 2>&1 | awk '/Duration/ { print substr($2,0,length($2)-1) }'`; \
  20. ./ffmpeg -loop_input -shortest -i ./img.png -i "./$FILE" -t $LENGTH -y -vcodec libx264 -vpre slow -acodec libfaac -ac 2 -ab 128k -ar 44100 -r 1 "./$CUTEXTENSION.mp4"; \
  21. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement