Recherche avancée

Médias (1)

Mot : - Tags -/censure

Autres articles (97)

  • Les tâches Cron régulières de la ferme

    1er décembre 2010, par

    La gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
    Le super Cron (gestion_mutu_super_cron)
    Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 is the first MediaSPIP stable release.
    Its official release date is June 21, 2013 and is announced here.
    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 (...)

  • ANNEXE : Les plugins utilisés spécifiquement pour la ferme

    5 mars 2010, par

    Le site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)

Sur d’autres sites (14711)

  • Getting "OSError : [Errno 32] Broken pipe" while saving a numpy array using imageio.mimwrite into io.BytesIO() object

    10 novembre 2020, par green_hunter434

    I am trying to save a numpy array (array of frames) as a video using imageio.mimwrite .

    


    Operation like this works fine -

    


    imageio.mimwrite('./temp4.mp4', frames, fps=fps, format='.mp4')


    


    But, when I try something like this -

    


    fo = io.BytesIO()
imageio.mimwrite(fo, frames, fps=fps, format='.mp4')


    


    OR

    


    writer = imageio.get_writer(fo, fps=fps, format='.mp4')

for im in frames:
    writer.append_data(imageio.imread(im))
writer.close()


    


    I get the following error -

    


    ---------------------------------------------------------------------------&#xA;BrokenPipeError                           Traceback (most recent call last)&#xA;c:\program files (x86)\python38-32\lib\site-packages\imageio_ffmpeg\_io.py in write_frames(path, size, pix_fmt_in, pix_fmt_out, fps, quality, bitrate, codec, macro_block_size, ffmpeg_log_level, ffmpeg_timeout, input_params, output_params)&#xA;    478             try:&#xA;--> 479                 p.stdin.write(bb)&#xA;    480             except Exception as err:&#xA;&#xA;BrokenPipeError: [Errno 32] Broken pipe&#xA;&#xA;During handling of the above exception, another exception occurred:&#xA;&#xA;OSError                                   Traceback (most recent call last)&#xA; in <module>&#xA;      1 for im in ret3:&#xA;----> 2     writer.append_data(im)&#xA;      3 writer.close()&#xA;&#xA;c:\program files (x86)\python38-32\lib\site-packages\imageio\core\format.py in append_data(self, im, meta)&#xA;    500             im = asarray(im)&#xA;    501             # Call&#xA;--> 502             return self._append_data(im, total_meta)&#xA;    503 &#xA;    504         def set_meta_data(self, meta):&#xA;&#xA;c:\program files (x86)\python38-32\lib\site-packages\imageio\plugins\ffmpeg.py in _append_data(self, im, meta)&#xA;    572 &#xA;    573             # Write. Yes, we can send the data in as a numpy array&#xA;--> 574             self._write_gen.send(im)&#xA;    575 &#xA;    576         def set_meta_data(self, meta):&#xA;&#xA;c:\program files (x86)\python38-32\lib\site-packages\imageio_ffmpeg\_io.py in write_frames(path, size, pix_fmt_in, pix_fmt_out, fps, quality, bitrate, codec, macro_block_size, ffmpeg_log_level, ffmpeg_timeout, input_params, output_params)&#xA;    484                     "OUTPUT:\n".format(err, cmd_str)&#xA;    485                 )&#xA;--> 486                 raise IOError(msg)&#xA;    487 &#xA;    488             nframes &#x2B;= 1&#xA;&#xA;OSError: [Errno 32] Broken pipe&#xA;&#xA;FFMPEG COMMAND:&#xA;c:\program files (x86)\python38-32\lib\site-packages\imageio_ffmpeg\binaries\ffmpeg-win32-v4.2.2.exe -y -f rawvideo -vcodec rawvideo -s 256x256 -pix_fmt rgb24 -r 29.97 -i - -an -vcodec libx264 -pix_fmt yuv420p -crf 25 -v warning C:\Users\pramu\AppData\Local\Temp\imageio_fh1fqkgc&#xA;&#xA;FFMPEG STDERR OUTPUT:&#xA;</module>

    &#xA;

    I get the same error using anaconda ffmpeg and non-anaconda ffmpeg.

    &#xA;

    Is there a way to fix this error ?

    &#xA;

    Also, is there a better way to convert list of frames into .mp4 or serializing it for sending through an API ?.

    &#xA;

    Thank you !

    &#xA;

  • "Could not demultiplex stream" in loading Video recorded by Opencv's VideoWriter

    21 novembre 2020, par batuman

    My program is

    &#xA;&#xA;

    int main(){&#xA;    cout &lt;&lt; "Start the process" &lt;&lt; endl;&#xA;    cv::VideoCapture vcap("rtsp://root:pass@192.168.0.90/axis-media/media.amp?camera=1");&#xA;    cout &lt;&lt; "Camera connection done!" &lt;&lt; endl;&#xA;    cv::Mat image, small;&#xA;    //Output video&#xA;    cv::Size S = cv::Size((int) vcap.get(CV_CAP_PROP_FRAME_WIDTH), (int) vcap.get(CV_CAP_PROP_FRAME_HEIGHT));&#xA;    int ex = static_cast<int>(vcap.get(CV_CAP_PROP_FOURCC));&#xA;    int fps = vcap.get(CV_CAP_PROP_FPS);&#xA;    cout &lt;&lt; "fps " &lt;&lt; fps &lt;&lt; " ex " &lt;&lt; ex &lt;&lt; endl;&#xA;    cv::VideoWriter outputVideo;&#xA;    outputVideo.open("TEST.avi", ex/*CV_FOURCC(&#x27;X&#x27;, &#x27;2&#x27;, &#x27;6&#x27;, &#x27;4&#x27;)*/, vcap.get(CV_CAP_PROP_FPS), S, true);&#xA;    if(!outputVideo.isOpened()){&#xA;        cout &lt;&lt; "Could not open the output video for write" &lt;&lt; endl;&#xA;        return -1;&#xA;    }&#xA;&#xA;    for(;;){&#xA;        if(!vcap.read(image)){&#xA;            std::cout &lt;&lt; "No frame" &lt;&lt; std::endl;&#xA;            cv::waitKey(0);&#xA;        }&#xA;&#xA;        cv::resize(image, small, image.size()/2, 0, 0 , cv::INTER_LINEAR);&#xA;        cv::imshow("Display", small);&#xA;        cv::waitKey(1);&#xA;        outputVideo.write(small);&#xA;        if(getkey() == &#x27;\n&#x27;)&#xA;            break;&#xA;    }&#xA;    cout &lt;&lt; "Camera release" &lt;&lt; endl;&#xA;    outputVideo.release();&#xA;    vcap.release();&#xA;    image.release();&#xA;    small.release();&#xA;    return 0;&#xA;}&#xA;</int>

    &#xA;&#xA;

    int ex = static_cast<int>(vcap.get(CV_CAP_PROP_FOURCC));</int> ex is 0 here.

    &#xA;&#xA;

    I can record the TEST.avi, but can't be read by cv::VideoCapture vcap("TEST.avi") ; or VLC player or Videos in Ubuntu.&#xA;The error is "Could not demultiplex stream".

    &#xA;&#xA;

    If I changed to

    &#xA;&#xA;

    outputVideo.open("TEST.avi", CV_FOURCC(&#x27;X&#x27;, &#x27;2&#x27;, &#x27;6&#x27;, &#x27;4&#x27;), vcap.get(CV_CAP_PROP_FPS), S, true);&#xA;outputVideo.open("TEST.avi", CV_FOURCC(&#x27;P&#x27;,&#x27;I&#x27;,&#x27;M&#x27;,&#x27;1&#x27;), vcap.get(CV_CAP_PROP_FPS), S, true);&#xA;outputVideo.open("TEST.avi", CV_FOURCC(&#x27;M&#x27;, &#x27;P&#x27;, &#x27;4&#x27;, &#x27;2&#x27;), vcap.get(CV_CAP_PROP_FPS), S, true);&#xA;etc.&#xA;

    &#xA;&#xA;

    all have same problem.

    &#xA;&#xA;

    If I set

    &#xA;&#xA;

    outputVideo.open("TEST.avi", CV_FOURCC(&#x27;i&#x27;, &#x27;Y&#x27;, &#x27;U&#x27;, &#x27;V&#x27;), vcap.get(CV_CAP_PROP_FPS), S, true);&#xA;

    &#xA;&#xA;

    I have error as Opencv: FFMPEG iYUV is not supported with codec id 14

    &#xA;&#xA;

    For

    &#xA;&#xA;

    outputVideo.open("TEST.avi", CV_FOURCC(&#x27;M&#x27;, &#x27;J&#x27;, &#x27;P&#x27;, &#x27;G&#x27;), vcap.get(CV_CAP_PROP_FPS), S, true);&#xA;&#xA;&#xA;OpenCV Error: Assertion failed (img.cols == width &amp;&amp; img.rows == height &amp;&amp; chann&#xA;els == 3) in write, file /home/Softwares/opencv/opencv/modules/videoio/src/&#xA;cap_mjpeg_encoder.cpp, line 829&#xA;terminate called after throwing an instance of &#x27;cv::Exception&#x27;&#xA;  what():  /home/Softwares/opencv/opencv/modules/videoio/src/cap_mjpeg_enco&#xA;der.cpp:829: error: (-215) img.cols == width &amp;&amp; img.rows == height &amp;&amp; channels =&#xA;= 3 in function write&#xA;

    &#xA;&#xA;

    What could be wrong ? Is that my FFMPEG has problem ?

    &#xA;

  • audio/mp4 ; codecs="mp4a.40.2" not playing in Chrome and Firefox

    19 octobre 2020, par Stefan Falk

    It seems I want to convert audios, which I want to stream on my website, to audio/mp4; codecs="mp4a.40.2".

    &#xA;

    Using ffmpeg-cli-wrapper, I am converting my uploaded audio files with this command here :

    &#xA;

    ffmpeg -i /tmp/input.any -acodec aac -b:a 256000 /tmp/output.aac&#xA;

    &#xA;

    On the client I am creating a SourceBuffer like this :

    &#xA;

    this.sourceBuffer = this.mediaSource.addSourceBuffer(&#x27;audio/mp4; codecs="mp4a.40.2"&#x27;);&#xA;

    &#xA;

    The errors are :

    &#xA;

    Chrome :

    &#xA;

    NotSupportedError: Failed to load because no supported source was found.&#xA;

    &#xA;

    Firefox :

    &#xA;

    NotSupportedError: The media resource indicated by the src attribute or assigned media provider object was not suitable.&#xA;

    &#xA;

    Here comes the fun part :

    &#xA;

    If I create the SourceBuffer using audio/aac as mime-type :

    &#xA;

    this.sourceBuffer = this.mediaSource.addSourceBuffer(&#x27;audio/aac&#x27;);&#xA;

    &#xA;

    the audio gets played correctly on Chrome but Firefox says :

    &#xA;

    MediaSource.addSourceBuffer: Type not supported in MediaSource&#xA;

    &#xA;


    &#xA;

    Update

    &#xA;

    After changing the command to

    &#xA;

    ffmpeg -i /tmp/input.any -acodec aac -b:a 256000 /tmp/output.mp4&#xA;                                                             ^^^ &#xA;

    &#xA;

    Chrome/Firefox do not give an error when using audio/mp4; codecs="mp4a.40.2", but the audio is not being played.

    &#xA;


    &#xA;

    See

    &#xA;

    &#xA;