Recherche avancée

Médias (0)

Mot : - Tags -/masques

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (76)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Amélioration de la version de base

    13 septembre 2013

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

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
    This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)

Sur d’autres sites (14865)

  • Getting "TypeError : must be real number, not NoneType" whenever trying to run write_videofile to a clip in moviepy

    9 novembre 2024, par Sato

    Example code :

    


    from moviepy.editor import *
clip = VideoFileClip('video.mp4')
clip.write_videofile('video2.mp4', fps=30)


    


    After showing the following messages, showing that the video is being built and written,

    


    Moviepy - Building video video2.mp4.
Moviepy - Writing video video2.mp4


    


    The following error message occurs :

    


    Traceback (most recent call last):&#xA;  File "<stdin>", line 1, in <module>&#xA;  File "C:\Users\User\Anaconda3\lib\site-packages\decorator.py", line 232, in fun&#xA;    return caller(func, *(extras &#x2B; args), **kw)&#xA;  File "C:\Users\User\Anaconda3\lib\site-packages\moviepy\decorators.py", line 54, in requires_duration&#xA;    return f(clip, *a, **k)&#xA;  File "C:\Users\User\Anaconda3\lib\site-packages\decorator.py", line 232, in fun&#xA;    return caller(func, *(extras &#x2B; args), **kw)&#xA;  File "C:\Users\User\Anaconda3\lib\site-packages\moviepy\decorators.py", line 135, in use_clip_fps_by_default&#xA;    return f(clip, *new_a, **new_kw)&#xA;  File "C:\Users\User\Anaconda3\lib\site-packages\decorator.py", line 232, in fun&#xA;    return caller(func, *(extras &#x2B; args), **kw)&#xA;  File "C:\Users\User\Anaconda3\lib\site-packages\moviepy\decorators.py", line 22, in convert_masks_to_RGB&#xA;    return f(clip, *a, **k)&#xA;  File "C:\Users\User\Anaconda3\lib\site-packages\moviepy\video\VideoClip.py", line 300, in write_videofile&#xA;    ffmpeg_write_video(self, filename, fps, codec,&#xA;  File "C:\Users\User\Anaconda3\lib\site-packages\moviepy\video\io\ffmpeg_writer.py", line 213, in ffmpeg_write_video&#xA;    with FFMPEG_VideoWriter(filename, clip.size, fps, codec = codec,&#xA;  File "C:\Users\User\Anaconda3\lib\site-packages\moviepy\video\io\ffmpeg_writer.py", line 88, in __init__&#xA;    &#x27;-r&#x27;, &#x27;%.02f&#x27; % fps,&#xA;TypeError: must be real number, not NoneType&#xA;</module></stdin>

    &#xA;

    This occurs whenever I try to perform write_videofile to any kinds of clip in moviepy. It is strange since the exact same code worked for me yesterday, but suddenly not anymore today. Are there any suggestions what the cause is and how to resolve this ?

    &#xA;

  • How to successfully parse the output of FFMpeg in NodeJS

    22 mai 2017, par Danny SMc

    So I have seen a lot of topics on FFMPeg and it’s a great tool I learnt about today, but I have spent the day perfecting the command and now am a little stuck with the NodeJS part.

    In essence the command does the following : take input from a Mac OSX webcam, and then stream it to a web-socket. Now I looked at a lot of the NodeJS libraries but I couldn’t find one that did what I need ; or did not understand how to. Here is an example of the command that I am using :

    ffmpeg -f avfoundation -framerate 30 -video_size 640x480 -pix_fmt uyvy422 -i "0:1" -f mpegts -codec:v mpeg1video -s 640x480 -b:v 1000k -bf 0 http://localhost:8081/stream

    This does everything I need for the streaming side of things, but I wish to call it via NodeJS, and then be able to monitor the log, and parse the data that comes back for example :

    frame= 4852 fps= 30 q=6.8 size=   30506kB time=00:02:41.74 bitrate=1545.1kbits/s speed=   1x    \r

    and use it to get a JSON array back for me to output to a webpage.

    Now all I am doing is working on ways of actually parsing the data, and I have looked at lots of other answers for things like this, but I can’t seem to split/replace/regex it. I can’t get anything but a long string from it.

    Here is the code I am using (NodeJS) :

    var ffmpeg = require('child_process').spawn('/usr/local/Cellar/ffmpeg/3.3.1/bin/ffmpeg', ['-f', 'avfoundation', '-framerate', '30', '-video_size', '640x480', '-pix_fmt', 'uyvy422', '-i', '0:1', '-f', 'mpegts', '-codec:v', 'mpeg1video', '-s', '640x480', '-b:v', '1000k', '-bf', '0', 'http://localhost:8081/test']);

    ffmpeg.on('error', function (err) {
       console.log(err);
    });

    ffmpeg.on('close', function (code) {
       console.log('ffmpeg exited with code ' + code);
    });

    ffmpeg.stderr.on('data', function (data) {
       // console.log('stderr: ' + data);
       var tData = data.toString('utf8');
       // var a = tData.split('[\\s\\xA0]+');
       var a = tData.split('\n');
       console.log(a);
    });

    ffmpeg.stdout.on('data', function (data) {
       var frame = new Buffer(data).toString('base64');
       // console.log(frame);
    });

    I have tried splitting with new lines, carridge return, spaces, tabs, but I just can’t seem to get a basic array of bits, that I can work with.

    Another thing to note, is you will notice the log comes back via stderr, I have seen this online and apparently it does it for a lot of people ? So I am not sure what the deal is with that ? but the code is is the sdterr callback.

    Any help is very appreciated as I am truly confused on what I am doing wrong.

    Thanks.

  • How to successfully parse the output of FFMpeg in NodeJS

    28 juillet 2022, par Dahknee

    So I have seen a lot of topics on FFMPeg and it's a great tool I learnt about today, but I have spent the day perfecting the command and now am a little stuck with the NodeJS part.

    &#xA;&#xA;

    In essence the command does the following : take input from a Mac OSX webcam, and then stream it to a web-socket. Now I looked at a lot of the NodeJS libraries but I couldn't find one that did what I need ; or did not understand how to. Here is an example of the command that I am using :

    &#xA;&#xA;

    ffmpeg -f avfoundation -framerate 30 -video_size 640x480 -pix_fmt uyvy422 -i "0:1" -f mpegts -codec:v mpeg1video -s 640x480 -b:v 1000k -bf 0 http://localhost:8081/stream&#xA;

    &#xA;&#xA;

    This does everything I need for the streaming side of things, but I wish to call it via NodeJS, and then be able to monitor the log, and parse the data that comes back for example :

    &#xA;&#xA;

    frame= 4852 fps= 30 q=6.8 size=   30506kB time=00:02:41.74 bitrate=1545.1kbits/s speed=   1x    \r&#xA;

    &#xA;&#xA;

    and use it to get a JSON array back for me to output to a webpage.

    &#xA;&#xA;

    Now all I am doing is working on ways of actually parsing the data, and I have looked at lots of other answers for things like this, but I can't seem to split/replace/regex it. I can't get anything but a long string from it.

    &#xA;&#xA;

    Here is the code I am using (NodeJS) :

    &#xA;&#xA;

    var ffmpeg = require(&#x27;child_process&#x27;).spawn(&#x27;/usr/local/Cellar/ffmpeg/3.3.1/bin/ffmpeg&#x27;, [&#x27;-f&#x27;, &#x27;avfoundation&#x27;, &#x27;-framerate&#x27;, &#x27;30&#x27;, &#x27;-video_size&#x27;, &#x27;640x480&#x27;, &#x27;-pix_fmt&#x27;, &#x27;uyvy422&#x27;, &#x27;-i&#x27;, &#x27;0:1&#x27;, &#x27;-f&#x27;, &#x27;mpegts&#x27;, &#x27;-codec:v&#x27;, &#x27;mpeg1video&#x27;, &#x27;-s&#x27;, &#x27;640x480&#x27;, &#x27;-b:v&#x27;, &#x27;1000k&#x27;, &#x27;-bf&#x27;, &#x27;0&#x27;, &#x27;http://localhost:8081/test&#x27;]);&#xA;&#xA;ffmpeg.on(&#x27;error&#x27;, function (err) {&#xA;    console.log(err);&#xA;});&#xA;&#xA;ffmpeg.on(&#x27;close&#x27;, function (code) {&#xA;    console.log(&#x27;ffmpeg exited with code &#x27; &#x2B; code);&#xA;});&#xA;&#xA;ffmpeg.stderr.on(&#x27;data&#x27;, function (data) {&#xA;    // console.log(&#x27;stderr: &#x27; &#x2B; data);&#xA;    var tData = data.toString(&#x27;utf8&#x27;);&#xA;    // var a = tData.split(&#x27;[\\s\\xA0]&#x2B;&#x27;);&#xA;    var a = tData.split(&#x27;\n&#x27;);&#xA;    console.log(a);&#xA;});&#xA;&#xA;ffmpeg.stdout.on(&#x27;data&#x27;, function (data) {&#xA;    var frame = new Buffer(data).toString(&#x27;base64&#x27;);&#xA;    // console.log(frame);&#xA;});&#xA;

    &#xA;&#xA;

    I have tried splitting with new lines, carridge return, spaces, tabs, but I just can't seem to get a basic array of bits, that I can work with.

    &#xA;&#xA;

    Another thing to note, is you will notice the log comes back via stderr, I have seen this online and apparently it does it for a lot of people ? So I am not sure what the deal is with that ? but the code is is the sdterr callback.

    &#xA;&#xA;

    Any help is very appreciated as I am truly confused on what I am doing wrong.

    &#xA;&#xA;

    Thanks.

    &#xA;