
Recherche avancée
Autres articles (29)
-
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 (5051)
-
Glitchy mp4 File saved with Matplotlib Animation via ffmpeg
9 janvier 2024, par Jacob IvanovI am attempting to save an
.mp4
file usingmatplotlib.animation
to output some simulation results. The relevent section is as follows :

ANI = FuncAnimation(fig, update, init_func = lambda : None, frames = range(0, 21300, 50))
ANI.save("[removed]/anim/v6 256 unforced 0.02.mp4", dpi = 600, fps = 30, writer = 'ffmpeg')



However, it appears that there is some issue in the produced
.mp4
file, as when I use macOS Quicktime to view the file, it pauses on certain frames, and restarts later on. It appears to consistently pause on the same frame a few seconds in. In order to check if Quicktime was the problem, I opened some random.mp4
files I found in a family group chat, and did not have this issue.

I also tried viewing this
.mp4
file with VLC, which had no issue, and played without any glitches. The Slack media viewer built into the app pauses similar to Quicktime.

The following are all relevant versions :


- 

- macOS : 14.2.1 (23C71)
- Python : 3.10.9 via Homebrew
- Matplotlib : 3.6.2
- ffmpeg : 6.1.1










If it would help, I can also provide the
.mp4
file itself, but I'm not quite sure how to upload it. I will be happy to provide any additional information as well.

Unfortunately, I'm not very familiar with video rendering, but I would appreciate any help anyone could provide. Thank you in advance !


-
I keep having the message "MovieWriter ffmpeg unavailable ; using Pillow instead." I want to save as MP4 an animation
6 décembre 2023, par EnrraI am doing an animation :


animation = FuncAnimation(fig, update, frames=len(time_values), interval=250, repeat=False)

with a simple frame update function, I want it save it as a MP4 format :

animation.save(f'{save_path}/heat_map.mp4', writer='ffmpeg', fps=10)


I get the error message "MovieWriter ffmpeg unavailable ; using Pillow instead."


I tried to do the following :


plt.rcParams['animation.ffmpeg_path'] ='C:\\ProgramData\\Anaconda3\\LIB\\site-packages\\ffmpeg'
FFwriter = animation.FFMpegWriter()
animation.save(f'{save_path}/heat_map.mp4', writer = FFwriter, fps=10)



This gets me an error message :


Traceback (most recent call last):
 File "Graph_V1-8.py", line 406, in <module>
 FFwriter = animation.FFMpegWriter()
AttributeError: 'FuncAnimation' object has no attribute 'FFMpegWriter'
</module>


and I also tried to do the following :

animation.save(f'{save_path}/heat_map.mp4', writer='ffmpeg', fps=10, codec='libx264')


which also get me the error :
"MovieWriter ffmpeg unavailable ; using Pillow instead."


When I write :


pip install ffmpeg
Requirement already satisfied: ffmpeg in c:\programdata\anaconda3\lib\site-packages (1.4)



Thank you in advance for your help


-
IPython.display Video giving an unplayable "empty" video when trying to run an animation from previous plots (Using ffmpeg)
17 novembre 2023, par drhodeI am working on a crater simulation project for a class and am running into a problem when it comes to creating a video. The general project is for us to simulate a surface being hit by craters until it becomes saturated. The code works, however, if I print out every graph in the simulation it would be thousands of graphs until sat is reached and then I would have to manually clip them all together. To circumvent this, I would like to take all the graphs and put them into an animation. I however, have no idea where to even start.


for reference, here is main code block :


import matplotlib.pyplot as plt
import numpy as np
import math
import os
import matplotlib.animation as ani

#I have removed the definitions and class implementation for sake of simplicity and space

ani.writers.list()
FFMpegWriter = ani.writers['ffmpeg']
writer = FFMpegWriter(fps = 10)
fig = plt.gcf()
figure = plt.figure()
fig.patch.set_alpha(1.0)

with writer.saving(figure, "sine.mp4", 150):
 while sat_counter !=1:#while loop that will introduce new crater each iteration

 new_crater = generate_crater()
 new_crater.age = sat_counter
 random_crater_list.append(new_crater)

 i =0

 while i < len(random_crater_list):#looping through the crater list and comparing new crater to all others


 old_crater = random_crater_list[i]


 overlap = square_overlap(old_crater, new_crater)#checks if old crater should be covered/removed by new crater
 

 if overlap == True:
 random_crater_list.remove(old_crater)
 i=i-1

 
 else:
 pass

 i=i+1

 sat = Saturation(random_crater_list)# checks the saturation of the graph and returns a a number between 0 and 100
 if sat > 90:
 sat_counter = 1#base condition used to break the while loop

 writer.grab_frame()
plot_craters(random_crater_list) 




Here is what the final graph looks like
saturated surface


I have tried to use the IPython.display video :



Video("sine.mp4", embed = True, width = 320, height = 320)



This however loads an empty video that is unplayable.
empty video