Recherche avancée

Médias (0)

Mot : - Tags -/objet éditorial

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

Autres articles (67)

  • Organiser par catégorie

    17 mai 2013, par

    Dans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
    Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
    Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...)

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

  • Le plugin : Podcasts.

    14 juillet 2010, par

    Le problème du podcasting est à nouveau un problème révélateur de la normalisation des transports de données sur Internet.
    Deux formats intéressants existent : Celui développé par Apple, très axé sur l’utilisation d’iTunes dont la SPEC est ici ; Le format "Media RSS Module" qui est plus "libre" notamment soutenu par Yahoo et le logiciel Miro ;
    Types de fichiers supportés dans les flux
    Le format d’Apple n’autorise que les formats suivants dans ses flux : .mp3 audio/mpeg .m4a audio/x-m4a .mp4 (...)

Sur d’autres sites (2984)

  • Run PHP exec() asynchronously, but check for completion ?

    1er septembre 2015, par PeregrineStudios

    I’m coding up a website back-end that will include user-uploaded video. In order to ensure maximum accessibility, I’m compressing the uploaded videos and re-saving them as .mp4 and .webm format to cover all browsers (or as many as possible anyway). To do this, I’m running an avconv command in the PHP exec() function.

    I don’t want to make the user wait for the script to finish before the page loads, so I’m running the code asynchronously. My code so far is below.

    exec('bash -c "exec nohup setsid avconv -i ' . $tempPath . ' -c:v libx264 ' . $transpose . ' ' . $newPath . 'mp4 > /dev/null 2>/dev/null &"');
    exec('bash -c "exec nohup setsid avconv -i ' . $tempPath . ' -c:v libvpx ' . $transpose . ' ' . $newPath . 'webm > /dev/null 2>/dev/null &"');

    In addition to running the exec functions, I also save the video to a database and send the user an email thanking them for uploading their video.

    Here’s the rub : I want the server to WAIT until the video conversion is finished, and THEN add it to the database and send the user an email. Basically, the program flow would be :

    User uploads video.
    Video is placed in a temp folder.
    User is taken to a thank you page indicating their video will be up shortly.
    The server executes two avconv commands to convert and compress the video for web use.
    Once BOTH conversions are finished, the video info is added to a MySQL database, an email is sent to the user, and the original uploaded video is deleted.

    It may just be my ignorance of the command line (in fact it almost definitely is), but how could I ’queue up’ these commands ? First do both conversions, then call a PHP script to add to the database, then delete the original video, all while being asynchronous with the original PHP script ?

    EDIT : I’ve tried queuing them up with an ’&&’ operator, like below :

    exec('bash -c "exec nohup setsid avconv -i ' . $tempPath . ' -c:v libx264 ' . $transpose . ' ' . $newPath . 'mp4 && avconv -i ' . $tempPath . ' -c:v libvpx ' . $transpose . ' ' . $newPath . 'webm > /dev/null 2>/dev/null &"');

    However, that seems to cancel out the fact that I’m running it asynchronously, since the page now seems to wait for the command to finish.

  • Révision 24489 : [Salvatore] [source : ecrire] Export depuis https://trad.spip.net de la langue de

    4 février 2020, par salvatore@rezo.net

    Credits : klaus++ <>

  • Révision 22875 : Déplantage de la balise #RANG quand on a déclaré autre chose qu’un simple champ p...

    4 mars 2016, par rastapopoulos@spip.org

    On garde exactement le même fonctionnement qu’avant avec un "AS titre_rang" rajouté. Mais on fait deux tests au lieu d’un seul :
    - d’abord on cherche le titre en se disant que "lang" est défini AVANT
    - et si on ne trouve pas, là on prend depuis le début
    Mais dans les deux cas, vu que c’est séparé en deux, et qu’on cherche "lang" explicitement et pas une virgule toute seule : on peut donc prendre tout caractère pour le titre, y compris les virgules qu’il y aurait dans des fonctions.

    Cela gère donc bien tous les cas, enfin de toute façon plus de cas qu’avant.