Recherche avancée

Médias (91)

Autres articles (86)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 est la première version de MediaSPIP stable.
    Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

Sur d’autres sites (11194)

  • FFmpeg to convert "many" mp3 files to wav files

    21 janvier 2020, par ab123

    I wish to convert some hundred thousand small-duration(< 5 sec) mp3 files to wav files. But the process presently takes several days to complete. I would like to know if there is a faster way than what I am currently doing.

    Currently, I am just spawning threads and calling ffmpeg via subprocess module in Python. When I use subprocess.Popen() I quickly get memory errors because too many threads get started. Using subprocess.call() works error-free. Additionally, I am using threading.Semaphore() to limit maximum number of working threads.

    Code :

    import threading
    import subprocess

    maxthreads = 50
    sema = threading.Semaphore(value=maxthreads)
    threads = []

    def task(mp3_path):  # mp3 file path taken from the list of file_ids `mp3_list` below
       sema.acquire()
       subprocess.call(['ffmpeg', '-y',  '-i', mp3_path, '-preset', 'ultrafast', '-ar', '8000', wav_file_path])
       # provide file path and destination path
       sema.release()


    def conv_to_wav_():
       for i in mp3_list:
           thread = threading.Thread(target=task,args=([i]))
           threads.append(thread)
           thread.start()

    I am working on Windows 10 and have a CUDA-enabled Nvidia GPU available as well, if that’s helpful.

  • Pyinstaller "Failed to execute script pyi_rth_pkgres" and missing packages

    12 octobre 2023, par gurnben

    This is my first time posting a question here as most of my questions have already been answered by someone else ! I am working on a GUI application in python and am attempting to use pyinstaller to package it into a single folder and .exe for easier portability. Currently, I am using windows 10 and anaconda3 to manage my python packages. The application relies on tkinter, pillow, numpy, scikit-learn, opencv, ffmpeg, and matplotlib. The application is formatted with a main GUI.py file that creates objects of a number of other files (many of which are stored in a subfolder as this GUI is replacing a command line utility that served the same purpose). The issue I am running into (as you can see in the title) is that the .exe is throwing the error block :

    &#xA;&#xA;

    &#xA;

    Traceback (most recent call last) :&#xA; File "site-packages\PyInstaller\loader\rthooks\pyi_rth_pkgres.py", line 11, in &#xA; File "c :\users\gurnben\anaconda3\envs\opencv\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 389, in load_module&#xA; exec(bytecode, module.dict)&#xA; File "site-packages\setuptools-20.7.0-py3.5.egg\pkg_resources__init__.py", line 68, in &#xA; File "site-packages\setuptools-20.7.0-py3.5.egg\pkg_resources\extern__init__.py", line 60, in load_module&#xA; ImportError : The 'packaging' package is required ; normally this is bundled with this package so if you get this warning, consult the packager of your distribution.&#xA; Failed to execute script pyi_rth_pkgres

    &#xA;

    &#xA;&#xA;

    When I look at the warn.txt it gives a massive list of missing packages including parts of some packages that are actually in the single folder package.
    &#xA;I have, however, successfully gotten it to recognize the dll files from opencv and it is not listed among the missing (nor is ffmpeg however I did not see any ffmpeg files in the folder). I had to pass in a custom path to get it to include the opencv files as they are not in anaconda at this time.

    &#xA;&#xA;

    Any hints or ideas for next troubleshooting steps ? I am overly greatful for all of the help you an offer and I can upload any code, files, etc. that would help you diagnose the issue. In the meantime I will continue searching for a solution myself !

    &#xA;

  • avformat_open_input for 24-bit audio fails intermittently with avfoundation due to "audio format is not supported"

    27 septembre 2019, par NaderNader

    My application uses the ffmpeg APIs (avformat, avdevice, etc) to open a selected audio input for encoding. For audio inputs configured for 24-bit I can reliably open them the first time, but when I close and reopen that input later, the avformat_open_input() call fails due to "audio format is not supported". My testing shows that it never fails the first time after starting my, and has only about a 50% chance of success when reopening.

    The failure only occurs when I configure my "Built-in Microphone" audio input for 24-bit integer. 16-bit integer and 32-bit float work reliably. Changing the number of channels and sample rate has no effect.

    I have read the documentation and see that the proper way to free the resources after opening is to call avformat_close_input. The only way I have found to guarantee success is to only open the input once.

    I have written a test program to recreate these failures.

    int main() {

       avdevice_register_all();

       cout &lt;&lt; "Running open audio test" &lt;&lt; endl;


       int i;
       for(i = 0; i&lt; 10; i++) {

           AVDictionary* options = NULL;
           AVInputFormat* inputFormat = av_find_input_format("avfoundation");
           if (!inputFormat) {
               cout &lt;&lt; "avfoundation inputFormat=null" &lt;&lt; endl;
           }

           AVFormatContext* formatContext = avformat_alloc_context();
           int result = avformat_open_input(&amp;formatContext, ":1", inputFormat, &amp;options);
           if (result &lt; 0) {
               char error[256];
               av_strerror(result, error, sizeof(error));
               cout &lt;&lt; "result=" &lt;&lt; result &lt;&lt; " " &lt;&lt; error &lt;&lt; endl;
           } else {
               cout &lt;&lt; "input opened successfully" &lt;&lt; endl;
           }

           sleep(1);

           avformat_close_input(&amp;formatContext);

           sleep(1);

       }

       return 0;
    }

    I would expect the main loop to succeed each time but a typical output shows a high failure rate :

    Running open audio test

    input opened successfully
    [avfoundation @ 0x7fdeb281de00] audio format is not supported
    result=-5 Input/output error
    [avfoundation @ 0x7fdeb2001400] audio format is not supported
    result=-5 Input/output error
    [avfoundation @ 0x7fdeb2001400] audio format is not supported
    result=-5 Input/output error
    input opened successfully
    input opened successfully
    input opened successfully
    [avfoundation @ 0x7fdeb2068800] audio format is not supported
    result=-5 Input/output error
    input opened successfully
    input opened successfully

    I have tried increasing the sleep time between close and open to 5 seconds, but saw no difference in behavior. While this program runs, I can use the MacOS Audio MIDI Setup to change the microphone input configuration and watch the output change from all success to intermittent errors.

    The source of the failure is https://github.com/FFmpeg/FFmpeg/blob/master/libavdevice/avfoundation.m#L672

    It appears avfoundation.m internally is opening an input stream and grabbing an audio frame to determine the format, but the value returned is not valid sometimes, when the process has previously opened and closed that input.

    Am I not closing the resources properly ? Do I have a hardware issue specific to my macbook ?

    Additional Details :

    Tested MacBook Pro with MacOS Mojave 10.14.6
    Tested with Ffmpeg 3.4.1, 4.0, and 4.1

    list_devices :

    [AVFoundation input device @ 0x7f80fff066c0] AVFoundation video devices:
    [AVFoundation input device @ 0x7f80fff066c0] [0] FaceTime HD Camera
    [AVFoundation input device @ 0x7f80fff066c0] [1] Capture screen 0
    [AVFoundation input device @ 0x7f80fff066c0] AVFoundation audio devices:
    [AVFoundation input device @ 0x7f80fff066c0] [0] Behringer Duplex
    [AVFoundation input device @ 0x7f80fff066c0] [1] Built-in Microphone
    [AVFoundation input device @ 0x7f80fff066c0] [2] USB Audio CODEC