
Recherche avancée
Médias (91)
-
GetID3 - Boutons supplémentaires
9 avril 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Image
-
Core Media Video
4 avril 2013, par
Mis à jour : Juin 2013
Langue : français
Type : Video
-
The pirate bay depuis la Belgique
1er avril 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Image
-
Bug de détection d’ogg
22 mars 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Video
-
Exemple de boutons d’action pour une collection collaborative
27 février 2013, par
Mis à jour : Mars 2013
Langue : français
Type : Image
-
Exemple de boutons d’action pour une collection personnelle
27 février 2013, par
Mis à jour : Février 2013
Langue : English
Type : Image
Autres articles (65)
-
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;
-
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir -
Participer à sa traduction
10 avril 2011Vous pouvez nous aider à améliorer les locutions utilisées dans le logiciel ou à traduire celui-ci dans n’importe qu’elle nouvelle langue permettant sa diffusion à de nouvelles communautés linguistiques.
Pour ce faire, on utilise l’interface de traduction de SPIP où l’ensemble des modules de langue de MediaSPIP sont à disposition. ll vous suffit de vous inscrire sur la liste de discussion des traducteurs pour demander plus d’informations.
Actuellement MediaSPIP n’est disponible qu’en français et (...)
Sur d’autres sites (10441)
-
Pygame : Frame ghosting ?
5 octobre 2022, par Sam TubbI am working on a animation environment in python using pygame. The user draw's each frame, and then using ffmpeg the animation is saved as an .avi movie. I would like to implement a feature, but am not sure how.. frame ghosting. Like display the previous frame while you draw the current.



I tried creating a surface called
ghost
that copies the current frame when the next-frame key is pressed. Then draws it with an alpha level of 10, but this didn't work out correctly.


I am not sure what to do, here is the source code for anyone that thinks they have an idea :



#Anim8

import pygame,subprocess,shutil
from os import makedirs
from pygame.locals import *
from random import randrange
pygame.init()
screen=pygame.display.set_mode((740,580))
draw=pygame.Surface((740,540))
draw.fill((200,200,200))
bcol=(200,200,200)
gui=pygame.Surface((740,40))
gui.fill((50,50,50))
size=2
color=(0,0,0)
screen.fill((200,200,200))
prevcol=0
newcol=0
f=0
msg=''
framerate=60
try:
 makedirs('anim')
except:
 pass
def DrawColors(x,y):
 pygame.draw.rect(gui, (255,0,0), (x+3,y+3,15,15),0)
 pygame.draw.rect(gui, (0,0,0), (x+3,y+21,15,15),0)
 pygame.draw.rect(gui, (0,255,0), (x+21,y+3,15,15),0)
 pygame.draw.rect(gui, (200,200,200), (x+21,y+21,15,15),0)
 pygame.draw.rect(gui, (0,0,255), (x+39,y+3,15,15),0)
while True:
 pygame.display.set_caption('Anim8 - Sam Tubb - '+'Frame: '+str(f)+' '+str(msg))
 mse=pygame.mouse.get_pos()
 screen.blit(gui, (0,0))
 DrawColors(0,0)
 screen.blit(draw,(0,40))
 key=pygame.key.get_pressed()
 if key[K_1]:
 framerate=10
 msg='Frame Rate set to 10'
 if key[K_2]:
 framerate=20
 msg='Frame Rate set to 20'
 if key[K_3]:
 framerate=30
 msg='Frame Rate set to 30'
 if key[K_4]:
 framerate=40
 msg='Frame Rate set to 40'
 if key[K_5]:
 framerate=50
 msg='Frame Rate set to 50'
 if key[K_6]:
 framerate=60
 msg='Frame Rate set to 60'
 if key[K_7]:
 framerate=70
 msg='Frame Rate set to 70'
 if key[K_8]:
 framerate=80
 msg='Frame Rate set to 80'
 if key[K_9]:
 framerate=90
 msg='Frame Rate set to 90'
 if key[K_0]:
 framerate=100
 msg='Frame Rate set to 100'

 if key[K_a]:
 pygame.image.save(draw, 'anim/frame'+str(f)+'.png')
 f+=1
 for e in pygame.event.get():
 if e.type==QUIT:
 shutil.rmtree('anim')
 exit()
 if e.type==KEYDOWN:
 if e.key==K_s:
 msg='Added Frame!'
 pygame.image.save(draw, 'anim/frame'+str(f)+'.png')
 f+=1
 if e.key==K_c:
 draw.fill(bcol)
 if e.key==K_r:
 name='anim'+str(randrange(0,999))+str(randrange(0,999))+'.avi'
 msg='Rendering: '+name
 pygame.display.set_caption('Anim8 - Sam Tubb - '+'Frame: '+str(f)+' '+str(msg))
 subprocess.call('ffmpeg -f image2 -s 640x480 -i anim/frame%01d.png -r '+str(framerate)+' '+name,shell=True)
 msg='Done!'
 if e.key==K_p:
 subprocess.call('ffplay '+name,shell=True)
 if e.type==MOUSEBUTTONDOWN:
 if e.button==1:
 try:
 prevcol=color
 newcol=gui.get_at(mse)
 if newcol==(50,50,50):
 newcol=prevcol
 color=newcol
 except:
 pass
 if e.button==3:
 try:
 prevcol=bcol
 newcol=gui.get_at(mse)
 if newcol==(50,50,50):
 newcol=prevcol
 draw.fill(newcol)
 bcol=newcol
 except:
 pass
 if e.button==4:
 size+=1
 if size>7:
 size=7
 if e.button==5:
 size-=1
 if size==0:
 size=1 
 if e.type == pygame.MOUSEMOTION:
 lineEnd = pygame.mouse.get_pos()
 lineEnd = (lineEnd[0],lineEnd[1]-40)
 if pygame.mouse.get_pressed() == (1, 0, 0):
 pygame.draw.line(draw, color, lineStart, lineEnd, size)
 lineStart = lineEnd

 pygame.display.flip()




Oh, and on another note, just if anyone was curious, here is what the output looks like.. I made a little new year's animation :





-
In Command Line, how do I use a constant set by a nested For ?
20 octobre 2016, par Neo HeraklesIs it possible to set a variable through a For and then use its value ? I’m using two For, one to move across a whole folder and the other one to get the value I desire, the issue here is, the operation done by %watermark% doesn’t recognize the value of %duration%, I believe it’s trying the set the constant and then do the operation simultaneously and that’s why there’s no value, could you please tell me how to pass the variable’s value to duration ?
@echo off
setlocal
for %%G in ("%~dp0\water\*.mp4") do (
for /F "delims=" %%I in ('ffprobe.exe -v error -show_entries format^=duration -of default^=noprint_wrappers^=1:nokey^=1 %%I 2^>^&1') do (
set "duration=%%I"
ffmpeg.exe -i "%%G" -i Watermark.png -filter_complex "[0:v]scale=iw:ih[v0];[1:v][v0]scale2ref=iw/6:ih/10[logo][0v];[0v][logo]overlay=W-w-3:H-h-3:enable='between(t,%duration%/3,(%duration%/3)+2)'[v]" -map "[v]" -map 0:a -codec:v libx264 -preset ultrafast -crf 23 -codec:a copy "%~dp0\out\%%~nG.mp4"
)
)
endlocal
pauseThe output for this is
Undefined constant or missing '(' in '/3)+2)
so it’s definetely the constant the issue here.
Thanks for the help.Edit : SOLVED, the solution was to use %%I instead of %duration%
-
FFmpeg How to make multiple moving box ?
9 avril 2019, par Cancer Leei want to make multiple moving box,i tried but not work
used ffmpeg 4.1.3
./ffmpeg -i ./1115449702147276803.mp4 -vf "drawbox=x=if(between(t\,4.769586\,9.625816)\,(500+((517-500)/(9.625816-4.769586))*(t-4.769586))\,NAN):y=if(between(t\,4.769586\,9.625816)\,(330+((370-330)/(9.625816-4.769586))*(t-4.769586))\,NAN):w=2:h=24:color=#19C7B1:t=fill:enable=between(t\,4.769586\,9.625816),drawbox=x=if(between(t\,4.769586\,9.625816)\,(503+((520-503)/(9.625816-4.769586))*(t-4.769586))\,NAN):y=if(between(t\,4.769586\,9.625816)\,(330+((370-330)/(9.625816-4.769586))*(t-4.769586))\,NAN):w=57:h=24:color=#19C7B1:t=fill:enable=between(t\,4.769586\,9.625816),drawtext=fontfile=/font/PingFang.ttc:text=People :x=if(between(t\,4.769586\,9.625816)\,(503+((520-503)/(9.625816-4.769586))*(t-4.769586))\,NAN) + 2:y=if(between(t\,4.769586\,9.625816)\,(330+((370-330)/(9.625816-4.769586))*(t-4.769586))\,NAN) + 4.800000000000001:fontsize=14:fontcolor=#0000FF:enable=between(t\,4.769586\,9.625816)" ./output/1115449702147276803-1554805242.mp4
the filter desc
drawbox=x=if(between(t\,4.769586\,9.625816)\,(500+((517-500)/(9.625816-4.769586))(t-4.769586))\,NAN):y=if(between(t\,4.769586\,9.625816)\,(330+((370-330)/(9.625816-4.769586))(t-4.769586))\,NAN):w=2:h=24:color=#19C7B1:t=fill:enable=between(t\,4.769586\,9.625816),drawbox=x=if(between(t\,4.769586\,9.625816)\,(503+((520-503)/(9.625816-4.769586))(t-4.769586))\,NAN):y=if(between(t\,4.769586\,9.625816)\,(330+((370-330)/(9.625816-4.769586))(t-4.769586))\,NAN):w=57:h=24:color=#19C7B1:t=fill:enable=between(t\,4.769586\,9.625816),drawtext=fontfile=/font/PingFang.ttc:text=People :x=if(between(t\,4.769586\,9.625816)\,(503+((520-503)/(9.625816-4.769586))(t-4.769586))\,NAN) + 2:y=if(between(t\,4.769586\,9.625816)\,(330+((370-330)/(9.625816-4.769586))(t-4.769586))\,NAN) + 4.800000000000001:fontsize=14:fontcolor=#0000FF:enable=between(t\,4.769586\,9.625816)
The above command not work, because drawbox do not support ’t’, so i tried another one
./ffmpeg -i ./1115449702147276803.mp4 -vf "color=#19C7B1:s=2*24[labelLeft0];[in][labelLeft0]overlay=x=if(between(t\,4.769586\,9.625816)\,(500+((517-500)/(9.625816-4.769586))*(t-4.769586))\,NAN):y=if(between(t\,4.769586\,9.625816)\,(330+((370-330)/(9.625816-4.769586))*(t-4.769586))\,NAN):enable=between(t\,4.769586\,9.625816):shortest=1,color=#19C7B1:s=57*24[labelRight0];[in][labelRight0]overlay=x=if(between(t\,4.769586\,9.625816)\,(503+((520-503)/(9.625816-4.769586))*(t-4.769586))\,NAN):y=if(between(t\,4.769586\,9.625816)\,(330+((370-330)/(9.625816-4.769586))*(t-4.769586))\,NAN):enable=between(t\,4.769586\,9.625816):shortest=1,drawtext=fontfile=/font/PingFang.ttc:text=People :x=if(between(t\,4.769586\,9.625816)\,(503+((520-503)/(9.625816-4.769586))*(t-4.769586))\,NAN) + 2:y=if(between(t\,4.769586\,9.625816)\,(330+((370-330)/(9.625816-4.769586))*(t-4.769586))\,NAN) + 4.800000000000001:fontsize=14:fontcolor=#0000FF:enable=between(t\,4.769586\,9.625816)" ./output/0-1554822681.mp4
the filter desc
color=#19C7B1:s=2*24[labelLeft0] ;[in][labelLeft0]overlay=x=if(between(t\,4.769586\,9.625816)\,(500+((517-500)/(9.625816-4.769586))(t-4.769586))\,NAN):y=if(between(t\,4.769586\,9.625816)\,(330+((370-330)/(9.625816-4.769586))(t-4.769586))\,NAN):enable=between(t\,4.769586\,9.625816):shortest=1,color=#19C7B1:s=57*24[labelRight0] ;[in][labelRight0]overlay=x=if(between(t\,4.769586\,9.625816)\,(503+((520-503)/(9.625816-4.769586))(t-4.769586))\,NAN):y=if(between(t\,4.769586\,9.625816)\,(330+((370-330)/(9.625816-4.769586))(t-4.769586))\,NAN):enable=between(t\,4.769586\,9.625816):shortest=1,drawtext=fontfile=/font/PingFang.ttc:text=People :x=if(between(t\,4.769586\,9.625816)\,(503+((520-503)/(9.625816-4.769586))(t-4.769586))\,NAN) + 2:y=if(between(t\,4.769586\,9.625816)\,(330+((370-330)/(9.625816-4.769586))(t-4.769586))\,NAN) + 4.800000000000001:fontsize=14:fontcolor=#0000FF:enable=between(t\,4.769586\,9.625816)
still can’t work, error logs as follows
[AVFilterGraph @ 0x7fb37ef08680] Too many inputs specified for the "color" filter.
Error reinitializing filters !
Failed to inject frame into filter network : Invalid argument
Error while processing the decoded data for stream #0:0