
Recherche avancée
Médias (1)
-
La conservation du net art au musée. Les stratégies à l’œuvre
26 mai 2011
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (79)
-
Amélioration de la version de base
13 septembre 2013Jolie sélection multiple
Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...) -
Mise à jour de la version 0.1 vers 0.2
24 juin 2013, parExplications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...) -
MediaSPIP v0.2
21 juin 2013, parMediaSPIP 0.2 est la première version de MediaSPIP stable.
Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)
Sur d’autres sites (15051)
-
FFMPEG saving frame from video works in localhost but not working in live server
5 janvier 2018, par MukeshI’m using FFMPEG to take a frame from a video. My code is working all fine in localhost but, fails to execute in server.
Code I’m executing :
$ffmpeg = \FFMpeg\FFMpeg::create();
$video = $ffmpeg->open($File_temp_name);
$video
->frame(\FFMpeg\Coordinate\TimeCode::fromSeconds(1))
->save($saveLocation);This code is executing fine in localhost but, when I execute the same in server it is showing an error
Exception 'FFMpeg\Exception\RuntimeException' with message 'Unable to save framesexception 'Alchemy\BinaryDriver\Exception\ExecutionFailureException' with message 'ffmpeg failed to execute command'
Command Getting executed is :
'/usr/bin/ffmpeg' '-y' '-ss' '00:00:01.00' '-i' '/tmp/php02MmoD' '-vframes' '1' '-f' 'image2' '/home/project/public_html/dev/frontend/web/uploads/temp-video-frames/1499319488-act-thumbnail.jpg'
I’ve tried to execute the command in terminal and found it executing without any error and save frame in desired location. But, when I run it through my code it is throwing above error
-
Making animations by matplotlib and saving the video files
20 janvier 2016, par Richard.LI have been studying the 1D wave equations and making the animation of the equation. But there are some problems when using the
anim.save
ofanimation
to save the video file. I have already installedffmpeg
on my computer (a Windows machine) and set the environment variables. But it keeps telling me this :UserWarning: MovieWriter ffmpeg unavailable
...
RuntimeError: Error creating movie, return code: 4 Try running with --verbose-debugHere is my code :
from numpy import zeros,linspace,sin,pi
import matplotlib.pyplot as mpl
from matplotlib import animation
mpl.rcParams['animation.ffmpeg_path'] = 'C:\\ffmpeg\\bin\\ffmpeg.exe'
def I(x):
return sin(2*x*pi/L)
def f(x,t):
return sin(0.5*x*t)
def solver0(I,f,c,L,n,dt,t):
# f is a function of x and t, I is a function of x
x = linspace(0,L,n+1)
dx = L/float(n)
if dt <= 0:
dt = dx/float(c)
C2 = (c*dt/dx)**2
dt2 = dt*dt
up = zeros(n+1)
u = up.copy()
um = up.copy()
for i in range(0,n):
u[i] = I(x[i])
for i in range(1,n-1):
um[i] = u[i]+0.5*C2*(u[i-1] - 2*u[i] + u[i+1]) + dt2*f(x[i],t)
um[0] = 0
um[n] = 0
while t <= tstop:
t_old = t
t += dt
#update all inner points:
for i in range(1,n-1):
up[i] = -um[i] + 2*u[i] + C2*(u[i-1] - 2*u[i] + u[i+1]) + dt2*f(x[i],t_old)
#insert boundary conditions:
up[0] = 0
up[n] = 0
#update data structures for next step
um = u.copy()
u = up.copy()
return u
c = 1.0
L = 10
n = 100
dt = 0
tstop = 40
fig = mpl.figure()
ax = mpl.axes(xlim=(0,10),ylim=(-1.0,1.0))
line, = ax.plot([],[],lw=2)
def init():
line.set_data([],[])
return line,
def animate(t):
x = linspace(0,L,n+1)
y = solver0(I, f, c, L, n, dt, t)
line.set_data(x,y)
return line,
anim = animation.FuncAnimation(fig, animate, init_func=init,
frames=200, interval=20, blit=True)
anim.save('seawave_1d_ani.mp4',writer='ffmpeg',fps=30)
mpl.show()I believe the problem is in the part of the animation instead of the three functions above. Please help me find what mistake I have made.
-
Saving frames for mov file with multiple streams using python-ffmpeg
3 novembre 2024, par Dolev ShapiraI have a mov file with multiple video streams, and I'm trying to use ffmpeg python bindings to read each stream and save all of its frames.


To do so, I've made a code similar to this one :


import numpy as np
from PIL import Image
import ffmpeg

# Explore streams using probe
probe = ffmpeg.probe(file)
video_streams = [stream for stream in probe['streams'] if stream['codec_type'] == 'video']

for stream in video_streams:
 out, _ = (
 ffmpeg
 .input(file,stream_index=int(stream["index"]))
 .output('pipe:', format='rawvideo', pix_fmt='rgb24')
 .run(capture_stdout=True)
 )
 video = (
 np
 .frombuffer(out, np.uint8)
 .reshape([-1, height, width, 3])
 )
 stream_dir = video_streams_dir / int(stream["index"])
 stream_dir.mkdir(exist_ok=True)
 for i in range(video.shape[0]):
 Image.fromarray(video[i,...]).save(stream_dir / f"{video_name}__{i:04d}.jpeg")



However
stream_index=int(stream["index"])
appears to be an invalid parameter, so my question is, how do I specify the input stream for the input node ?

Note : It works without that parameter with the first (I believe) video stream.


Update : Found this thread and it appears that ffmpeg does allow it, still haven't tried implementing my own solution based on it.