Recherche avancée

Médias (91)

Autres articles (63)

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

  • Configurer la prise en compte des langues

    15 novembre 2010, par

    Accéder à la configuration et ajouter des langues prises en compte
    Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
    De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
    Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)

  • XMP PHP

    13 mai 2011, par

    Dixit Wikipedia, XMP signifie :
    Extensible Metadata Platform ou XMP est un format de métadonnées basé sur XML utilisé dans les applications PDF, de photographie et de graphisme. Il a été lancé par Adobe Systems en avril 2001 en étant intégré à la version 5.0 d’Adobe Acrobat.
    Étant basé sur XML, il gère un ensemble de tags dynamiques pour l’utilisation dans le cadre du Web sémantique.
    XMP permet d’enregistrer sous forme d’un document XML des informations relatives à un fichier : titre, auteur, historique (...)

Sur d’autres sites (3630)

  • Concatenating two videos with ffmpeg

    9 mars 2019, par Lance

    I have a two videos. One that will be downloaded with youtube-dl and one that is made out of an image with ffmpeg and the loop function.

    public function createTimePic($id, $image_width, $image_height, $text) {
       $font_size = 20;
       $angle = 0;
       $font = 'public/fonts/arial.ttf';
       $im = imagecreatetruecolor($image_width, $image_height);
       $white = imagecolorallocate($im, 255, 255, 255);
       $grey = imagecolorallocate($im, 128, 128, 128);
       $black = imagecolorallocate($im, 0, 0, 0);
       imagefilledrectangle($im, 0, 0, $image_width, $image_height, $black);

       $text_box = imagettfbbox($font_size, $angle, $font, $text);
       $text_width = $text_box[2]-$text_box[0];
       $text_height = $text_box[7]-$text_box[1];
       $x = ($image_width/2) - ($text_width/2);
       $y = ($image_height/2) - ($text_height/2);

       imagettftext($im, $font_size, 0, $x, $y+1, $grey, $font, $text);
       imagettftext($im, $font_size, 0, $x, $y, $white, $font, $text);

       $file = $this->videoPath.'time_difference_'.$id.'.jpg';
       imagejpeg($im, $file);

       $video = 'time_difference_'.$id.'.mp4';
       if (!file_exists($this->videoPath.$video)) {
           $this->createVideoFromImg($file, $video);
       }

       return [
           'img' => $file,
           'video' => $video
       ];
    }

    public function createVideoFromImg($img, $video) {
       $command = './ffmpeg -loop 1 -i '.$img.' -t 5 -c:v libx264 -preset slow -crf 18 -c:a copy -pix_fmt yuv420p '.$this->videoPath.$video;
       exec($command, $output);
    }

    public function downloadYouTubeVideo($video_id, $audio_only = false) {
       $file_type = $audio_only ? 'mp3' : 'mp4';
       $file = $this->videoPath.$video_id.'.'.$file_type;

       if (!file_exists($file)) {
           $command = '/usr/local/bin/youtube-dl -o "'.$file.'" ';
           if ($audio_only) {
               $command .= '--extract-audio --audio-format '.$file_type.' ';
           }

           $command .= ' https://www.youtube.com/watch\?v\='.$video_id;
           exec($command, $output);

           $command = './ffmpeg -i '.$file.' -c:v libx264 -preset slow -crf 18 -c:a copy -pix_fmt yuv420p '.str_replace('.mp4', '', $file).'_encoded.mp4';
       }

       return $file;
    }

    $command = './ffmpeg -f concat -safe 0 -i list.txt -c copy '.$this->videoPath.$id.'_new1.mp4';
    exec($command, $output);

    Inside of my list.txt file are the paths to the two videos, one that was created from a jpeg and one that was downloaded from youtube. Running the command at the bottom creates a new video. It’s just that the it’s the same exact thing as the youtube video. The other image never gets added. Could this have to do with the encoding ?

  • How to create a circular countdown indicator overlayed into a video with ffmpeg ?

    18 novembre 2020, par Ben Holness

    I have a script that creates a video from multiple sources. At the start of the video there is a 5 second long pause where some information is displayed.

    


    I want to give a visual indicator of how long it is until the main video starts, with a circle in the top left corner. The circle would start completely transparent and slowly fill in grey round the circle as the video progresses. At 25% of the video, the top right quarter of the circle would be gray. At 50% the right half of the circle would be gray and so on.

    


    I am imagining something similar to this solution which is a progress bar, but I'm not sure if it's possible/how to make it a circular one.

    


  • Can I create a circular countdown indicator overlayed into a video with ffmpeg ?

    9 novembre 2020, par Ben Holness

    I have a script that creates a video from multiple sources. At the start of the video there is a 5 second long pause where some information is displayed.

    


    I want to give a visual indicator of how long it is until the main video starts, with a circle in the top left corner. The circle would start completely transparent and slowly fill in grey round the circle as the video progresses. At 25% of the video, the top right quarter of the circle would be gray. At 50% the right half of the circle would be gray and so on.

    


    I am imagining something similar to this solution which is a progress bar, but I'm not sure if it's possible/how to make it a circular one.

    


    Thanks !