
Recherche avancée
Médias (2)
-
SPIP - plugins - embed code - Exemple
2 septembre 2013, par
Mis à jour : Septembre 2013
Langue : français
Type : Image
-
Publier une image simplement
13 avril 2011, par ,
Mis à jour : Février 2012
Langue : français
Type : Video
Autres articles (25)
-
La sauvegarde automatique de canaux SPIP
1er avril 2010, parDans le cadre de la mise en place d’une plateforme ouverte, il est important pour les hébergeurs de pouvoir disposer de sauvegardes assez régulières pour parer à tout problème éventuel.
Pour réaliser cette tâche on se base sur deux plugins SPIP : Saveauto qui permet une sauvegarde régulière de la base de donnée sous la forme d’un dump mysql (utilisable dans phpmyadmin) mes_fichiers_2 qui permet de réaliser une archive au format zip des données importantes du site (les documents, les éléments (...) -
Script d’installation automatique de MediaSPIP
25 avril 2011, parAfin de palier aux difficultés d’installation dues principalement aux dépendances logicielles coté serveur, un script d’installation "tout en un" en bash a été créé afin de faciliter cette étape sur un serveur doté d’une distribution Linux compatible.
Vous devez bénéficier d’un accès SSH à votre serveur et d’un compte "root" afin de l’utiliser, ce qui permettra d’installer les dépendances. Contactez votre hébergeur si vous ne disposez pas de cela.
La documentation de l’utilisation du script d’installation (...) -
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 (5071)
-
alsdec : change channel sorting so it match reference implementation
3 janvier 2013, par Paul B Maholalsdec : change channel sorting so it match reference implementation
-
avfilter/all : propagate errors of functions from avfilter/formats
5 octobre 2015, par Ganesh Ajjanagaddeavfilter/all : propagate errors of functions from avfilter/formats
Many of the functions from avfilter/formats can return errors, usually AVERROR(ENOMEM).
This propagates the return values.All of these were found by using av_warn_unused_result, demonstrating its utility.
Tested with FATE. I am least sure of the changes to avfilter/filtergraph,
since I don’t know what/how reduce_format is intended to behave and how it should
react to errors.Fixes : CID 1325680, 1325679, 1325678.
Reviewed-by : Michael Niedermayer <michael@niedermayer.cc>
Previous version Reviewed-by : Nicolas George <george@nsup.org>
Previous version Reviewed-by : Clément Bœsch <u@pkh.me>
Signed-off-by : Ganesh Ajjanagadde <gajjanagadde@gmail.com>- [DH] libavfilter/aeval.c
- [DH] libavfilter/af_aformat.c
- [DH] libavfilter/af_agate.c
- [DH] libavfilter/af_amerge.c
- [DH] libavfilter/af_amix.c
- [DH] libavfilter/af_aresample.c
- [DH] libavfilter/af_astreamsync.c
- [DH] libavfilter/af_channelmap.c
- [DH] libavfilter/af_channelsplit.c
- [DH] libavfilter/af_earwax.c
- [DH] libavfilter/af_extrastereo.c
- [DH] libavfilter/af_join.c
- [DH] libavfilter/af_pan.c
- [DH] libavfilter/af_replaygain.c
- [DH] libavfilter/af_resample.c
- [DH] libavfilter/af_sidechaincompress.c
- [DH] libavfilter/af_stereotools.c
- [DH] libavfilter/af_stereowiden.c
- [DH] libavfilter/asrc_anullsrc.c
- [DH] libavfilter/asrc_flite.c
- [DH] libavfilter/avf_aphasemeter.c
- [DH] libavfilter/avf_avectorscope.c
- [DH] libavfilter/avf_concat.c
- [DH] libavfilter/avf_showcqt.c
- [DH] libavfilter/avf_showfreqs.c
- [DH] libavfilter/avf_showspectrum.c
- [DH] libavfilter/avf_showvolume.c
- [DH] libavfilter/avf_showwaves.c
- [DH] libavfilter/avfiltergraph.c
- [DH] libavfilter/buffersink.c
- [DH] libavfilter/buffersrc.c
- [DH] libavfilter/drawutils.c
- [DH] libavfilter/f_drawgraph.c
- [DH] libavfilter/f_ebur128.c
- [DH] libavfilter/formats.c
- [DH] libavfilter/src_movie.c
- [DH] libavfilter/vf_alphamerge.c
- [DH] libavfilter/vf_boxblur.c
- [DH] libavfilter/vf_crop.c
- [DH] libavfilter/vf_detelecine.c
- [DH] libavfilter/vf_displace.c
- [DH] libavfilter/vf_elbg.c
- [DH] libavfilter/vf_extractplanes.c
- [DH] libavfilter/vf_fieldorder.c
- [DH] libavfilter/vf_frei0r.c
- [DH] libavfilter/vf_hflip.c
- [DH] libavfilter/vf_histogram.c
- [DH] libavfilter/vf_il.c
- [DH] libavfilter/vf_maskedmerge.c
- [DH] libavfilter/vf_mergeplanes.c
- [DH] libavfilter/vf_neighbor.c
- [DH] libavfilter/vf_noise.c
- [DH] libavfilter/vf_overlay.c
- [DH] libavfilter/vf_palettegen.c
- [DH] libavfilter/vf_paletteuse.c
- [DH] libavfilter/vf_scale.c
- [DH] libavfilter/vf_showpalette.c
- [DH] libavfilter/vf_stack.c
- [DH] libavfilter/vf_swapuv.c
- [DH] libavfilter/vf_telecine.c
- [DH] libavfilter/vf_transpose.c
- [DH] libavfilter/vf_vectorscope.c
- [DH] libavfilter/vsrc_life.c
-
attempting to save FuncAnimation changes the animation
25 mars 2024, par pibionI am attempting to create and save an animation of a time-varying vector field using matplotlib's FuncAnimation. When I run the animation without attempting to save it, it updates smoothly as expected. However, when I try to save the animation, the vectors increase in length and the animation only appears to update a few times. I've been able to record the screen to get a video file, but I'd like to understand how to save the animation to a video in python.


Here is the code to create the vector field animation. I ran this in a local jupyter notebook using python 3.9.12 on Windows.


%matplotlib notebook
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation

x_min, x_max = -20, 20
y_min, y_max = 0, 25
wire_x = -4
wire_y = 17

# Define the vector field function (example: rotating vector field)
def vector_field(x, y, t):
 x = x - wire_x
 y = y - wire_y
 r = np.sin(t) / (x**2 + y**2)
 u = -r * y
 v = r * x
 return (u, v)

# Define grid
x = np.linspace(x_min, x_max, 20)
y = np.linspace(y_min, y_max, 20)
X, Y = np.meshgrid(x, y)

# Create animation
fig, ax = plt.subplots(1,1)
ax.set_aspect('equal')
ax.set_xlim(x_min, x_max)
ax.set_ylim(y_min, y_max)
ax.set_xlabel('X (m)')
ax.set_ylabel('Y (m)')

u, v = vector_field(X, Y, 1)

quiver = ax.quiver(X, Y, u, v)

time_arr = np.linspace(0,20,200)

plt.show()

def update_quiver(num):
 t = num * 0.1 # Time step
 u, v = vector_field(X, Y, t)
 quiver.set_UVC(u, v)

ani = animation.FuncAnimation(fig, update_quiver, frames=200, interval=50, repeat=False)



This produces an animation whose vectors smoothly vary in length on my computer.


However, when I try to save the animation by adding the lines


writervideo = animation.FFMpegWriter(fps=60) 
ani.save('field_leftWire.mp4', writer=writervideo) 



then the animation changes - the vectors are much longer and it appears to only update a few times throughout the animation.


I'll also note that I had to install ffmpeg and restart my computer as outlined in Installation of FFMPEG for Python in WIndows to get the last two lines to run without error.