Recherche avancée

Médias (91)

Autres articles (101)

  • 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

  • Use, discuss, criticize

    13 avril 2011, par

    Talk to people directly involved in MediaSPIP’s development, or to people around you who could use MediaSPIP to share, enhance or develop their creative projects.
    The bigger the community, the more MediaSPIP’s potential will be explored and the faster the software will evolve.
    A discussion list is available for all exchanges between users.

  • Les tâches Cron régulières de la ferme

    1er décembre 2010, par

    La gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
    Le super Cron (gestion_mutu_super_cron)
    Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)

Sur d’autres sites (7600)

  • NodeJS fluent-ffmpeg error : Output stream closed

    30 décembre 2020, par Japser36

    We are running a NodeJS server that does some audio processing. Specifically, we have audio data returned by google's text to speech API, which we have in the form of a Buffer.

    


    In our application, we have to send this audio data through FFMPEG to format it and extract audio duration. We do this by first converting it into a stream, piping it into ffmpeg, and then storing the data in an output buffer :

    


    const toWav = function (input: Buffer): Promise<buffer> {&#xA;    return new Promise((res, rej): void => {&#xA;        const bufs = [];&#xA;        const myReadable = new Readable();&#xA;        myReadable._read = (): void => {}; // we already have all data in memory, so no-op this function;&#xA;        myReadable.push(input); // stream all data in the buffer to the stream&#xA;        myReadable.push(null); // end the stream&#xA;        const output = ffmpeg(myReadable)&#xA;            .inputFormat(&#x27;mp3&#x27;)&#xA;            .toFormat(&#x27;wav&#x27;)&#xA;            .on(&#x27;start&#x27;, function (commandLine) {&#xA;                console.log(&#x27;SPAWNED ARG: &#x27; &#x2B; commandLine);&#xA;            })&#xA;            .on(&#x27;error&#x27;, (err: object): void => {&#xA;                console.error(&#x27;FFMPEG error on wav transform&#x27;);&#xA;                rej(err);&#xA;            })&#xA;            .on(&#x27;end&#x27;, (): void => {&#xA;                console.debug(&#x27;FFMPEG finished wav transform&#x27;);&#xA;                res(Buffer.concat(bufs));&#xA;            })&#xA;            .pipe();&#xA;        output.on(&#x27;data&#x27;, (d: object): void => {&#xA;            bufs.push(d);&#xA;        });&#xA;    });&#xA;};&#xA;</buffer>

    &#xA;

    This code is one of our functions that does the formatting, that our data gets passed through. Most of the time, this code works fine, but sometimes an error is thrown :error and stack trace

    &#xA;

    Looking up this error on google, I found an issue on the FFMPEG library we use, that seems to suggest that using an input and output stream just isn't recommended and doesn't work. Rather, one of the two needs to be a file resource.

    &#xA;

    Some more about this error, it seems to happen consistently when it does happen, but it doesn't happen consistently overall. For me, I got this error every time the code ran, I went and took lunch, and when I came back it was gone.

    &#xA;

    For us it is important that this error won't pop up randomly in production, so the question is, does anyone have any suggestions on how we can be the most certain this error won't happen ?

    &#xA;

    For completeness in how this function is being invoked to result in the error in the screenshot, the structure of the code where the error is caught is like so :

    &#xA;

    await Promise.all(&#xA;    myArray.map(async (item, idx) => {&#xA;        // ...&#xA;        const wavBuffer = await toWav(myBuffer); // toWav is invoked at this level&#xA;    })&#xA;)&#xA;.then(() => {/* ... */})&#xA;.catch((e) => {&#xA;    // ...&#xA;    logger.error(&#x27;[LOOP CRASH] Error at main promise:&#x27;, e);&#xA;    // ...&#xA;});&#xA;

    &#xA;

    Any help would be appreciated, thank you ! Please let me know if I can provide more details, though I cannot share a repo or full source code or anything since this is a private repo.

    &#xA;

  • Evolution #3771 : Ne plus mettre en cache la page 404

    27 avril 2016, par - Equipement

    Avec le squelette 404 de la dist (qui reste en cache), la trace des requêtes SQL sur le second appel (afin que la page soit prise dans le cache) sur le site public d’une page qui n’existe pas, donne les résultats suivants (sous SPIP 3.0.22) :

    "set sql_mode=’’" 
    "SELECT valeur FROM `nomdelabase`.spip_meta WHERE nom=’charset_sql_connexion’" 
    "SET NAMES ’utf8’" 
    "SHOW TABLES LIKE ’spip\\_%’" 
    "SHOW CREATE TABLE `spip_rubriques`" 
    "SHOW CREATE TABLE `spip_articles`" 
    "SHOW CREATE TABLE `spip_auteurs`" 
    "SHOW CREATE TABLE `spip_mots`" 
    "SHOW CREATE TABLE `spip_syndic`" 
    "SELECT * FROM `nomdelabase`.spip_meta WHERE nom=’pcre_u’" 
    

    suivi immédiatement les requêtes de la tâche de fond :

    "set sql_mode=’’" 
    "SELECT valeur FROM `nomdelabase`.spip_meta WHERE nom=’charset_sql_connexion’" 
    "SET NAMES ’utf8’" 
    "SELECT * FROM `nomdelabase`.spip_jobs WHERE status=1 AND date<=’2016-04-27 15:26:01’ ORDER BY priorite DESC,date LIMIT 0,201" 
    "DELETE FROM `nomdelabase`.spip_jobs
    "SHOW CREATE TABLE `spip_jobs`" 
    "INSERT INTO spip_jobs (id_job,descriptif,fonction,args,md5args,inclure,priorite,date,status) VALUES (320,’Tâche CRON syndic (toutes les 90s)’,’syndic’,’a:1 :i:0 ...
    "SELECT id_syndic FROM `nomdelabase`.spip_syndic WHERE ((syndication  IN (’sus’,’off’))) AND statut<>’refuse’ AND NOT((date_syndic>DATE_SUB(’2016-04-27 15:26:01’, INTERVAL 1440 MINUTE))) ORDER BY date_syndic LIMIT 1" 
    "SELECT id_syndic FROM `nomdelabase`.spip_syndic WHERE syndication=’oui’ AND statut<>’refuse’ AND NOT((date_syndic>DATE_SUB(’2016-04-27 15:26:01’, INTERVAL 120 MINUTE))) ORDER BY date_syndic LIMIT 1" 
    "SELECT id_job FROM `nomdelabase`.spip_jobs WHERE status=1 AND fonction=’syndic’" 
    "INSERT INTO spip_jobs (fonction,descriptif,args,md5args,inclure,priorite,date,status) VALUES (’syndic’,’Tâche CRON syndic (toutes les 90 s)’,’a:1 :i:0
    "SELECT id_job FROM `nomdelabase`.spip_jobs WHERE id_job<321 AND status=1 AND fonction=’syndic’" 
    "SELECT * FROM `nomdelabase`.spip_jobs WHERE status=0 AND date<’2016-04-27 15:23:01’" 
    "SELECT date FROM `nomdelabase`.spip_jobs WHERE status=1 ORDER BY date LIMIT 0,1" 
    "SELECT COUNT(*) FROM `nomdelabase`.spip_jobs WHERE status=1 AND date<’2016-04-27 15:26:01’" 
    "DELETE FROM `nomdelabase`.spip_jobs_liens WHERE id_job=320" 
    "DELETE FROM `nomdelabase`.spip_jobs
    

    Visiblement, si la page 404 reste dans le cache, il y a quand même une connexion à Mysql (suivie d’une seconde pour la tâche de fond).

  • array_merge() : Argument #2 is not an array after adding class into providers

    19 juin 2019, par Daman Mokha

    I am using pbmedia/laravel-ffmpeg as soon as I installed and added the providers and alias, it shows me the following error. This code was simply working on another machine

    array_merge(): Argument #2 is not an array

    I have tried the following things

    1. Composer update/ and Fresh install
    2. Cleaning the bootstrap/cache/
    3. Checked the config file for laravel-ffmpeg it’s there and fine
    4. Publish the config file using the artisan CLI tool : php artisan vendor:publish —provider="Pbmedia\LaravelFFMpeg\FFMpegServiceProvider"

    Here is the portion from laravel.log when I tried to run.

    [2019-06-19 00:34:40] local.ERROR: ErrorException: array_merge(): Argument #2 is not an array in /Users/damanmokha/edetyv2/vendor/laravel/framework/src/Illuminate/Support/ServiceProvider.php:59
    Stack trace:
    #0 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'array_merge(): ...', '/Users/damanmok...', 59, Array)
    #1 /Users/damanmokha/edetyv2/vendor/laravel/framework/src/Illuminate/Support/ServiceProvider.php(59): array_merge(Array, 1)
    #2 /Users/damanmokha/edetyv2/vendor/pbmedia/laravel-ffmpeg/src/FFMpegServiceProvider.php(25): Illuminate\Support\ServiceProvider->mergeConfigFrom('/Users/damanmok...', 'laravel-ffmpeg')
    #3 /Users/damanmokha/edetyv2/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(565): Pbmedia\LaravelFFMpeg\FFMpegServiceProvider->register()
    #4 /Users/damanmokha/edetyv2/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php(74): Illuminate\Foundation\Application->register(Object(Pbmedia\LaravelFFMpeg\FFMpegServiceProvider))
    #5 /Users/damanmokha/edetyv2/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(540): Illuminate\Foundation\ProviderRepository->load(Array)
    #6 /Users/damanmokha/edetyv2/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/RegisterProviders.php(17): Illuminate\Foundation\Application->registerConfiguredProviders()
    #7 /Users/damanmokha/edetyv2/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(203): Illuminate\Foundation\Bootstrap\RegisterProviders->bootstrap(Object(Illuminate\Foundation\Application))
    #8 /Users/damanmokha/edetyv2/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(267): Illuminate\Foundation\Application->bootstrapWith(Array)
    #9 /Users/damanmokha/edetyv2/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(113): Illuminate\Foundation\Console\Kernel->bootstrap()
    #10 /Users/damanmokha/edetyv2/artisan(35): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
    #11 {main}

    if I don’t add these providers it works fine, but then I am not able to use ffmpeg without that.

    • Laravel Version 5.3
    • pbmedia/laravel-ffmpeg 1.3
    • php version : 7.1