
Recherche avancée
Autres articles (55)
-
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 (4406)
-
CRO Audit : Increase Your Conversions in 10 Simple Steps
25 mars 2024, par Erin -
Saving an animation using ffmpeg and matplotlib on anaconda3
21 juin 2016, par Varsha DyavaiahI am trying to create videos of NBA Action with Sportsvu data.
I was following the steps given in this blog by Dan Vatterott :
I am trying to create a animation and save it using ffmpeg and matplotlib.
The code snippet is attached below.import matplotlib.animation as animation
plt.rcParams['animation.ffmpeg_path'] = '/home/anaconda3/pkgs/ffmpeg-2.1.0-1/bin'
fig = plt.figure(figsize=(15,7.5)) #create figure object
ax = plt.gca() #create axis object
draw_court([0,100,0,50]) #draw the court
player_text = list(range(10)) #create player text vector
player_circ = list(range(10)) #create player circle vector
ball_circ = plt.Circle((0,0), 1.1, color=[1, 0.4, 0]) #create circle object for bal
for i in list(range(10)): #create circle object and text object for each player
col=['w','k'] if i<5 else ['k','w'] #color scheme
player_circ[i] = plt.Circle((0,0), 2.2, facecolor=col[0],edgecolor='k') #player circle
player_text[i] = ax.text(0,0,'',color=col[1],ha='center',va='center') #player jersey # (text)
ani = animation.FuncAnimation(fig, animate, frames=np.arange(0,np.size(ball_xy,0)), init_func=init, blit=True, interval=5, repeat=False,\
save_count=0) #function for making video
FFwriter = animation.FFMpegWriter()
ani.save('Event_%d.mp4' % (search_id),dpi=100,writer = FFwriter,fps=25) #function for saving video
plt.close('all') #close the plotWhen I try to save the animation ’ani’ , I get Errno 13 (Permission denied).
---------------------------------------------------------------------------
PermissionError Traceback (most recent call last)
in <module>()
17
18 FFwriter = animation.FFMpegWriter()
---> 19 ani.save('Event_%d.mp4' % (search_id),dpi=100,writer = FFwriter,fps=25) #function for saving video
20 plt.close('all') #close the plot
/home/anaconda3/lib/python3.5/site-packages/matplotlib/animation.py in save(self, filename, writer, fps, dpi, codec, bitrate, extra_args, metadata, extra_anim, savefig_kwargs)
799 # since GUI widgets are gone. Either need to remove extra code to
800 # allow for this non-existant use case or find a way to make it work.
--> 801 with writer.saving(self._fig, filename, dpi):
802 for anim in all_anim:
803 # Clear the initial frame
/home/anaconda3/lib/python3.5/contextlib.py in __enter__(self)
57 def __enter__(self):
58 try:
---> 59 return next(self.gen)
60 except StopIteration:
61 raise RuntimeError("generator didn't yield") from None
/home/anaconda3/lib/python3.5/site-packages/matplotlib/animation.py in saving(self, *args)
192 '''
193 # This particular sequence is what contextlib.contextmanager wants
--> 194 self.setup(*args)
195 yield
196 self.finish()
/home/anaconda3/lib/python3.5/site-packages/matplotlib/animation.py in setup(self, fig, outfile, dpi, *args)
182 # Run here so that grab_frame() can write the data to a pipe. This
183 # eliminates the need for temp files.
--> 184 self._run()
185
186 @contextlib.contextmanager
/home/anaconda3/lib/python3.5/site-packages/matplotlib/animation.py in _run(self)
210 stdout=output, stderr=output,
211 stdin=subprocess.PIPE,
--> 212 creationflags=subprocess_creation_flags)
213
214 def finish(self):
/home/anaconda3/lib/python3.5/subprocess.py in __init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds)
948 c2pread, c2pwrite,
949 errread, errwrite,
--> 950 restore_signals, start_new_session)
951 except:
952 # Cleanup if the child failed starting.
/home/anaconda3/lib/python3.5/subprocess.py in _execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, restore_signals, start_new_session)
1542 else:
1543 err_msg += ': ' + repr(orig_executable)
-> 1544 raise child_exception_type(errno_num, err_msg)
1545 raise child_exception_type(err_msg)
1546
PermissionError: [Errno 13] Permission denied
</module>Can someone help me ? Thanks in advance.
-
10 Key Google Analytics Limitations You Should Be Aware Of
9 mai 2022, par Erin