User:Darija Medic/technicalcourse/commandlinemoovie

From XPUB & Lens-Based wiki

sound:

from os import system

for i in range(5):
        system("cat bleep.raw >> song.raw")


for i in range(2):

    system("cat p1.raw >> song.raw")
    system("cat bleep.raw >> song.raw")
    system("cat bleep.raw >> song.raw")
    system("cat bleep.raw >> song.raw")
    system("cat bleep.raw >> song.raw")
    system("cat bleep.raw >> song.raw")
    system("cat bleep.raw >> song.raw")       
    system("cat p2.raw >> song.raw")
    
    for i in range(5):
        system("cat bleep.raw >> song.raw")
    
for i in range(3):
        system("cat bleep.raw >> song.raw")
        system("cat p3.raw >> song.raw")


system("cat bleep.raw >> song.raw")
system("cat p1.raw >> song.raw")
system("cat bleep.raw >> song.raw")        
system("cat p3.raw >> song.raw")
system("cat p1.raw >> song.raw")

for i in range(20):
    system("cat bleep.raw >> song.raw")

system("sox --rate 44100 --bits 16 --channels 2 --encoding signed-integer song.raw song.wav")
system("rm song.raw")
system("play song.wav")


video:

ffmpeg -i dramaukancelariji.avi -an -r 1 -y -ss 0:00:00 -t 00:04:17 -f image2 frame%04d.png

for (( i=1; i<=257; i++ ))
do
i00=$(printf %04d $i)
echo i is $i, imagefile is $i00
convert  frame$i00.png -modulate ${i}x${i} novi/$i00.png
done


  
for (( i=1; i<=20 ))
do 
i00=$(printf %04d $i)
echo i is $i, imagefile is $i00
convert -size 100x14 xc:none -gravity center \
          -stroke black -strokewidth 2 -annotate 0 'office drama' \
          -background none -shadow 100x3+0+0 +repage \
          -stroke none -fill white     -annotate 0 'office drama' \
           frame$i00.png +swap -gravity south -geometry +0-3 \
          -composite  novi/$i00.png

done

for (( i=200; i<=257; i++ ))
do

i00=$(printf %04d $i)
echo i is $i, imagefile is $i00
convert  frame$i00.png -unsharp ${i}x${i} novi/$i00.png
done


ffmpeg -y -r 3 -b 1800 -sameq -i %04d.png drama.ogv

ffmpeg -i song.wav -i drama.ogv officedrama.ogv