Recherche avancée

Médias (91)

Autres articles (78)

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

  • Configurer la prise en compte des langues

    15 novembre 2010, par

    Accéder à la configuration et ajouter des langues prises en compte
    Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
    De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
    Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)

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

Sur d’autres sites (11188)

  • 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.

  • What is a correct way of ffmpeg dshow webcamera properties save and load ?

    12 juin 2020, par C0oo1D

    Command (PS == Windows PowerShell) :

    



    PS D:\> ffmpeg -f dshow -show_video_device_dialog True -video_device_save some_profile.txt -i 'video=MicrosoftR LifeCam Studio(TM)'


    



    FFmpeg Header :

    



    ffmpeg version git-2020-06-04-7f81785 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 9.3.1 (GCC) 20200523
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
  libavutil      56. 49.100 / 56. 49.100
  libavcodec     58. 90.100 / 58. 90.100
  libavformat    58. 44.100 / 58. 44.100
  libavdevice    58.  9.103 / 58.  9.103
  libavfilter     7. 84.100 /  7. 84.100
  libswscale      5.  6.101 /  5.  6.101
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100


    



    Error after OK/Cancel/Close in camera settings dialog (empty file was created). Also tried without dialog - the same problem :

    



    [dshow @ 0715de40] Query for IPersistStream failed.
video=Microsoft® LifeCam Studio(TM): I/O error


    



    I assume that problem at the camera side, but I don't exclude my blindness (didn’t find any examples of saving settings or required command options in the documentation).

    



    Perhaps there is another way to save / load webcamera properties ?

    


  • Avoid using the term "file" and prefer "url" in some docs and comments

    5 décembre 2016, par Michael Niedermayer
    Avoid using the term "file" and prefer "url" in some docs and comments
    

    This should make it less ambigous that these are URLs

    Signed-off-by : Michael Niedermayer <michael@niedermayer.cc>

    • [DH] doc/ffmpeg.texi
    • [DH] doc/ffplay.texi
    • [DH] doc/ffprobe.texi
    • [DH] ffmpeg_opt.c