J'ai la commande FFMPEG suivante qui efface correctement le texte en bas d'une vidéo.
ffmpeg -y -i test_small.mov -acodec libmp3lame -vcodec libx264 -pix_fmt yuv420p -b:a 192k -b:v 1400k -ar 44100 -crf 18 -vf "drawtext=text=string1 string2 string3 string4 string5 string6 string7 :expansion=normal:fontfile=foo.ttf: y=h-line_h-10:x=(5*n): fontcolor=white: fontsize=40: shadowx=2: shadowy=2" -an left_to_right_small.mp4
Mais cela ne se produit qu'une seule fois. Comment puis-je modifier cela pour que l'animation s'arrête avec un délai entre chaque boucle?
Cela marche:
-vf "drawtext=text=string1 string2 string3 string4 string5 string6 string7 :expansion=normal:fontfile=foo.ttf: y=h-line_h-10:x=(mod(5*n\,w+tw)-tw): fontcolor=white: fontsize=40: shadowx=2: shadowy=2"
Voir Desmos pour savoir comment cela fonctionne.
X -axis est la largeur de la vidéo.
Y -axis est l'heure.
La ligne noire est la largeur de l'image (réglable dans Desmos à travers un curseur, x
).
L'ombre noire est le texte de ma formule.
t
dans Desmos correspond à tw
dans FFmpeg CMD, qui est la largeur du texte.
La zone bleue est le texte dans votre formule d'origine.