Recherche avancée

Médias (33)

Mot : - Tags -/creative commons

Autres articles (53)

  • Création définitive du canal

    12 mars 2010, par

    Lorsque votre demande est validée, vous pouvez alors procéder à la création proprement dite du canal. Chaque canal est un site à part entière placé sous votre responsabilité. Les administrateurs de la plateforme n’y ont aucun accès.
    A la validation, vous recevez un email vous invitant donc à créer votre canal.
    Pour ce faire il vous suffit de vous rendre à son adresse, dans notre exemple "http://votre_sous_domaine.mediaspip.net".
    A ce moment là un mot de passe vous est demandé, il vous suffit d’y (...)

  • Mise à disposition des fichiers

    14 avril 2011, par

    Par défaut, lors de son initialisation, MediaSPIP ne permet pas aux visiteurs de télécharger les fichiers qu’ils soient originaux ou le résultat de leur transformation ou encodage. Il permet uniquement de les visualiser.
    Cependant, il est possible et facile d’autoriser les visiteurs à avoir accès à ces documents et ce sous différentes formes.
    Tout cela se passe dans la page de configuration du squelette. Il vous faut aller dans l’espace d’administration du canal, et choisir dans la navigation (...)

  • (Dés)Activation de fonctionnalités (plugins)

    18 février 2011, par

    Pour gérer l’ajout et la suppression de fonctionnalités supplémentaires (ou plugins), MediaSPIP utilise à partir de la version 0.2 SVP.
    SVP permet l’activation facile de plugins depuis l’espace de configuration de MediaSPIP.
    Pour y accéder, il suffit de se rendre dans l’espace de configuration puis de se rendre sur la page "Gestion des plugins".
    MediaSPIP est fourni par défaut avec l’ensemble des plugins dits "compatibles", ils ont été testés et intégrés afin de fonctionner parfaitement avec chaque (...)

Sur d’autres sites (5149)

  • FFmpeg to connect to RTSP in Python, but sometimes the video stream freezes, and FFmpeg throws an error

    23 décembre 2024, par Jin Hc
      

    • Here is part of my code. I use the ffmpeg-python library in Python to receive the RTSP stream and perform subsequent processing.
    • 


    


        def __init__(self, parent: QWidget = None):
        super(captureVideo_Thread, self).__init__()
        self.ffmpeg_args = {
            "rtsp_transport": "tcp",
            "fflags": "+genpts+discardcorrupt+autobsf+fastseek",
            "flags": "low_delay",
            "err_detect": "ignore_err",
            "reorder_queue_size": 10000,
            "vsync": 2,
            "probesize": 10 * 1000000,
            "analyzeduration": 10 * 1000000,
            "threads": "auto",
            "correct_ts_overflow": "1",
        }

        self.parent: Video_Widgets = parent
        self.running_FLAG = True
        self.mutex = QMutex()
        self.process = None

    def run(self) -> None:
        try:
            probe = func_timeout(2, ffmpeg.probe, (self.parent.video_source,))
        except FunctionTimedOut:
            self.captureVideoEnd_signal.emit()
            return
        except ffmpeg.Error as e:
            self.captureVideoEnd_signal.emit()
            return
        cap_info = next(x for x in probe["streams"] if x["codec_type"] == "video")
        video_width = cap_info["width"]
        video_height = cap_info["height"]
        config.video_width = video_width
        config.video_height = video_height
        up, down = str(cap_info["r_frame_rate"]).split("/")
        config.video_fps = round(eval(up) / eval(down), 2)
        self.process = (
            ffmpeg.input(self.parent.video_source, **self.ffmpeg_args)
            .output(
                "pipe:",
                format="rawvideo",
                pix_fmt="rgb24",
            )
            .overwrite_output()
            .run_async(pipe_stdout=True)
        )

        while True:
            if not config.is_openVideo:
                config.is_openVideo = True
            with config.locked(self.mutex):
                if not self.running_FLAG:
                    break

            in_bytes = self.process.stdout.read(video_width * video_height * 3)
            expected_size = video_width * video_height * 3
            if not in_bytes or len(in_bytes) != expected_size:
                continue

            in_frame = np.frombuffer(in_bytes, np.uint8).reshape([video_height, video_width, 3])


    


      

    • There are two phenomena that occur, and these do not happen at fixed times. The first phenomenon is that FFmpeg throws the following error, but the video continues playing.
    • 


    


    # client
[vist#0:0/h264 @ 000002419fad8e40] [dec:h264 @ 00000241a01046c0] corrupt decoded frame
frame=87565 fps= 50 q=-0.0 size=336245760KiB time=00:29:11.20 bitrate=1572927.9kbits/s speed=   1x  
[h264 @ 00000241a0104a00] Invalid level prefix
[h264 @ 00000241a0104a00] error while decoding MB 25 63
[vist#0:0/h264 @ 000002419fad8e40] [dec:h264 @ 00000241a01046c0] corrupt decoded frame
frame=87593 fps= 50 q=-0.0 size=336353280KiB time=00:29:11.75 bitrate=1572938.5kbits/s speed=   1x  
[h264 @ 00000241a0104a00] Invalid level prefix
[h264 @ 00000241a0104a00] error while decoding MB 24 63
[vist#0:0/h264 @ 000002419fad8e40] [dec:h264 @ 00000241a01046c0] corrupt decoded frame


    


    # server
No errors.


    


      

    • The second phenomenon is that the receiver on my side will freeze completely, and the speed displayed by FFmpeg will gradually decrease (the trigger time for this behavior is random, sometimes after 5 minutes, sometimes after 20 minutes). Additionally, the sender will display a large number of errors.
    • 


    


    # client
frame=21131 fps= 48 q=-0.0 size=81139200KiB time=00:07:10.97 bitrate=1542290.7kbits/s speed=0.984x


    


    # server
[WARN  rtsp_lib/rtsp_demo.c:1966:rtsp_sever_tx_video] client 192.168.0.102 will lost video packet
[WARN  rtsp_lib/rtsp_demo.c:1966:rtsp_sever_tx_video] client 192.168.0.102 will lost video packet
[WARN  rtsp_lib/rtsp_demo.c:1966:rtsp_sever_tx_video] client 192.168.0.102 will lost video packet
[WARN  rtsp_lib/rtsp_demo.c:1966:rtsp_sever_tx_video] client 192.168.0.102 will lost video packet
[WARN  rtsp_lib/rtsp_demo.c:1966:rtsp_sever_tx_video] client 192.168.0.102 will lost video packet
[DEBUG rtsp_lib/rtsp_msg.c:865:rtsp_msg_parse_from_array]
RTSP/1.0 501 Not Implemented


    


      

    • I am sure the issue is not with the stream source, because there are no problems when using VLC or other software.

      


    • 


    • I think the issue might be with my FFmpeg settings.???

      


    • 


    • I found that the average bitrate of VLC is 19000kb/s, but the FFmpeg in my code shows 1500000kb/s. Why is this happening ? Is there something wrong with my settings ?

      


    • 


    


  • Combining Opencv Raw frames with Microphone Audio stream Using ffmpeg

    10 août 2022, par Abhishek Vats

    I am trying to build a sports analysis platform where I have a deep learning model which processes Live video(RTMP/Webcam) frames, applies overlays,score etc. and then I need to combine it with microphone audio and rebroadcast with audio and video in sync. I think I need the presentation time stamps of the frames (Since AI frame processing takes variable time) and somehow provide ffmpeg with it but I'm lost and could not find a similar example doing this.

    


  • Experiences on building a video recorder for RTSP/RTP streams ?

    3 août 2016, par molokoV

    I have to store continuous video streams from many ip cameras,
    The video is encoded in H.264 and the audio is in AAC or MP3.
    The recorded videos will be played mostly on mobile devices but also on browsers.

    • What would be the best strategy to build a scalable recorder service ?

    • What is the best storage format ? mp4 ?

    • Should i convert the video directly to MP4 ? or is better to store RAW RTP ?

    • Whats the best way to ensure best reliability and less frame loses and avoid lost of sync between audio and video ?

    • I also want to hear similar experiences

    Thanks !