Recherche avancée

Médias (1)

Mot : - Tags -/copyleft

Autres articles (110)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • Mise à jour de la version 0.1 vers 0.2

    24 juin 2013, par

    Explications 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 (...)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

Sur d’autres sites (13242)

  • Matplotlib animation error : Requested MovieWriter (ffmpeg) not available, while ffmpeg is installed

    3 juillet 2020, par Vivien Bonnot

    I'm trying to animate colormapping representations of parametric complex fonctions using Python.
I gradually put some things together, and checked that they worked properly. But I can't get the animation to be saved.

    


    I encountered this error :

    


    Requested MovieWriter (ffmpeg) not available

    


    However, ffmpeg is indeed installed on my system,
on Windows console ffmpeg -version returns all sorts of informations about ffmpeg. Additionnaly, I also installed ffmpeg in Python scripts directory using pip pip install ffmpeg, which was successfull. I also set up ffmepg path in my code : plt.rcParams['animation.ffmpeg_path'] = "C:\FFmpeg\bin\ffmpeg.exe"

    


    I'm runing out of ideas.

    


    Here is my code.
Thank you for reading.

    


    import numpy as np
import math
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.animation as animation
pi=math.pi
plt.rcParams['animation.ffmpeg_path'] = "C:\FFmpeg\bin\ffmpeg.exe"
fig = plt.figure()

def complex_array_to_rgb(X, theme='dark', rmax=None):
  absmax = rmax or np.abs(X).max()
  Y = np.zeros(X.shape + (3,), dtype='float')
  Y[..., 0] = np.angle(X) / (2 * pi) % 1
  if theme == 'light':
    Y[..., 1] = np.clip(np.abs(X) / absmax, 0, 1)
    Y[..., 2] = 1
  elif theme == 'dark':
    Y[..., 1] = 1
    Y[..., 2] = np.clip(np.abs(X) / absmax, 0, 1)
  Y = matplotlib.colors.hsv_to_rgb(Y)
  return Y

# Set up formatting for the movie files
Writer = animation.writers['ffmpeg']
writer = Writer(fps=15, metadata=dict(artist='Me'), bitrate=1800)

fps = 10
nSeconds = 1
snapshots = [ complex_array_to_rgb(np.array([[3*(x + 1j*y)**(2.9+p/300) + 1/(x + 1j*y)**2 for x in np.arange(-1,1,0.05)] for y in np.arange(-1,1,0.05)])) for p in range( nSeconds * fps ) ]

fig = plt.figure( figsize=(3,3) )

Z2=snapshots[0]
im=plt.imshow(Z2, extent=(-1,1,-1,1))

def animate_func(i):
    if i % fps == 0:
        print( '.')

    im.set_array(snapshots[i])
    return [im]
    
anim = animation.FuncAnimation(
                               fig, 
                               animate_func, 
                               frames = nSeconds * fps,
                               interval = 1000 / fps, # in ms
                               )

anim.save('test_anim.mp4', writer=writer)


    


  • Anomalie #4682 : Mettre à jour la lib svg-sanitizer (en 0.14) pour les corrections concernant php 8

    10 mars 2021

    Il faut qu’on ajoute une fonction ou classe d’autoloading en attendant Composer...

  • Repeating video frame sequences without iterating each frame

    4 juillet 2015, par Raheel Khan

    I have an application that generates a video from a given number of files. A total frame count and sequence is provided and the generated video should loop the given sequence until the total number of frames have been written.

    At the moment, I’m using FFMPEG.VideoFileWriter from AForge.

    var frameIndex = 0;
    var frameCount = 300;

    var writer = new AForge.Video.FFMPEG.VideoFileWriter();
    writer.Open(filename: "Video.mp4", width: 10000, height: 10000, fps: 30, code: VideoCodec.MPEG4, bitrate: 1024 * 1024 * 2);

    using (var imageCanvas = new Bitmap(width, height))
    {
       do
       {
           foreach (var file in this._Files)
           {
               frameIndex++;
               if (frameIndex > frameCount) { break; }

               using (var graphicsCanvas = Graphics.FromImage(imageCanvas))
               {
                   graphicsCanvas.Clear(Color.Black);

                   using (var imageFile = Image.FromFile(file.FullName))
                   {
                       graphicsCanvas.DrawImage(imageFile, 0, 0, imageCanvas.Width, imageCanvas.Height);
                   }
               }

               writer.WriteVideoFrame(imageCanvas);
           }
       }
       while (true);
    }

    the bottlenecks are :

    • The call to writer.WriteVideoFrame(imageCanvas).
    • The source images in question are massive (more than 10Kx10K 32bpp) so keeping them all in memory is not an option.

    The only thing I can think of is to create an uncompressed AVI file and somehow copy entire sequences in bulk. although transcoding back to MP4 would still take a while, it may same some overall.

    Any general optimization suggestions or clues on how to write multiple frames at once would be appreciated.