Recherche avancée

Médias (0)

Mot : - Tags -/organisation

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

Autres articles (69)

  • Librairies et binaires spécifiques au traitement vidéo et sonore

    31 janvier 2010, par

    Les logiciels et librairies suivantes sont utilisées par SPIPmotion d’une manière ou d’une autre.
    Binaires obligatoires FFMpeg : encodeur principal, permet de transcoder presque tous les types de fichiers vidéo et sonores dans les formats lisibles sur Internet. CF ce tutoriel pour son installation ; Oggz-tools : outils d’inspection de fichiers ogg ; Mediainfo : récupération d’informations depuis la plupart des formats vidéos et sonores ;
    Binaires complémentaires et facultatifs flvtool2 : (...)

  • Automated installation script of MediaSPIP

    25 avril 2011, par

    To overcome the difficulties mainly due to the installation of server side software dependencies, an "all-in-one" installation script written in bash was created to facilitate this step on a server with a compatible Linux distribution.
    You must have access to your server via SSH and a root account to use it, which will install the dependencies. Contact your provider if you do not have that.
    The documentation of the use of this installation script is available here.
    The code of this (...)

  • Organiser par catégorie

    17 mai 2013, par

    Dans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
    Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
    Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...)

Sur d’autres sites (8687)

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

    


  • 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

    


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