Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- create mass videos for e.g. youtube, out of (music) files:
- $cd ffmpeg folder, then:
- 1. check if all files aren't corrupt so the 2nd script will run without stopping because of this kind of error:
- for FILE in musicfiles/*; do \
- CUTEXTENSION=${FILE%.*}; \
- #LENGTH=`mp3info -p "00:%02m:%02s" "$FILE"`; \
- LENGTH=`./ffmpeg -i ./"$FILE" 2>&1 | awk '/Duration/ { print substr($2,0,length($2)-1) }'`; \
- echo $LENGTH $FILE; \
- done
- 2. create mass vids:
- for FILE in musicfiles/*; do \
- CUTEXTENSION=${FILE%.*}; \
- #LENGTH=`mp3info -p "00:%02m:%02s" "$FILE"`; \ #this is obsolete because works only on mp3 files
- LENGTH=`./ffmpeg -i ./"$FILE" 2>&1 | awk '/Duration/ { print substr($2,0,length($2)-1) }'`; \
- ./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"; \
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement