Recherche avancée

Médias (1)

Mot : - Tags -/book

Autres articles (79)

  • Organiser par catégorie

    17 mai 2013, par

    Dans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
    Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
    Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...)

  • Récupération d’informations sur le site maître à l’installation d’une instance

    26 novembre 2010, par

    Utilité
    Sur le site principal, une instance de mutualisation est définie par plusieurs choses : Les données dans la table spip_mutus ; Son logo ; Son auteur principal (id_admin dans la table spip_mutus correspondant à un id_auteur de la table spip_auteurs)qui sera le seul à pouvoir créer définitivement l’instance de mutualisation ;
    Il peut donc être tout à fait judicieux de vouloir récupérer certaines de ces informations afin de compléter l’installation d’une instance pour, par exemple : récupérer le (...)

  • Demande de création d’un canal

    12 mars 2010, par

    En fonction de la configuration de la plateforme, l’utilisateur peu avoir à sa disposition deux méthodes différentes de demande de création de canal. La première est au moment de son inscription, la seconde, après son inscription en remplissant un formulaire de demande.
    Les deux manières demandent les mêmes choses fonctionnent à peu près de la même manière, le futur utilisateur doit remplir une série de champ de formulaire permettant tout d’abord aux administrateurs d’avoir des informations quant à (...)

Sur d’autres sites (4304)

  • Can't save matplotlib animation (ffmpeg)

    25 mai 2014, par renger

    I am trying to get a simple animation saved using ffmpeg. I followed a tutorial to install ffmpeg, and I can now access it from the command prompt.

    Now I run this piece of code :

    import numpy as np
    from matplotlib import pyplot as plt
    from matplotlib import animation

    fig = plt.figure()
    ax = plt.axes(xlim=(0, 2), ylim=(-2, 2))
    line, = ax.plot([], [], lw=2)

    def init():
       line.set_data([], [])
       return line,

    def animate(i):
       x = np.linspace(0, 2, 1000)
       y = np.sin(2 * np.pi * (x - 0.01 * i))
       line.set_data(x, y)
       return line,

    anim = animation.FuncAnimation(fig, animate, init_func=init,
                                  frames=200, interval=20, blit=True)

    mywriter = animation.FFMpegWriter()
    anim.save('mymovie.mp4',writer=mywriter)

    plt.show()

    I get this error :

    Traceback (most recent call last):
     File "<stdin>", line 1, in <module>
      File "C:\Python27\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 523, in runfile
       execfile(filename, namespace)
     File "C:\Users\Renger\.xy\startups\b.py", line 23, in <module>
       anim.save('mymovie.mp4',writer=mywriter)
     File "C:\Python27\lib\site-packages\matplotlib\animation.py", line 609, in save
       with writer.saving(self._fig, filename, dpi):
     File "C:\Python27\lib\contextlib.py", line 17, in __enter__
       return self.gen.next()
     File "C:\Python27\lib\site-packages\matplotlib\animation.py", line 166, in saving
       self.setup(*args)
     File "C:\Python27\lib\site-packages\matplotlib\animation.py", line 156, in setup
       self._run()
     File "C:\Python27\lib\site-packages\matplotlib\animation.py", line 183, in _run
       stdin=subprocess.PIPE)
     File "C:\Python27\lib\subprocess.py", line 711, in __init__
       errread, errwrite)
     File "C:\Python27\lib\subprocess.py", line 948, in _execute_child
       startupinfo)
    WindowsError: [Error 2] Het systeem kan het opgegeven bestand niet vinden
    </module></module></stdin>

    The last dutch sentence does mean something like : The system can’t find the specified file.

    What do these errors mean, and how can I solve them ?

    Best,

  • Can't save matplotlib animation

    19 novembre 2014, par renger

    I am trying to get a simple animation saved using ffmpeg. I followed a tutorial to install ffmpeg, and I can now access it from the command prompt.

    Now I run this piece of code :

    import numpy as np
    from matplotlib import pyplot as plt
    from matplotlib import animation

    fig = plt.figure()
    ax = plt.axes(xlim=(0, 2), ylim=(-2, 2))
    line, = ax.plot([], [], lw=2)

    def init():
       line.set_data([], [])
       return line,

    def animate(i):
       x = np.linspace(0, 2, 1000)
       y = np.sin(2 * np.pi * (x - 0.01 * i))
       line.set_data(x, y)
       return line,

    anim = animation.FuncAnimation(fig, animate, init_func=init,
                                  frames=200, interval=20, blit=True)

    mywriter = animation.FFMpegWriter()
    anim.save('mymovie.mp4',writer=mywriter)

    plt.show()

    I get this error :

    Traceback (most recent call last):
     File "<stdin>", line 1, in <module>
      File "C:\Python27\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 523, in runfile
       execfile(filename, namespace)
     File "C:\Users\Renger\.xy\startups\b.py", line 23, in <module>
       anim.save('mymovie.mp4',writer=mywriter)
     File "C:\Python27\lib\site-packages\matplotlib\animation.py", line 609, in save
       with writer.saving(self._fig, filename, dpi):
     File "C:\Python27\lib\contextlib.py", line 17, in __enter__
       return self.gen.next()
     File "C:\Python27\lib\site-packages\matplotlib\animation.py", line 166, in saving
       self.setup(*args)
     File "C:\Python27\lib\site-packages\matplotlib\animation.py", line 156, in setup
       self._run()
     File "C:\Python27\lib\site-packages\matplotlib\animation.py", line 183, in _run
       stdin=subprocess.PIPE)
     File "C:\Python27\lib\subprocess.py", line 711, in __init__
       errread, errwrite)
     File "C:\Python27\lib\subprocess.py", line 948, in _execute_child
       startupinfo)
    WindowsError: [Error 2] Het systeem kan het opgegeven bestand niet vinden
    </module></module></stdin>

    The last dutch sentence does mean something like : The system can’t find the specified file.

    What do these errors mean, and how can I solve them ?

  • Change ffmeg output to mp4 format

    10 juin 2014, par user1580508

    Hello I would like to change the following below so that the output would be mp4 or a format that will also work on mobile devices. What do I need to change ?

           $sFfmpegPath = "/usr/local/bin/ffmpeg";

           $image  = $uploaded_path.$timeStamp.".jpg";
           if($imgSize!=''){
               $mainimage  = $uploaded_path.$timeStamp."_".$imgSize.".jpg";
           }
           $thumbnail=$timeStamp.".jpg";
           //$videoSize = '640x480';
           if($fileExt[count($fileExt)-1]!='flv'){
               //$command = $sFfmpegPath." -i ".$sFilesPath." -ar 22050 -ab 32 -f flv -s ". $VideoSize ." ".$destFile;
               $command = $sFfmpegPath." -i ".$sFilesPath." -s 640x480 -ar 44100 -async 44100 -r 59.970 -ac 2 -qscale 5 ".$destFile;
               exec($command);
           }else{
               copy($sFilesPath, $destFile);
           }
           $iSecond = 1000;
           $sInput = " -y -i ";
           //$ThumbSize = '200x150';
           //$sCommand = $sFfmpegPath.$sInput.$sFilesPath . " -ss " . $iSecond . " -vframes 1 -an -sameq -f image2 -s " . $ThumbSize . " " . $image;
           //$sCommand = $sFfmpegPath.$sInput.$sFilesPath . "  -y -f image2 -ss 4 -t 0.001 " . $image;
           //$sCommand = $sFfmpegPath.$sInput.$sFilesPath . "  -y -f image2 -ss 8 -sameq -t 0.001 -s 320*240 " . $image;

           //$sCommand =  $sFfmpegPath.$sInput.$sFilesPath." -vf thumbnail,scale=300:200 -frames:v 1". $image;
           $sCommand = $sFfmpegPath." -itsoffset -4  -i ".$sFilesPath." -vcodec mjpeg -vframes 1 -an -f rawvideo -s 640x480 ".$image;
           //-y -f image2 -ss 8 -sameq -t 0.001 -s 320*240
           $convert = exec($sCommand);
           if($imgSize!=''){
               //$sCommand1 = $sFfmpegPath.$sInput.$sFilesPath . " -ss " . $iSecond . " -vframes 1 -an -sameq -f image2 -s " . $imgSize . " " . $mainimage;

               //$sCommand1 = $sFfmpegPath.$sInput.$sFilesPath . "  -y -f image2 -ss 8 -sameq -t 0.001 -s 320*240 " . $image;

               //$sCommand1 = $sFfmpegPath.$sInput.$sFilesPath . "  -y -f image2 -ss 4 -t 0.001 " . $image;
               //$convert1 = exec($sCommand1);
           }
           //unlink($file_dest);

           return $timeStamp;