Recherche avancée

Médias (0)

Mot : - Tags -/optimisation

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

Autres articles (56)

  • Récupération d’informations sur le site maître à l’installation d’une instance

    26 novembre 2010, par

    Utilité
    Sur le site principal, une instance de mutualisation est définie par plusieurs choses : Les données dans la table spip_mutus ; Son logo ; Son auteur principal (id_admin dans la table spip_mutus correspondant à un id_auteur de la table spip_auteurs)qui sera le seul à pouvoir créer définitivement l’instance de mutualisation ;
    Il peut donc être tout à fait judicieux de vouloir récupérer certaines de ces informations afin de compléter l’installation d’une instance pour, par exemple : récupérer le (...)

  • Soumettre améliorations et plugins supplémentaires

    10 avril 2011

    Si vous avez développé une nouvelle extension permettant d’ajouter une ou plusieurs fonctionnalités utiles à MediaSPIP, faites le nous savoir et son intégration dans la distribution officielle sera envisagée.
    Vous pouvez utiliser la liste de discussion de développement afin de le faire savoir ou demander de l’aide quant à la réalisation de ce plugin. MediaSPIP étant basé sur SPIP, il est également possible d’utiliser le liste de discussion SPIP-zone de SPIP pour (...)

  • Support de tous types de médias

    10 avril 2011

    Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)

Sur d’autres sites (5354)

  • scripting massive number of files with ffmpeg [closed]

    2 décembre 2020, par 8Liter

    Alright, I've got over 5000 MP4 files in a single directory that I would ultimately like to process using ffmpeg. I've got a few different solutions that all work by themselves, but put together do not make my job any easier.
The current file list looks like this, in one single directory :

    


      

    • 10-1.mp4
    • 


    • 10-2.mp4
    • 


    • 10123-1.mp4
    • 


    • 10123-2.mp4
    • 


    • 10123-3.mp4
    • 


    • 10123-4.mp4
    • 


    • 10123-5.mp4
    • 


    • 10123-6.mp4
    • 


    • 102-1.mp4
    • 


    • 103-1.mp4
    • 


    • 103-2.mp4
    • 


    • 103-3.mp4
    • 


    • 107-1.mp4
    • 


    • 107-2.mp4
    • 


    • 107-3.mp4
    • 


    • 107-4.mp4
    • 


    • 107-5.mp4
    • 


    • 107-6.mp4
    • 


    • 11-1.mp4
    • 


    • 11-2.mp4
    • 


    


    The ideal process I would like is the following :

    


    A. Take however many files in the directory have a particular prefix, for example the two "11" files at the bottom, and concatenate them into a single MP4 file. The end result is a single "11.MP4"

    


    B. Delete the original two "11-1.mp4" and "11-2.mp4", keeping only the new "11.mp4" complete file.

    


    C. Repeat steps A-B for all other files in this directory

    


    This is not apparently possible right now from what I can glean from other threads, but I've tested a more manual approach which is not clean OR fast, and this is what my workflow looks like in real life...

    


      

    1. move files with same prefix into new folder (I have a working bat file that will do this for me)
    2. 


    3. run a ffmpeg bat file to process an "output.mp4" file (I have a working bat file that will do this for me)
    4. 


    5. delete the original files
    6. 


    7. rename the output.mp4 file to the prefix name (i.e. 11.mp4)
    8. 


    9. copy that file back into the new directory
    10. 


    11. repeat steps 1-5 a thousand times.
    12. 


    


    I've also looked into creating all new directories BASED on the filename (I have a working bat file that will do this for me) and then copy my ffmpeg bat file into each directory, and run each bat file manually... but again it's a ton of work.

    


    (FROM STEP 1 ABOVE)

    


    @echo off
setlocal

set "basename=."
for /F "tokens=1* delims=.*" %%a in ('dir /B /A-D ^| sort /R') do (
   set "filename=%%a"
   setlocal EnableDelayedExpansion
   for /F "delims=" %%c in ("!basename!") do if "!filename:%%c=!" equ "!filename!" (
      set "basename=!filename!"
      md "!basename!"
   )
   move "!filename!.%%b" "!basename!"
   for /F "delims=" %%c in ("!basename!") do (
      endlocal
      set "basename=%%c

   )
)


    


    (FROM STEP 2 ABOVE)

    


    :: Create File List
del "F:\videos\*.txt" /s /f /q
for %%i in (*.mp4) do echo file '%%i'>> mylist.txt

:: Concatenate Files
ffmpeg.exe -f concat -safe 0 -i mylist.txt -c copy output.mp4


    


    Any ideas how I can approach this ? I'm open to powershell, batch, even python if I need to.

    


  • FFMpeg-Normalize Doesn't Exist After Install

    26 octobre 2019, par 123hierarchy

    I’m cloning this repo. I installed ffmpeg-normalize and pip install ffmpeg-normalize returns

    Requirement Already Satisfied...

    And yet I’m getting an error that ffmpeg-normalize doesn’t exist when executing the preprocess.py step :

    enter image description here

    The offending code :

    def preprocess(audio_filename, output_filename):
       ext_ind = audio_filename.rfind('.wav')
       audio_filename_formatted = audio_filename[:ext_ind] + '-formatted.wav'
       try:
           os.remove(audio_filename_formatted)
       except OSError:
           pass
       try:
           os.remove(output_filename)
       except OSError:
           pass
       error = os.system(
           'ffmpeg -i {} -acodec pcm_s16le -ac 1 -ar 16000 {}'.format(
               audio_filename, audio_filename_formatted))
       if error:
           print error
           raise StandardError('ffmpeg or audio file doesn\'t exist')
       error = os.system(
           'ffmpeg-normalize -f {}'.format(audio_filename_formatted))
       if error:
           raise StandardError('ffmpeg-normalize doesn\'t exist')

       data = wavfile.read(audio_filename_formatted)
       mfcc_inst = MFCC()
       features = mfcc_inst.sig2s2mfc_energy(data[1])

       np.save(output_filename, features)


    if __name__ == '__main__':
       if len(sys.argv) < 3:
           sys.exit(
               "Have to pass audio_filename and output_filename as parameters.")
       print sys.argv[1],sys.argv[2]
       preprocess(sys.argv[1], sys.argv[2])

    Is there another step after installing it that’s needed ? Is this an issue with running it on a Mac ? I’m completely lost here. Thank you in advance.

  • Can't upload huge video to google storage. I using "@ffmpeg-installer/ffmpeg" and @google-cloud/storage

    20 juillet 2022, par Dmytro Petskovych

    I upload file to google storage using "@ffmpeg-installer/ffmpeg" and @google-cloud/storage in my node.js App.
Step 1. file uploading to fs is in child processes - one process for each type of resolution (totaly six).
step 2. encription (converting to stream)
step 3. upload to google storage

    


    I use "Upload a directory to a bucket" in order to send the video from the client to the Google Cloud Storage bucket.

    


    This way is working fine only with small file.

    


    when I upload video, actually I upload six videos, one for each type resolution

    


    for example when I upload video with duration one hour it split on chunk and totally I get more three thousands files.

    


    So actually i upload folder with large amount of files, but not all of this files are uploaded to cloud.

    


    maybe someone had the similar problem and helps fix it.

    


    

    

    const uploadFolder = async (bucketName, directoryPath, socketInstance) => {
    try {
      let dirCtr = 1;
      let itemCtr = 0;
      const fileList = [];

      const onComplete = async () => {
        const folderName = nanoid(46);

        await Promise.all(
          fileList.map(filePath => {
            const fileName = path.relative(directoryPath, filePath);
            const destination = `${ folderName }/${ fileName }`;

            return storage
              .bucket(bucketName)
              .upload(filePath, { destination })
              .then(
                uploadResp => ({ fileName: destination, status: uploadResp[0] }),
                err => ({ fileName: destination, response: err })
              );
          })
        );

        if (socketInstance) socketInstance.emit('uploadProgress', {
          message: `Added files to Google bucket`,
          last: false,
          part: false
        });

        return folderName;
      };

      const getFiles = async directory => {
        const items = await fs.readdir(directory);
        dirCtr--;
        itemCtr += items.length;
        for(const item of items) {
          const fullPath = path.join(directory, item);
          const stat = await fs.stat(fullPath);
          itemCtr--;
          if (stat.isFile()) {
            fileList.push(fullPath);
          } else if (stat.isDirectory()) {
            dirCtr++;
            await getFiles(fullPath);
          }
        }
      }

      await getFiles(directoryPath);

      return onComplete();
    } catch (e) {
      log.error(e.message);
      throw new Error('Can\'t store folder.');
    }
  };