Recherche avancée

Médias (91)

Autres articles (87)

  • MediaSPIP Player : problèmes potentiels

    22 février 2011, par

    Le lecteur ne fonctionne pas sur Internet Explorer
    Sur Internet Explorer (8 et 7 au moins), le plugin utilise le lecteur Flash flowplayer pour lire vidéos et son. Si le lecteur ne semble pas fonctionner, cela peut venir de la configuration du mod_deflate d’Apache.
    Si dans la configuration de ce module Apache vous avez une ligne qui ressemble à la suivante, essayez de la supprimer ou de la commenter pour voir si le lecteur fonctionne correctement : /** * GeSHi (C) 2004 - 2007 Nigel McNie, (...)

  • Keeping control of your media in your hands

    13 avril 2011, par

    The vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
    While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
    MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
    MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...)

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

Sur d’autres sites (11716)

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