Recherche avancée

Médias (91)

Autres articles (93)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

  • Les formats acceptés

    28 janvier 2010, par

    Les commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
    ffmpeg -codecs ffmpeg -formats
    Les format videos acceptés en entrée
    Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
    Les formats vidéos de sortie possibles
    Dans un premier temps on (...)

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

Sur d’autres sites (10994)

  • Saving Video From URL as MP3 in Firebase Storage

    4 janvier 2024, par Christopher Frydryck

    I am working on a problem I have been stumped on the past couple days. I am using Node.js with Express (v4.18.2) to eventually create a Firebase deployment that can take in a video URL and output an audio mp3 to the Firebase Firestore. I have made some progress, but am still unsuccessful in some areas.

    


    I cannot save the file locally using fs, but for this example I have shown that it works with FS. I am successfully saving a local .mp3 file.

    


    First a few functions I have :

    


    async function downloadVideo(videoUrl) {
    try {
      const response = await axios.get(videoUrl, {
        responseType: 'stream',
      });
  
      if (response.status === 200) {
        return response.data;
      } else {
        throw new Error('Failed to fetch the video');
      }
    } catch (error) {
      throw new Error('Error fetching the video: ' + error.message);
    }
  }


    


    async function extractAudioFromVideo(videoUrl) {
    try {
      const videoStream = await downloadVideo(videoUrl);
  
      // Create a PassThrough stream to pipe the video data
      const passThrough = new PassThrough();
      videoStream.pipe(passThrough);

      const outputFile = 'output.mp3';
      const outputStream = fs.createWriteStream(outputFile);
  
        return new Promise((resolve, reject) => {
            const audioBuffers = [];

            passThrough.on('data', chunk => {
                audioBuffers.push(chunk)
                outputStream.write(chunk); // Write chunks to a local file
              });
        
              passThrough.on('error', err => {
                reject(err);
              });
        

            ffmpeg()
            .input(passThrough)
            .output('/dev/null') // Null output as a placeholder
            .outputOptions('-vn') // Extract audio only
            .noVideo()
            .audioQuality(0)
            .audioCodec('libmp3lame') // Set audio codec
            .format('mp3')
            .on('end', () => {
                const audioBuffer = Buffer.concat(audioBuffers)
                if (audioBuffer.length > 0) {
                    resolve(audioBuffer);
                  } else {
                    reject(new Error('Empty audio buffer'));
                  }
              })
            .on('error', err => reject(err))
            .run();
        })
    } catch (error) {
      throw new Error('Error extracting audio: ' + error.message);
    }
  }


    


     async function saveAudioToFirebase(audioBuffer, fileName) {
    try {
        let storage = admin.storage()
    let storageRef = storage.bucket(serviceAccount.storage_bucket_content)
      const file = storageRef.file(fileName) // Specify the desired file name here

      const renamedFileName = fileName.replace(/\.[^/.]+$/, '.mp3'); // Change the file extension to .mp3
  
      await file.save(audioBuffer, {
        metadata: {
          contentType: 'audio/mpeg', // Adjust the content type as needed
        },
      });

      await file.setMetadata({
        contentType: 'audio/mpeg'
      })

      await file.move(renamedFileName); // Rename the file with the .mp3 extension
  
      console.log('Audio saved to Firebase Storage.');
    } catch (error) {
      console.error('Error saving audio to Firebase Storage:', error);
    }
  }



    


    What works :

    


      

    • Downloading the video via Axios
    • 


    • Saving to Firebase storage (no intializing or pointer issues to Firebase)
    • 


    • Outputting a local .mp3 file called "output.mp3"
    • 


    • I am able to log the result of extractAudioFromVideo and get a buffer logged in my terminal
    • 


    


    What doesn't work :

    


      

    • Saving a file to Firebase Storage that is an .mp3. It says ".mp3" in the url and it has a content type of 'audio/mpeg' but it is in fact an .mp4. Still has video and plays video in the browser window.
    • 


    


    I am willing to use other libraries like tmp if suggested and the solution works.

    


  • Unable to play video from firebase cloud storage download url on Iphone Safari [closed]

    26 janvier 2024, par Acid Coder
                        getDownloadURL(ref)
                        .then(url => {
                            //... save the url to state
                        })


    


    front end : React

    


                                &#xA;                                <source src="{videoURL}" type="video/mp4"></source>&#xA;                            &#xA;

    &#xA;

    work fine on PC and Android, but on Iphone Safari, only 1 out of 10 videos can be played

    &#xA;

    enter image description here

    &#xA;

    all video are from the same source, going through same compression, from mp4 to mp4

    &#xA;

    import ffmpeg from &#x27;fluent-ffmpeg&#x27;&#xA;&#xA;        ffmpeg(inputPath)&#xA;            .output(outputPath)&#xA;            .videoCodec(&#x27;libx264&#x27;)&#xA;            .audioCodec(&#x27;aac&#x27;)&#xA;            .on(&#x27;end&#x27;, () => {&#xA;                // ...&#xA;            })&#xA;            .on(&#x27;error&#x27;, err => {&#xA;                // ...&#xA;            })&#xA;            .run()&#xA;

    &#xA;

  • aarch64 : Manually tweak vertical alignment/indentation in tx_float_neon.S

    17 octobre 2023, par Martin Storsjö
    aarch64 : Manually tweak vertical alignment/indentation in tx_float_neon.S
    

    Favour left aligned columns over right aligned columns.

    In principle either style should be ok, but some of the cases
    easily lead to incorrect indentation in the surrounding code (see
    a couple of cases fixed up in the preceding patch), and show up in
    automatic indentation correction attempts.

    Signed-off-by : Martin Storsjö <martin@martin.st>

    • [DH] libavutil/aarch64/tx_float_neon.S