
Recherche avancée
Autres articles (45)
-
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 -
Encoding and processing into web-friendly formats
13 avril 2011, parMediaSPIP automatically converts uploaded files to internet-compatible formats.
Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
All uploaded files are stored online in their original format, so you can (...) -
Automated installation script of MediaSPIP
25 avril 2011, parTo overcome the difficulties mainly due to the installation of server side software dependencies, an "all-in-one" installation script written in bash was created to facilitate this step on a server with a compatible Linux distribution.
You must have access to your server via SSH and a root account to use it, which will install the dependencies. Contact your provider if you do not have that.
The documentation of the use of this installation script is available here.
The code of this (...)
Sur d’autres sites (4786)
-
Pygame : Frame ghosting ?
31 décembre 2013, 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 :
-
Eliminate slow speed factor in ffmpeg and image-magic commands
24 octobre 2018, par Junaid FarooqThe basic idea of these commands is to create a compare, (A compare has defined a jpeg from past and one from the present, combine such as they will slide on each other and show before after images.)
e.g. https://media.evercam.io/v1/cameras/1lowe-scnoe/compares/lower-jreyh.gif
All the commands are written below, doing these operations
- Resize before after image.
- create a Gif using both images.
- Add a log to Gif.
- Create an MP4 file of from GIF.
- Create a thumbnail from mp4 file.
the logo is :
we are making animation and mp4 files using FFmpeg and ImageMagick commands such as
ffmpeg -i before_image.jpg -s 1280x720 before_image_resize.jpg
ffmpeg -i after_image.jpg -s 1280x720 after_image_resize.jpgThe above commands are first to resize both images which are going to be used in animation.
This command is being used for creating a gif.
convert after_image_resize.jpg before_image_resize.jpg -write mpr:stack -delete 0--1 mpr:stack'[1]' \\( mpr:stack'[0]' -set delay 25 -crop 15x0 -reverse \\) mpr:stack'[0]' \\( mpr:stack'[1]' -set delay 27 -crop 15x0 \\) -set delay 2 -loop 0 temp.gif
This command to add a logo to the animation.
convert temp.gif -gravity SouthEast -geometry +15+15 null: evercam-logo.png -layers Composite compa-efxfphu.gif
Then to create an mp4 file as
ffmpeg -f gif -i compa-efxfphu.gif -pix_fmt yuv420p -c:v h264_nvenc -movflags +faststart -filter:v crop='floor(in_w/2)*2:floor(in_h/2)*2' compa-efxfphu.mp4
then to create a thumbnail from this mp4.
ffmpeg -i compa-efxfphu.mp4 -vframes 1 -vf scale=640:-1 -y thumb-compa-efxfphu.jpg
Is there any possibility to reduce any of these steps ? This all takes a lot of time, I am merely interested in both
convert
commands, can we make them into one command ?Or do you see any chance to reduce these all 4 in one ? any input will be so thankful.
-
Generate gif from jpeg images using ffmpeg
3 juin 2017, par wojttaaI want to create a gif image from a jpeg image list, everything works fine, but how can I slow the animation ?
Here is my code :
<?php
exec('ffmpeg -f image2 -i thumb/%001d.jpg -vf scale=480x240 out.gif');
?>