encodage FFMPEG

This commit is contained in:
rep 2015-10-17 01:07:47 +02:00
parent a581bdb42c
commit 946c9c3368
4 changed files with 28 additions and 13 deletions

View File

@ -1,8 +1,10 @@
# ------------- FILE INFO OUTPUT
echo $1
# ------------- RESIZE IMAGE (512, 1024, 2048, 4096 pixels de haut)
#convert $1 -resize 768x512 $1.768x512
# ------------- HACHAGE
python ./hacheuur.py $1

View File

@ -1,23 +1,27 @@
# ------------- FILE INFO OUTPUT
echo $1
# ------------- ROTATE IMAGE 90 DEGRES SENS HORAIRE
convert -rotate 90 $1 $1.rotate
# ------------- ENSCRIBE
# 1536 pixels / 25 fps = 61 secondes (durée fichier audio)
# enscribe -ts=1 -hf=20 -mask /usr/local/share/horizontal/sounds/piano-major7.flac -length=61.0 _MG_8817.out.2colors.tiff _MG_8817.out.2colors.tiff.wav
#enscribe -ts=0 -length=30.72 $1.rotate $1.enscribe.wav
enscribe -ts=0 -length=82 -hf=40 $1.rotate $1.enscribe.wav
# ------------- NORMALIZE AUDIO
sox --norm $1.enscribe.wav $1.enscribe.norm.wav
echo '-- END NORM --'
# ------------- HORIZONTAL
python ./horizontal.simple.py $1
#NETTOYAGE
rm $1.rotate
rm $1.enscribe.wav

16
ffmpeg_one_liner Normal file
View File

@ -0,0 +1,16 @@
#input AVI, output WEBM
ffmpeg -i hachures-out-2011-01-30-12h05m57s-0.jpg.resized.jpg.avi -c:v libvpx -crf 10 -b:v 1M -c:a libvorbis output.webm
#input WEBM, output WEBM + audio
ffmpeg -i output.webm -i hachures-out-2011-01-30-12h05m57s-0.jpg.wav -acodec libvorbis -shortest output_audio.webm
#input AVI, output webm vpx (CRF) + audio inpujt WAV, audio output libvorbis
ffmpeg -i hachures-out-2011-01-30-12h05m57s-0.jpg.resized.jpg.avi -i hachures-out-2011-01-30-12h05m57s-0.jpg.wav -c:v libvpx -crf 10 -b:v 2M -c:a libvorbis -threads 4 output_audio.webm
#input : suite d'images + audio (wav) output x264 mp4, audio libfaac
ffmpeg -i horizontal%d.png -i pylone3.png.enscribe.norm.wav -c:a libfaac -c:v libx264 -preset ultrafast -crf 32 final.mp4
ffmpeg -i horizontal%d.png -i pylone3.png.enscribe.norm.wav -c:a libfaac -c:v libx264 -b:v 5000k final2.mp4
# pareil mais en essayant un format de pixel en niveau de gris, ou meme 1 bit
ffmpeg -i horizontal%d.png -i pylone3.png.enscribe.norm.wav -c:a libfaac -c:v libx264 -vf format=gray -b:v 5000k final2.mp4
ffmpeg -i horizontal%d.png -i pylone3.png.enscribe.norm.wav -c:a libfaac -c:v libx264 -pix_fmt monow final3.mp4

View File

@ -62,7 +62,7 @@ for i in range(10):
choix = 0
# ponderation du tirage au sort
# tirage au sort
randomFacteur = random.randint(0, len(randomListe)-1)
# assignation des valeurs (paires) finales choisies
@ -87,16 +87,14 @@ for i in range(10):
draw = ImageDraw.Draw(im3)
#lignes noires 1px autour
#draw.line((0, 0, im3.size[0]-1, 0), fill="rgb(255,255,255)")
#lignes colorées de 1 pix
draw.line((im3.size[0]-1, 0, im3.size[0]-1, im3.size[1]-1), fill="rgb(255,255,255)")
im4.paste(im3, (px1, haut, px2, bas))
n = n + randomCopyLargFinal
loop = loop + 1
# les tranches horizontales intactes soulignees de blanc
def TrancheHorizontale() :
# tirage au hasard de la bande copiee
pos = random.randint(0, im1.size[1]-im1.size[1]/20)
@ -120,16 +118,11 @@ for i in range(10):
#print sorted(set(liste),key=liste.count)
# CTRL + S
#chemin du script
#scriptpy = sys.argv[0]
#chemin de l'image : str(sys.argv[1])
#chemin du script : scriptpy = sys.argv[0]
#chemin de l'image : str(sys.argv[1])
scriptpy = str(sys.argv[1])
script = scriptpy[:-3]
n = "%05d" % i
im4.save(script+"."+n+"_"+strftime("%Y%m%d-%Hh%Mm%Ss", gmtime())+".png",'PNG', quality=100)
#print script+"."+str(i)+"_"+strftime("%Y%m%d-%Hh%Mm%Ss", gmtime())+".jpg"