
Recherche avancée
Médias (1)
-
Revolution of Open-source and film making towards open film making
6 octobre 2011, par
Mis à jour : Juillet 2013
Langue : English
Type : Texte
Autres articles (83)
-
Le profil des utilisateurs
12 avril 2011, parChaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...) -
Configurer la prise en compte des langues
15 novembre 2010, parAccéder à la configuration et ajouter des langues prises en compte
Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...) -
Sélection de projets utilisant MediaSPIP
29 avril 2011, parLes exemples cités ci-dessous sont des éléments représentatifs d’usages spécifiques de MediaSPIP pour certains projets.
Vous pensez avoir un site "remarquable" réalisé avec MediaSPIP ? Faites le nous savoir ici.
Ferme MediaSPIP @ Infini
L’Association Infini développe des activités d’accueil, de point d’accès internet, de formation, de conduite de projets innovants dans le domaine des Technologies de l’Information et de la Communication, et l’hébergement de sites. Elle joue en la matière un rôle unique (...)
Sur d’autres sites (9057)
-
even though my code is running without an error, it does not generate plot or video. I have xming runing
23 octobre 2017, par Amin AbbasiThis is my first code and I am really new to coding. I am trying to create a video or just plot my code.Eeven though my code is running without an error, I can’t get the video or the plot to generate. I have xming running and I have plotted a sample to make sure it not a computer Issue. I have also tried the following on GitHub but no success :
https://jakevdp.github.io/blog/2013/05/19/a-javascript-viewer-for-matplotlib-animations/# -*- coding: utf-8 -*-
import numpy as np
def solver(I, V, f, c, L, dt, cc, T, user_action=None):
"""Solve u_tt=c^2*u_xx + f on (0,L)x(0,T]."""
Nt = int(round(T/dt))
t = np.linspace(0, Nt*dt, Nt+1) # Mesh points in time
dx = dt*c/float(cc)
Nx = int(round(L/dx))
x = np.linspace(0, L, Nx+1) # Mesh points in space
C2 = cc**2 # Help variable in the scheme
# Make sure dx and dt are compatible with x and t
dx = x[1] - x[0]
dt = t[1] - t[0]
if f is None or f == 0 :
f = lambda x, t: 0
if V is None or V == 0:
V = lambda x: 0
u = np.zeros(Nx+1) # Solution array at new time level
u_n = np.zeros(Nx+1) # Solution at 1 time level back
u_nm1 = np.zeros(Nx+1) # Solution at 2 time levels back
import time; t0 = time.clock() # Measure CPU time
# Load initial condition into u_n
for i in range(0,Nx+1):
u_n[i] = I(x[i])
if user_action is not None:
user_action(u_n, x, t, 0)
# Special formula for first time step
n = 0
for i in range(1, Nx):
u[i] = u_n[i] + dt*V(x[i]) + \
0.5*C2*(u_n[i-1] - 2*u_n[i] + u_n[i+1]) + \
0.5*dt**2*f(x[i], t[n])
u[0] = 0; u[Nx] = 0
if user_action is not None:
user_action(u, x, t, 1)
# Switch variables before next step
u_nm1[:] = u_n; u_n[:] = u
for n in range(1, Nt):
# Update all inner points at time t[n+1]
for i in range(1, Nx):
u[i] = - u_nm1[i] + 2*u_n[i] + \
C2*(u_n[i-1] - 2*u_n[i] + u_n[i+1]) + \
dt**2*f(x[i], t[n])
# Insert boundary conditions
u[0] = 0; u[Nx] = 0
if user_action is not None:
if user_action(u, x, t, n+1):
break
# Switch variables before next step
u_nm1[:] = u_n; u_n[:] = u
cpu_time = time.clock() - t0
return u, x, t,
def test_quadratic():
"""Check that u(x,t)=x(L-x)(1+t/2) is exactly reproduced."""
def u_exact(x, t):
return x*(L-x)*(1 + 0.5*t)
def I(x):
return u_exact(x, 0)
def V(x):
return 0.5*u_exact(x, 0)
def f(x, t):
return 2*(1 + 0.5*t)*c**2
L = 2.5
c = 1.5
cc = 0.75
Nx = 6 # Very coarse mesh for this exact test
dt = cc*(L/Nx)/c
T = 18
def assert_no_error(u, x, t, n):
u_e = u_exact(x, t[n])
diff = np.abs(u - u_e).max()
tol = 1E-13
assert diff < tol
solver(I, V, f, c, L, dt, cc, T,
user_action=assert_no_error)
def viz(
I, V, f, c, L, dt, C, T,umin, umax, animate=True, tool='matplotlib'):
"""Run solver and visualize u at each time level."""
def plot_u_st(u, x, t, n):
"""user_action function for solver."""
plt.plot(x, u, 'r-')
# xlabel='x', ylabel='u',
# axis=[0, L, umin, umax],
# title='t=%f' % t[n], show=True)
# Let the initial condition stay on the screen for 2
# seconds, else insert a pause of 0.2 s between each plot
time.sleep(2) if t[n] == 0 else time.sleep(0.2)
plt.savefig('frame_%04d.png' % n) # for movie making
class PlotMatplotlib:
def __call__(self, u, x, t, n):
"""user_action function for solver."""
if n == 0:
plt.ion()
self.lines = plt.plot(x, u, 'r-')
plt.xlabel('x'); plt.ylabel('u')
plt.axis([0, L, umin, umax])
plt.legend(['t=%f' % t[n]], loc='lower left')
else:
self.lines[0].set_ydata(u)
plt.legend(['t=%f' % t[n]], loc='lower left')
plt.draw()
time.sleep(2) if t[n] == 0 else time.sleep(0.2)
plt.savefig('tmp_%04d.png' % n) # for movie making
if tool == 'matplotlib':
import matplotlib.pyplot as plt
plot_u = PlotMatplotlib()
elif tool == 'scitools':
import scitools.std as plt # scitools.easyviz interface
plot_u = plot_u_st
import time, glob, os
# Clean up old movie frames
for filename in glob.glob('tmp_*.png'):
os.remove(filename)
# Call solver and do the simulaton
user_action = plot_u if animate else None
u, x, t, cpu = solver_function(
I, V, f, c, L, dt, C, T, user_action)
# Make video files
fps = 4 # frames per second
codec2ext = dict(flv='flv', libx264='mp4', libvpx='webm',
libtheora='ogg') # video formats
filespec = 'tmp_%04d.png'
movie_program = 'ffmpeg' # or 'avconv'
for codec in codec2ext:
ext = codec2ext[codec]
cmd = '%(movie_program)s -r %(fps)d -i %(filespec)s '\
'-vcodec %(codec)s movie.%(ext)s' % vars()
os.system(cmd)
if tool == 'scitools':
# Make an HTML play for showing the animation in a browser
plt.movie('tmp_*.png', encoder='html', fps=fps,
output_file='movie.html')
return cpu -
Libavcodec "the procedure entry point for av_frame_alloc could not be located" error in Visual Studio 2017 C++ project
25 novembre 2019, par AvesI am trying to use libavcodec from ffmpeg library in C++ with Visual Studio 2017 Community. I downloaded the latest x64 dev and shared builds from zeranoe (version 20171217), set up include directories and additional libraries in Visual Studio for x64 build, added DLL files from shared package to my PATH.
This is my sample test code :
extern "C" {
#include
}
int main() {
avcodec_register_all();
AVFrame *pAvFrame = av_frame_alloc();
av_frame_free(&pAvFrame);
return 0;
}The code compiles without problems but when I run the application I see a dialogue window with error message "the procedure entry point for av_frame_alloc could not be located in DLL" (actual message is not in English, this is the translated version).
I tried to set Linker->Optimization->References to /OPT:NOREF as it was advised in the similar questions but it did not help.
Dependency walker shows that av_frame_alloc is exported, "Entry Point" is not bound. A little bit strange is that av_frame_alloc is displayed in both avcodec-58.dll (as red) and avutil-56.dll (as green). Maybe the reason is that the application is trying to get this function from avcodec instead of avutil, but I’m not sure, since I did not check the source code of these libraries.
So the question is how to set up such a simple FFMPEG-based C++ project in VS2017, where I’m wrong ?
UPD. 1.
Linker flags : /OUT :"C :\work\code\TestFfmpeg\x64\Release\TestFfmpeg.exe" /MANIFEST /NXCOMPAT /PDB :"C :\work\code\TestFfmpeg\x64\Release\TestFfmpeg.pdb" /DYNAMICBASE "c :\work\dev\ffmpeg-20171217-387ee1d-win64-dev\lib*.lib" "kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "odbc32.lib" "odbccp32.lib" /DEBUG:FULL /MACHINE:X64 /OPT:NOREF /PGD :"C :\work\code\TestFfmpeg\x64\Release\TestFfmpeg.pgd" /MANIFESTUAC :"level=’asInvoker’ uiAccess=’false’" /ManifestFile :"x64\Release\TestFfmpeg.exe.intermediate.manifest" /OPT:ICF /ERRORREPORT:PROMPT /NOLOGO /TLBID:1
-
ffmpeg generate encoded sequence of videos from playlist
20 janvier 2018, par Massimo Vantaggioi use ffmpeg to encode my videos to be ready for mpeg dash process :
ffmpeg -y -i legend.mp4 -c:a copy -c:v libx264 -x264opts 'keyint=48:min-keyint=48:no-scenecut' -r 24 -b:v 1500k -maxrate 1500k -bufsize 1000k -vf "scale=-1:816" out.mp4
This command line work fine, and i wonder to know how to create a mp4 encoded file like above from a sequence of videos ?
I try to get a faster process, and i think that i don’t need to encode separately all videos and after create a sequence (a big video) with post production software.. I wish to resolve all by a sigle command line,
Is there a way to give a playlist for input to get only one output video within the sequence of the playlist all with the same encoding assuming that all videos have same frame rate and same resolution ?
Thanks,
Dan