
Recherche avancée
Médias (1)
-
Bug de détection d’ogg
22 mars 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Video
Autres articles (56)
-
Mise à jour de la version 0.1 vers 0.2
24 juin 2013, parExplications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...) -
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 ;
-
Ecrire une actualité
21 juin 2013, parPrésentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
Vous pouvez personnaliser le formulaire de création d’une actualité.
Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)
Sur d’autres sites (6736)
-
Matplotlib : Live animation works fine but displays a blank plot when being saved
18 juillet 2017, par Loïc PoncinI made a little forest fire animation. My code is at the end of the question.
Here is some information before I ask my question :
- No tree :
forest[i,j] = 0
- A tree :
forest[i,j] = 1
- A tree on fire :
forest[i,j] = 2
Basically what happens is that
constructforest
creates a 2 dimensional array calledforest
of size n by m with a probability of tree occupancy called p. After thatsetonfire
sets on fire theforest
and while theforest
can burnspreadfire
spread the fire.When I run
forestfire
with thePython prompt
or theIPython prompt
I get a nice animation but when I go check the video file that I saved I only see a blank plot.I did some research, I found many questions about this issue but none of the advice I read was helpful :
- matplotlib animation produces a blank
- Matplotlib animation not working in IPython Notebook (blank plot)
- Animation from matplotlib not working in spyder
- Spyder Python Animation not working
Can someone tell me what is going on please ?
forestfire.py
from random import random
import numpy as np
import matplotlib.pylab as plt
import matplotlib.colors as mcolors
import matplotlib.animation as animation
def hazard(p):
r=random()
assert p>=0 and p<=1
return r <= p
def constructforest(n,m,p):
forest = np.zeros((n,n))
for i in xrange(n):
for j in xrange(m):
if hazard(p):
forest[i,j] = 1
return forest
def setfire(forest,i,j):
forest[i,j] = 2
return forest
def spreadfire(forest):
n,m=forest.shape
c = np.copy(forest)
for i in xrange(n):
for j in xrange(m):
if c[i,j] == 1:
Y, X = xrange(max(0,i-1),min(n,i+2)), xrange(max(0,j-1),min(m,j+2))
for y in Y:
for x in X:
if c[y,x] == 2:
forest[i,j] = 2
return forest
def canburn(forest):
n,m=forest.shape
c = np.copy(forest)
for i in xrange(n):
for j in xrange(m):
if c[i,j] == 1:
Y, X = xrange(max(0,i-1),min(n,i+2)), xrange(max(0,j-1),min(m,j+2))
for y in Y:
for x in X:
if c[y,x] == 2:
return True
return False
def forestfire(forest):
fig, ax = plt.subplots()
movie = []
# Colormap
red, green, blue = [(1,0,0,1)], [(0,1,0,1)], [(0,0,1,1)]
colors = np.vstack((blue, green, red))
mycmap = mcolors.LinearSegmentedColormap.from_list('my_colormap', colors)
# Initialization
k = 0
forest = spreadfire(forest)
im = plt.imshow(forest, animated=True, cmap = mycmap, interpolation="none", origin='lower')
movie.append([im])
# Fire propagation
while canburn(forest):
k += 1
print k
forest = spreadfire(forest)
im = plt.imshow(forest, animated=True, cmap = mycmap, interpolation="none", origin='lower')
movie.append([im])
return animation.ArtistAnimation(fig, movie, blit=True, repeat_delay=100)
ani = forestfire(setfire(constructforest(101,101,0.4),50,50))
ani.save("forestfire_test.mp4", writer = 'ffmpeg', fps=5, dpi=500)EDIT
As requested by @Y.Luo by @ImportanceOfBeingErnest in the comments I downgraded matplotlib to 2.0.0 and I changed the framerate of the animation but
forestfire_test.mp4
still displays a blank plot. - No tree :
-
Cannot rotate / transcode video with any tool
14 juin 2019, par hyperapps19I have a video captured from Android Virtual Device (Android Emulator). Its format is WebM. I need to rotate it 90 degrees counterclockwise. But I can’t do this : I have tried FFMpeg - it drops ALL frames except 1-2, several online converters - no result. Then, I"ve tried to encode this video to H.264... no result. Whole video is black (there can be 1-2 frames, again). How can I rotate or reencode this video ?
Video : https://dropmefiles.com/nhy0H (untitled.webm - video needs to be rotated ; out_example.webm - output video from FFMpeg).
-
how to install and run phpize
13 décembre 2016, par Hrishikesh ChoudhariI have been meaning to install ffmpeg as an extension to my php setup. So before I can install it, I need to
phpize
it. I installed php5-dev bysudo apt-get install php5-dev
But now when I run phpize I get the following error :phpize
Cannot find config.m4.
Make sure that you run '/usr/bin/phpize' in the top level source directory of the moduleThe location of my php.ini is
/usr/local/zend/etc/php.ini
From another online resource i tried this
sudo apt-get install autoconf automake libtool m4
But all of them are already installed.
Locate config.m4 didnt return anything.
Any pointers here how I can get phpize and thus, ffmpeg up and running ?