Recherche avancée

Médias (0)

Mot : - Tags -/auteurs

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (51)

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

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

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

Sur d’autres sites (9413)

  • How to hide/disable ffmpeg erros when using OpenCV (python) ?

    20 décembre 2019, par Mehran

    I’m using OpenCV python to capture a video.
    This is my code

    import cv2

    cap = cv2.VideoCapture("vid.mp4")
    while True:
       flag, frame =  cap.read()

       if not flag:
           cv2.imshow('video', frame)

       if cv2.waitKey(10) == 27:
           break

    When a frame is not ready it produces an error like this

    enter image description here

    or

    Truncating packet of size 2916 to 1536
    [h264 @ 0x7ffa4180be00] AVC: nal size 2912
    [h264 @ 0x7ffa4180be00] AVC: nal size 2912
    [h264 @ 0x7ffa4180be00] no frame!

    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7ffa41803000] stream 0, offset 0x14565: partial file

    I wanted to find a way to hide this error ! I guess that this error is being produced by ffmpeg. Is there any way to hide or disable it ?

    This error is produced when I call cap.read(). And I also tried to wrap it with try ... except ... but it doesn’t work because it doesn’t throw any exceptions.

  • MJPEG Stream works in Firefox but not in Chrome

    11 décembre 2019, par Maoration

    We have a system that contains cameras and we want to stream them to multiple clients.
    Behind the scenes on the server we get connections from cameras, we keep everything related to that camera in a CameraContainer, which also includes a mpegtsToMjpegStream that extends Duplex (both Readable and Writable Stream).

    after a camera connects, we open an ffmpeg process to work on the incoming mpegts stream, and output an MJPEG stream :

         '-map', '0:v', '-c:v', 'mjpeg','-f', 'mjpeg', `-`,

    ** we are doing this because we are also mapping to other outputs, like writing files.


    On the ’serving’ side, we are currently testing a simple API to GET an mjpeg stream with a camera id :

     async getCameraStream(@Param('cameraId') cameraId: string, @Res() res): Promise<any> {
    const cameraContainer = this.cameraBridgeService.getCameraContainer(cameraId);
    if (!cameraContainer) {
     throw new Error(`Camera with id: ${cameraId} was not found`);
    }

    if (!cameraContainer.mpegtsToMjpegStream) {
     throw new Error('ERROR: mpegtsToMjpegStream stream does not exist on this camera container');
    }

    const writable = new Writable({
     write: (chunk, encoding, callback) => {
       res.write(`Content-Type: image/jpeg\r\nContent-Length: ${chunk.length}\r\n\r\n`);
       res.write(chunk);
       res.write('\r\n--ffmpeg_streamer\r\n');
       callback();
     },
    });

    res.set('Content-Type', 'multipart/x-mixed-replace;boundary=ffmpeg_streamer');
    res.write('--ffmpeg_streamer\r\n');

    cameraContainer.mpegtsToMjpegStream.pipe(writable, { end: false });

    res.once('close', () => {
     if (cameraContainer.mpegtsToMjpegStream &amp;&amp; writable) {
       cameraContainer.mpegtsToMjpegStream.unpipe(writable);
     }
     res.destroy();
    });
    </any>

    The problem is this code works very nicely when accessing the stream with Firefox- after 1-2 seconds we get a stable, high quality, low latency stream.
    With Chrome however, the same code does not behave- the video output is corrupted, disappears into a black screen all the time, and we have to keep refreshing the page constantly just to view a few seconds of the stream until it disappears again.

    Any suggestions as to why this happens and how can I fix it ?

  • FFmpeg pauses the extraction of frames at 20% (but when closed, dumps all frames to disk)

    1er décembre 2019, par Nicke Manarin

    I’m trying to extract frames from a video using FFmpeg. I want to be able to control which frames to extract, by setting the start, end and FPS values.

    The problem is, that after the extraction begins, FFmpeg stops after 20% of the way. It always stops there, independently of the frame count.

    This is the code that I’m using :

    var start = TimeSpan.FromMilliseconds(SelectionSlider.LowerValue);
    var end = TimeSpan.FromMilliseconds(SelectionSlider.UpperValue);
    var fps = FpsIntegerUpDown.Value;
    var count = CountFrames(); //Duration x FPS
    var folder = Path.Combine(RootFolder, "Import");
    var path = Path.Combine(folder, $"%0{count.ToString().Length + 1}d.png");

    try
    {
       //Create temporary folder.
       if (Directory.Exists(folder))
           Directory.Delete(folder, true);

       Directory.CreateDirectory(folder);

       CaptureProgressBar.Value = 0;
       CaptureProgressBar.Maximum = count;

       var info = new ProcessStartInfo(UserSettings.All.FfmpegLocation)
       {
           Arguments = $" -i \"{VideoPath}\" -vsync 2 -progress pipe:1 -vf scale={VideoWidth}:{VideoHeight} -ss {start:hh\\:mm\\:ss\\.fff} -to {end:hh\\:mm\\:ss\\.fff} -hide_banner -c:v png -r {fps} -vframes {count} \"{path}\"",
           CreateNoWindow = true,
           ErrorDialog = false,
           UseShellExecute = false,
           RedirectStandardError = true,
           RedirectStandardOutput = true
        };

        _process = new Process();
        _process.OutputDataReceived += (sender, e) =>
        {
            Debug.WriteLine(e.Data);

            if (string.IsNullOrEmpty(e.Data))
                return;

            var parsed = e.Data.Split('=');

            switch (parsed[0])
            {
                case "frame":
                    Dispatcher?.InvokeAsync(() => { CaptureProgressBar.Value = Convert.ToDouble(parsed[1]); });
                    break;

                case "progress":
                    if (parsed[1] == "end" &amp;&amp; IsLoaded)
                        GetFiles(folder); //Get all files from the output folder.

                    break;
             }
       };

    _process.ErrorDataReceived += (sender, e) =>
    {
       if (!string.IsNullOrEmpty(e.Data))
           throw new Exception("Error while capturing frames with FFmpeg.") { HelpLink = $"Command:\n\r{info.Arguments}\n\rResult:\n\r{e.Data}" };
    };

    _process.StartInfo = info;
    _process.Start();
    _process.BeginOutputReadLine();

    //Just to wait...
    await Task.Factory.StartNew(() => _process.WaitForExit());

    So, after starting the import process, FFmpeg will extract some frames, and after reaching around 20%, it will pause the extraction.

    frame=95
    fps=5.79
    stream_0_0_q=-0.0
    bitrate=N/A
    total_size=N/A
    out_time_us=1400000
    out_time_ms=1400000
    out_time=00:00:01.400000
    dup_frames=0
    drop_frames=0
    speed=0.0854x

    progress=continue
    frame=106
    fps=6.25
    stream_0_0_q=-0.0
    bitrate=N/A
    total_size=N/A
    out_time_us=1583333
    out_time_ms=1583333
    out_time=00:00:01.583333
    dup_frames=0
    drop_frames=0
    speed=0.0933x
    progress=continue

    frame=117
    fps=6.67
    stream_0_0_q=-0.0
    bitrate=N/A
    total_size=N/A
    out_time_us=1766667
    out_time_ms=1766667
    out_time=00:00:01.766667
    dup_frames=0
    drop_frames=0
    speed=0.101x
    progress=continue

    Something strange : if I close the app while is the extraction is paused, suddenly FFmpeg will dump all frames to the folder.

    Why would FFmpeg pause the extraction at all (But continue doing in memory) ?
    Is there any way for me to force FFmpeg to extract the frames normally ?

    PS : It does not happen while using FFmpeg via cmd, so it must be something in code.