Recherche avancée

Médias (1)

Mot : - Tags -/biomaping

Autres articles (69)

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

  • Mediabox : ouvrir les images dans l’espace maximal pour l’utilisateur

    8 février 2011, par

    La visualisation des images est restreinte par la largeur accordée par le design du site (dépendant du thème utilisé). Elles sont donc visibles sous un format réduit. Afin de profiter de l’ensemble de la place disponible sur l’écran de l’utilisateur, il est possible d’ajouter une fonctionnalité d’affichage de l’image dans une boite multimedia apparaissant au dessus du reste du contenu.
    Pour ce faire il est nécessaire d’installer le plugin "Mediabox".
    Configuration de la boite multimédia
    Dès (...)

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

Sur d’autres sites (8450)

  • How do I pipe files into whisper.cpp ?

    9 juillet 2023, par d-b

    whisper.cpp only supports wav-files. I have files in other formats I want to transcribe. It would be nice if I could make the conversion and transcription in one step/using a one-liner.

    


    I have tried these two, and some variant, but they failed :

    


    whisper.cpp -m ~/usr/whisper.cpp/models/ggml-large.bin < ffmpeg -i sample.amr -f wav

ffmpeg -i sample.amr -f wav pipe:1  | whisper.cpp -m ~/usr/whisper.cpp/models/ggml-large.bin


    


    From the whisper.cpp help page :

    


    usage: whisper.cpp [options] file0.wav file1.wav ...

  -f FNAME,  --file FNAME        [       ] input WAV file path


    


    (The help page doesn't mention stdin, pipes etc)

    


  • Streaming video with FFmpeg through pipe causes partial file offset error and moov atom not found

    12 mars 2023, par Moe

    I'm trying to stream a video from firebase cloud storage through ffmpeg then to the HTML video player, using a very basic example with the range header worked fine and was exactly what I was trying to do, but now when I'm trying to pipe the stream from firebase then through ffmpeg then to the browser it works fine for just first couple of requests (First 10 seconds) but after that It faced these issues :

    


      

    • Unable to get the actual time of the video on the browser (Constantly changing as if it doesn't know metadata)
    • 


    • On the server it fails to continue streaming to the request with the following :
    • 


    


    [NULL @ 000001d8c239e140] Invalid NAL unit size (110356 > 45446).
[NULL @ 000001d8c239e140] missing picture in access unit with size 45450
pipe:0: corrupt input packet in stream 0
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001d8c238c7c0] stream 0, offset 0x103fcf: partial file


    


    and then this error as well :

    


    [mov,mp4,m4a,3gp,3g2,mj2 @ 000001dc9590c7c0] moov atom not found
pipe:0: Invalid data found when processing input


    


    Using nodejs and running Ffmpeg V 5.0.1 on serverless env :

    


      const filePath = `sample.mp4` ||  req.query.path;

    // Create a read stream from the video file
    const videoFile = bucket.file(filePath);

    const range = req.headers.range;

    if(!range){
      return res.status(500).json({mes: 'Not Found'});
    }

      // Get the file size for the 'Content-Length' header
      const [metadata] = await videoFile.getMetadata();
      const videoSize = metadata.size;

      const CHUNK_SIZE = 1000000; // 1MB

      const start = Number(range.replace(/\D/g, ""));
      const end = Math.min(start + CHUNK_SIZE, videoSize - 1);
    
      // Create headers
      const contentLength = end - start + 1;
      const headers = {
        "Content-Range": `bytes ${start}-${end}/${videoSize}`,
        "Accept-Ranges": "bytes",
        "Content-Length": contentLength,
        "Content-Type": "video/mp4",
        // 'Transfer-Encoding': 'chunked'
      };
    
      // HTTP Status 206 for Partial Content
      res.writeHead(206, headers);
    
      // create video read stream for this particular chunk
      const inputStream = videoFile.createReadStream({ start, end });

     const ffmpeg = spawn(pathToFfmpeg, [
        // '-re', '-y',  
        '-f', 'mp4',  
        '-i', 'pipe:0', // read input from standard input (pipe)
        '-c:v', 'copy', // copy video codec
        '-c:a', 'copy', // copy audio codec
        '-map_metadata', '0',
        `-movflags`, `frag_keyframe+empty_moov+faststart+default_base_moof`,
        '-f', 'mp4', // output format
        'pipe:1',
       // write output to standard output (pipe)
      ], {
        stdio: ['pipe', 'pipe', 'inherit']
      });

      inputStream.pipe(ffmpeg.stdin);

      ffmpeg.stdout.pipe(res);
      


    


    Note that this version is trimmed I do have a lot of log code and error handling of course, and basically again what's happening is that for the first request it is working fine but then if the player requests a part like minute 5 for example it gives the errors I mentioned above :

    


    What I have tried :

    


      

    • At first I tried adjusting the ffmpeg parameters with the following to try and fix the moov atom error but it still presisted :
    • 


    


        -map_metadata', '0',
    `-movflags`, `frag_keyframe+empty_moov+faststart+default_base_moof`


    


      

    • I have also tried to stream to file then through pipe but that also gave the same errors.
    • 


    


    Finally after googling for about day and a half trying out tens of solutions nothing worked, now I'm stuck at this error where I'm not able to process a specific fragment of a video through ffmpeg, is that even possible or am I doing something wrong ?

    


    Why am I even streaming through ffmpeg ?

    


    I am indeed of course going to add filters to the video and a dynamic watermark text for every request that's why I need to use ffmpeg through stream not directly through a file as the video filters will change on demand according to every user

    


  • Is it possible on FFMPEG to pass RAW frames from RTSP to pipe AND write video file segments by time to disk ?

    27 mars 2023, par Roberto Alcantara

    I'm trying to receive RTSP frames to be processed by OpenCV, via ffmpeg using python. This is ok.

    


    However I also need to write this video to disk one video each minute. This last part is the problem.

    


    This is ok and works, but only write to a single file 'OUTPUT.TS' :

    


    command = ['C:/ffmpeg/bin/ffmpeg.exe',
           '-rtsp_transport', 'tcp',   # Force TCP (for testing)
           '-max_delay', '30000000',   # 30 seconds (sometimes needed because the stream is from the web).
           '-i', STREAM_ADDRESS,
           '-f', 'rawvideo',           # Video format is raw video
           '-pix_fmt', 'bgr24',        # bgr24 pixel format matches OpenCV default pixels format.
           '-an', 'pipe:',
           '-vcodec', 'copy', '-y', 'OUTPUT.TS']

ffmpeg_process = subprocess.Popen(command, stdout=subprocess.PIPE)


    


    but since I'm using -f RAW I can't add something like

    


    '-f segment -segment_time 1800 -strftime 1 "%Y-%m-%d_%H-%M-%S.ts'


    


    I tried to use some ffmpeg combinations but without success.

    


    There are any way to do this on FFMPEG without start/stop the ffmpeg process ?