Recherche avancée

Médias (91)

Autres articles (69)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • 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" (...)

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

Sur d’autres sites (7119)

  • fftools/ffmpeg_filter : stop accessing OutputStream.[max_]frame_rate

    12 septembre 2024, par Anton Khirnov
    fftools/ffmpeg_filter : stop accessing OutputStream.[max_]frame_rate
    

    Pass them to ofilter_bind_ost() via OutputFilterOptions, as is done for
    most other data it needs. OutputStream.[max_]frame_rate/force_fps are no
    longer used outside of ffmpeg_mux*, and so can be made private.

    This is a step toward decoupling encoders from muxers.

    • [DH] fftools/ffmpeg.h
    • [DH] fftools/ffmpeg_filter.c
    • [DH] fftools/ffmpeg_mux.h
    • [DH] fftools/ffmpeg_mux_init.c
  • Jquery auto-refresh stop refreshing after 10seconds

    11 février 2016, par Mick Jack

    I have this JQuery script to auto refresh every 2seconds after a video is uploaded and retrieve the estimated time needed to process the video with ffmpeg

    However my refresh script stop refreshing after 10-15seconds. i traced the problem to the session_start() ; when i remove this session_start() ; my refresh script work perfectly. what could be the cause and solution here ?

    videoupload.php

    <div title="test">
           <h5>Encoding percentage</h5>
           <code class="echappe-js">&lt;script src=&quot;https://code.jquery.com/jquery-2.1.1.min.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
    &lt;script&gt;<br />
                   $(&quot;#Submit&quot;).click(function(event){<br />
                   setInterval(function(){<br />
                   $(&quot;#myDiv&quot;).load('progress.php')<br />
                   }, 2000);<br />
                   });<br />
                   &lt;/script&gt;

    Progress.php

    &lt;?php

    $content = @file_get_contents('logfile.txt');

               if($content){
               //get duration of source
               preg_match("/Duration: (.*?), start:/", $content, $matches);

               $rawDuration = $matches[1];

               //rawDuration is in 00:00:00.00 format. This converts it to seconds.
               $ar = array_reverse(explode(":", $rawDuration));
               $duration = floatval($ar[0]);
               if (!empty($ar[1])) $duration += intval($ar[1]) * 60 ;
               if (!empty($ar[2])) $duration += intval($ar[2]) * 60 * 60 * 60;

               //get the time in the file that is already encoded
               preg_match_all("/time=(.*?) bitrate/", $content, $matches);

               $rawTime = array_pop($matches);

               //this is needed if there is more than one match
               if (is_array($rawTime)){$rawTime = array_pop($rawTime);}

               //rawTime is in 00:00:00.00 format. This converts it to seconds.
               $ar = array_reverse(explode(":", $rawTime));
               $time = floatval($ar[0]);
               if (!empty($ar[1])) $time += intval($ar[1]) * 60;
               if (!empty($ar[2])) $time += intval($ar[2]) * 60 * 60;

               //calculate the progress
               $progress = round(($time/$duration) * 100);

               echo "Duration: " . $duration . "<br />";
               echo "Current Time: " . $time . "<br />";
               echo "Progress: " . $progress . "%";

    }

    ?>

    upload.php

    session_start();

    $userID = $_SESSION['login_user'];
    // rest of the code to convert video using ffmpeg
  • How to start and stop saving video frames according to a trigger with OpenCV VideoWriter

    11 août 2021, par Jacob nighFor

    I am building an app that records frames from IP camera through RTSP.

    &#xA;&#xA;

    My engine is in charge to save a video in mp4 with Opencv VideoWriter working well.&#xA;What I am looking for is to create a startRecord and a stopRecord class method that will respectively start and stop recording according to a trigger (it could be an argument that I pass to the thread).&#xA;Is anyone know what the best way to do that kind of stuff ?

    &#xA;&#xA;

    Here is my class :

    &#xA;&#xA;

    from threading import Thread&#xA;import cv2&#xA;import time&#xA;import multiprocessing&#xA;import threading&#xA;class RTSPVideoWriterObject(object):&#xA;    def __init__(self, src=0):&#xA;        # Create a VideoCapture object&#xA;        self.capture = cv2.VideoCapture(src)&#xA;&#xA;        # Start the thread to read frames from the video stream&#xA;        self.thread = Thread(target=self.update, args=())&#xA;        self.thread.daemon = True&#xA;        self.thread.start()&#xA;&#xA;    def update(self):&#xA;        # Read the next frame from the stream in a different thread&#xA;        while True:&#xA;            if self.capture.isOpened():&#xA;                (self.status, self.frame) = self.capture.read()&#xA;&#xA;    def endRecord(self):&#xA;        self.capture.release()&#xA;        self.output_video.release()&#xA;        exit(1)&#xA;&#xA;    def startRecord(self,endRec):&#xA;&#xA;        self.frame_width = int(self.capture.get(3))&#xA;        self.frame_height = int(self.capture.get(4))&#xA;        self.codec = cv2.VideoWriter_fourcc(*&#x27;mp4v&#x27;)&#xA;        self.output_video = cv2.VideoWriter(&#x27;fileOutput.mp4&#x27;, self.codec, 30, (self.frame_width, self.frame_height))&#xA;        while True:          &#xA;            try:&#xA;                self.output_video.write(self.frame)&#xA;                if endRec:&#xA;                    self.endRecord()&#xA;            except AttributeError:&#xA;                pass&#xA;&#xA;&#xA;&#xA;&#xA;if __name__ == &#x27;__main__&#x27;:&#xA;&#xA;    rtsp_stream_link = &#x27;rtsp://foo:192.5545....&#x27;&#xA;    video_stream_widget = RTSPVideoWriterObject(rtsp_stream_link)&#xA;&#xA;    stop_threads = False&#xA;    t1 = threading.Thread(target = video_stream_widget.startRecord, args =[stop_threads]) &#xA;    t1.start() &#xA;    time.sleep(15)&#xA;    stop_threads = True&#xA;&#xA;

    &#xA;&#xA;

    As you can see in the main I reading frames and store them in a separate thread. Then I am starting to record (record method is with an infinite loop so blocking) and then after 15 sec, I am trying to pass a 'stop_record' argument to stop recording properly.

    &#xA;&#xA;

    A part of the code comes from Storing RTSP stream as video file with OpenCV VideoWriter

    &#xA;&#xA;

    Is someone have an idea ?&#xA;I read a lot that OpenCV can be very tricky for multithreading

    &#xA;&#xA;

    N.

    &#xA;

  • Boussole SPIP

    SPIP.net-La documentation officielle et téléchargement de (...) SPIP Code-La documentation du code de SPIP Programmer SPIP-La documentation pour développer avec (...) Traduire SPIP-Espace de traduction de SPIP et de ses (...) Plugins SPIP-L'annuaire des plugins SPIP SPIP-Contrib-L'espace des contributions à SPIP Forge SPIP-L'espace de développement de SPIP et de ses (...) Discuter sur SPIP-Les nouveaux forums de la communauté (...) SPIP Party-L'agenda des apéros et autres rencontres (...) Médias SPIP-La médiathèque de SPIP SPIP Syntaxe-Tester l'édition de texte dans SPIP