
Recherche avancée
Médias (91)
-
Spitfire Parade - Crisis
15 mai 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Wired NextMusic
14 mai 2011, par
Mis à jour : Février 2012
Langue : English
Type : Video
-
Video d’abeille en portrait
14 mai 2011, par
Mis à jour : Février 2012
Langue : français
Type : Video
-
Sintel MP4 Surround 5.1 Full
13 mai 2011, par
Mis à jour : Février 2012
Langue : English
Type : Video
-
Carte de Schillerkiez
13 mai 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Texte
-
Publier une image simplement
13 avril 2011, par ,
Mis à jour : Février 2012
Langue : français
Type : Video
Autres articles (59)
-
Installation en mode ferme
4 février 2011, parLe mode ferme permet d’héberger plusieurs sites de type MediaSPIP en n’installant qu’une seule fois son noyau fonctionnel.
C’est la méthode que nous utilisons sur cette même plateforme.
L’utilisation en mode ferme nécessite de connaïtre un peu le mécanisme de SPIP contrairement à la version standalone qui ne nécessite pas réellement de connaissances spécifique puisque l’espace privé habituel de SPIP n’est plus utilisé.
Dans un premier temps, vous devez avoir installé les mêmes fichiers que l’installation (...) -
Multilang : améliorer l’interface pour les blocs multilingues
18 février 2011, parMultilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela. -
HTML5 audio and video support
13 avril 2011, parMediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
For older browsers the Flowplayer flash fallback is used.
MediaSPIP allows for media playback on major mobile platforms with the above (...)
Sur d’autres sites (10366)
-
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 :
-
FFmpeg and Jupyter Notebooks
12 mai 2022, par ClerniI'm getting the error
RuntimeError: Requested MovieWriter (ffmpeg) not available
when trying to run this simple example of creating and displaying an animation in a Jupyter Notebook.

---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
 in <module>
 8 
 9 # Define the meta data for the movie
---> 10 FFMpegWriter = manimation.writers['ffmpeg']
 11 metadata = dict(title='Movie Test', artist='Matplotlib',
 12 comment='a red circle following a blue sine wave')

/usr/local/lib/python3.8/dist-packages/matplotlib/animation.py in __getitem__(self, name)
 164 if self.is_available(name):
 165 return self._registered[name]
--> 166 raise RuntimeError(f"Requested MovieWriter ({name}) not available")
 167 
 168 

RuntimeError: Requested MovieWriter (ffmpeg) not available

</module>


Running
!pip install ffmpeg
didn't help, asffmpeg
is already installed, apparently :

Requirement already satisfied: ffmpeg in /home/username/.local/lib/python3.8/site-packages



How can I make this work ?


-
Does the incoming codec or audio-video sync matter when encoding from Xvfb using FFMPEG ?
15 décembre 2022, par NavHow I'm capturing :

I'm using Xvfb on Linux, to capture a video and audio from an app that is also running on Linux. I'm using-f x11grab
when capturing that video headlessly from Xvfb's frambuffer using FFMPEG, and encoding it using a few other parameters like-c:v libx264 -pix_fmt yuv420p
.

The questions :

Since I'm reading from Xvfb framebuffer :

- 

- Would it matter that the app uses
SVC
to encode the video, and I'm using H.264 ? - Would it matter if I use a different framerate than the app is using ?
- Would it matter if I use a different
pix_fmt
than what the app is using ?








Reason for asking :



As shown in the image (blue is the app, red is FFMPEG, green is Xvfb) ;

- 

- The CPU percentage consumed by FFMPEG shoots up when the app's CPU percentage shoots up. I've also encountered audio being ahead of video for some participants, but I'm unable to figure out whether it's due to network lag or due to FFMPEG's encoding.
- Also, the aim is to reduce CPU consumption, so I was looking to see if I could do FFMPEG encoding in the same format as the app.






- Would it matter that the app uses