Recherche avancée

Médias (1)

Mot : - Tags -/école

Autres articles (49)

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 est la première version de MediaSPIP stable.
    Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

Sur d’autres sites (5601)

  • openCV save frames from RTSP non blocking

    1er janvier 2020, par Jacob nighFor

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

    My engine is in charge to save a video in mp4 with Opencv VideoWriter working well.
    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).
    Is anyone know what the best way to do that kind of stuff ?

    Here is my class :

    from threading import Thread
    import cv2
    import time
    import multiprocessing
    import threading
    class RTSPVideoWriterObject(object):
       def __init__(self, src=0):
           # Create a VideoCapture object
           self.capture = cv2.VideoCapture(src)

           # Start the thread to read frames from the video stream
           self.thread = Thread(target=self.update, args=())
           self.thread.daemon = True
           self.thread.start()

       def update(self):
           # Read the next frame from the stream in a different thread
           while True:
               if self.capture.isOpened():
                   (self.status, self.frame) = self.capture.read()

       def endRecord(self):
           self.capture.release()
           self.output_video.release()
           exit(1)

       def startRecord(self,endRec):

           self.frame_width = int(self.capture.get(3))
           self.frame_height = int(self.capture.get(4))
           self.codec = cv2.VideoWriter_fourcc(*'mp4v')
           self.output_video = cv2.VideoWriter('fileOutput.mp4', self.codec, 30, (self.frame_width, self.frame_height))
           while True:          
               try:
                   self.output_video.write(self.frame)
                   if endRec:
                       self.endRecord()
               except AttributeError:
                   pass




    if __name__ == '__main__':

       rtsp_stream_link = 'rtsp://foo:192.5545....'
       video_stream_widget = RTSPVideoWriterObject(rtsp_stream_link)

       stop_threads = False
       t1 = threading.Thread(target = video_stream_widget.startRecord, args =[stop_threads])
       t1.start()
       time.sleep(15)
       stop_threads = True

    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.

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

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

    N.

  • Red5 live stream - huge delay on localhost

    23 janvier 2013, par user1958067

    I m running Red5 1.0.0 RC1, with JW Player and ffmpeg on Linux Mint14

    There is a huge delay while streaming, even when everythings happening on my machine/localhost.

    I do following steps :

    1. FFmpeg : ffmpeg -i 'http://localhost:port' rtmp://localhost/oflaDemo/live.flv

    2. Red5 : TCPnoDelay ist set to true.

    3. JW Player : Bufferlength is set to 0. Also tried 2 and 3.

     :

       <code class="echappe-js">&lt;script type=&amp;#39;text/javascript&amp;#39;&gt;<br />
        jwplayer(&amp;#39;mediaspace&amp;#39;).setup({<br />
       &amp;#39;flashplayer&amp;#39;: &amp;#39;player.swf&amp;#39;,<br />
       &amp;#39;file&amp;#39;: &amp;#39;live&amp;#39;,<br />
       &amp;#39;type&amp;#39;: &amp;#39;rtmp&amp;#39;,<br />
       &amp;#39;streamer&amp;#39;: &amp;#39;rtmp://localhost/oflaDemo&amp;#39;,<br />
       &amp;#39;controlbar&amp;#39;: &amp;#39;none&amp;#39;,<br />
       &amp;#39;autostart&amp;#39;: &amp;#39;true&amp;#39;,<br />
       &amp;#39;bufferlength&amp;#39;: &amp;#39;3&amp;#39;,<br />
       &amp;#39;width&amp;#39;: &amp;#39;640&amp;#39;,<br />
       &amp;#39;height&amp;#39;: &amp;#39;380&amp;#39;<br />
     });<br />
    &lt;/script&gt;

    The delay is something between 7-10 seconds !
    This all is happening on and from localhost, so bandwith shouldnt be the issue.

  • Node.JS Live Streaming Audio with FFMPEG

    20 avril 2021, par nicnacnic

    I'm trying to create an Express server to live stream audio captured from another application (Discord in this case). I'm able to get a server up and running, but there are a couple issues that need to be solved. Here's my server code so far.

    &#xA;

    const app = express();&#xA;app.get("/", function(req, res) {&#xA;    res.sendFile(__dirname &#x2B; "/index.html");&#xA;});&#xA;app.get("/audio", function(req, res) {&#xA;    const stream = ffmpeg(audio).inputOptions(["-f", "s16le", "-ar", "48k", "-ac", "2"]).format(&#x27;wav&#x27;);&#xA;    res.writeHead(200, { "Content-Type": "audio/wav" });&#xA;    stream.pipe(res);&#xA;});&#xA;app.listen(8080)&#xA;

    &#xA;

      &#xA;
    1. Silent sections of audio need to be added. When there's no activity on the input, there's no data written to the audio variable. This causes weird behavior, for example I can speak and the audio comes through a second later. Then, if I wait 10 seconds then speak again, the audio comes through 4-5 seconds later. I believe this is a problem with the way I'm using ffmpeg to transcode, but I have no idea how to fix it.
    2. &#xA;

    3. Refreshing the client crashes the program. Every time I refresh the client I get an ffmpeg error. Error: Output stream closed. This error doesn't happen if I close it, only on reload.
    4. &#xA;

    5. The audio is not synced between clients. Every time I open a new connection, the audio starts playing from the beginning instead of being synced with each other and playing the audio live.
    6. &#xA;

    &#xA;

    This is how it's supposed to work : it captures audio from my app in PCM, converts the audio to WAV with ffmpeg, and then streams the audio live to the clients. The audio needs to be synced with all the clients as best as possible to reduce delay. And I'm using fluent-ffmpeg instead of just regular ffmpeg for the transcoding.&#xA;Thanks !

    &#xA;