Recherche avancée

Médias (10)

Mot : - Tags -/wav

Autres articles (74)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Gestion des droits de création et d’édition des objets

    8 février 2011, par

    Par défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;

  • Dépôt de média et thèmes par FTP

    31 mai 2013, par

    L’outil MédiaSPIP traite aussi les média transférés par la voie FTP. Si vous préférez déposer par cette voie, récupérez les identifiants d’accès vers votre site MédiaSPIP et utilisez votre client FTP favori.
    Vous trouverez dès le départ les dossiers suivants dans votre espace FTP : config/ : dossier de configuration du site IMG/ : dossier des média déjà traités et en ligne sur le site local/ : répertoire cache du site web themes/ : les thèmes ou les feuilles de style personnalisées tmp/ : dossier de travail (...)

Sur d’autres sites (10557)

  • How to save audio chunks from client to ffmpeg readable file ?

    22 septembre 2023, par LuckOverflow

    I am live recording audio data from a TS React front-end and need to send it to the server, where it can be saved to a file so that ffmpeg can mix it. The front-end saves the mic data to a blob with type "mimeType : "audio/webm ; codecs=opus" when printed in the browser terminal. I send the exact object that I printed to the server, where logging it indicates it is a, or was passed as a, "Buffer" object.

    


    I have tried saving that Buffer as a webm file, but when I pass that file as an input to ffmpeg ffprobe, I get the error "Format matroska,webm detected only with a low score of 1..." and "EBML header parsing failed.." "Invalid data found when processing input." I have tried several other formats to no success.

    


    I need a way to transform this Buffer object to an audio file that can be mixed by ffmpeg. When I am finished, I also need to be able to do the reverse operation to send it in the same format to another client for playback, which is currently working.

    


    Code that records and sends the audio (TS React) :

    


    React Record

    


    const startRecording = async function () {
    inputStream = await navigator.mediaDevices.getUserMedia({ audio: true });
   
    mediaRecorder.current = new MediaRecorder(inputStream, { mimeType: "audio/webm; codecs=opus" });

    mediaRecorder.current.ondataavailable = e => {
      console.log(e.data)
      if (e.data.size > 0) {
        socket.emit("recording", e.data);
        console.log("Audio data recorded. Transmitting to server via socketio...");
      }
    };

    mediaRecorder.current.start(1000);
  };



    


    Code that receives and tries to save the Buffer to a file (JS Node.js) :

    


    Server Receive

    


    socket.on("recording", (chunk) => {
    console_log("Audio chunk recieved. Transmitting to frontend...");
    socket.broadcast.emit('listening', chunk);

    fs.writeFileSync('out.webm', chunk.toString());
    if (counter > 3) {
      console.log("Trying ffmpeg...");

      ffmpegInstance
        .input('out.webm')
        .complexFilter([
          {
            filter: 'amix'
          }])
        .save('./Music/FFMPEGSTREAM.mp3');
    }

    counter++;
  });


    


    fluent-ffmpeg interface package is includued in the server code, but I have been using ffmpeg in the terminal (Pop OS) to debug. The goal is to save the file to a ram disk and use fluent ffmpeg to mix before sending to a different client for playback. Currently I am just trying to save it to disk and get ffmpeg command line to work on it.

    


    Update :
Problem was that the chunk I was analyzing didn't have the header info. MediaRecorder encodes, then slices it up, not slices it up into your specified time slot and encodes. I have not found a good solution to this. Saving the file, without toString I believe, results in a playable webm when the header is properly included.

    


  • How to save frame numbers with ffmpeg ?

    28 décembre 2018, par JulianJ

    I am using ffmpeg to scan video files for scene changes and save the results to a text file. The code I am using below works but I want to simplify the results and just output the frames number where the scene changes occur and the not all the data that this code produces. Any suggestions ?

    ffprobe -show_frames -of compact=p=0 -f lavfi "movie=input.mov,select=gt(scene\,.02)" > results.txt

    Outputs all this :

    media_type=video    stream_index=0  key_frame=1 pkt_pts=31031   pkt_pts_time=1.292958   pkt_dts=31031   pkt_dts_time=1.292958   best_effort_timestamp=31031 best_effort_timestamp_time=1.292958 pkt_duration=N/A    pkt_duration_time=N/A   pkt_pos=82320   pkt_size=629760 width=640   height=328  pix_fmt=rgb24   sample_aspect_ratio=1:1 pict_type=I coded_picture_number=0  display_picture_number=0    interlaced_frame=0  top_field_first=0   repeat_pict=0   tag:lavfi.scene_score=0.025551  
  • How to save frame numbers with ffmpeg ?

    14 mai 2016, par JulianJ

    I am using ffmpeg to scan video files for scene changes and save the results to a text file. The code I am using below works but I want to simplify the results and just output the frames number where the scene changes occur and the not all the data that this code produces. Any suggestions ?

    ffprobe -show_frames -of compact=p=0 -f lavfi "movie=input.mov,select=gt(scene\,.02)" > results.txt

    Outputs all this :

    media_type=video    stream_index=0  key_frame=1 pkt_pts=31031   pkt_pts_time=1.292958   pkt_dts=31031   pkt_dts_time=1.292958   best_effort_timestamp=31031 best_effort_timestamp_time=1.292958 pkt_duration=N/A    pkt_duration_time=N/A   pkt_pos=82320   pkt_size=629760 width=640   height=328  pix_fmt=rgb24   sample_aspect_ratio=1:1 pict_type=I coded_picture_number=0  display_picture_number=0    interlaced_frame=0  top_field_first=0   repeat_pict=0   tag:lavfi.scene_score=0.025551