Recherche avancée

Médias (1)

Mot : - Tags -/censure

Autres articles (75)

  • Script d’installation automatique de MediaSPIP

    25 avril 2011, par

    Afin de palier aux difficultés d’installation dues principalement aux dépendances logicielles coté serveur, un script d’installation "tout en un" en bash a été créé afin de faciliter cette étape sur un serveur doté d’une distribution Linux compatible.
    Vous devez bénéficier d’un accès SSH à votre serveur et d’un compte "root" afin de l’utiliser, ce qui permettra d’installer les dépendances. Contactez votre hébergeur si vous ne disposez pas de cela.
    La documentation de l’utilisation du script d’installation (...)

  • Automated installation script of MediaSPIP

    25 avril 2011, par

    To overcome the difficulties mainly due to the installation of server side software dependencies, an "all-in-one" installation script written in bash was created to facilitate this step on a server with a compatible Linux distribution.
    You must have access to your server via SSH and a root account to use it, which will install the dependencies. Contact your provider if you do not have that.
    The documentation of the use of this installation script is available here.
    The code of this (...)

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

Sur d’autres sites (3652)

  • ffmpeg video thumbnail image not uploading in codeigniter

    15 mars 2015, par user3785746

    I am trying to upload a video in codeigniter and i also want to upload thumbnail image of this video using ffmpeg. it works fine in core php but the code is not working in codeigniter. Here is my code

    public function of_file_upload()
               {


                       $un = $_POST['un'];
                       $other_un = $_POST['other_un'];
                       $up_folder = "chat_file";
                       $uploded_files = array();
                       $base_path = base_url() . "uploads/" . $up_folder . "/";
                       $i = 0;
                       #######################################
                       if (!empty($_FILES)) {

                           foreach ($_FILES as $k => $arr) {
                               $temp = explode('.', $arr['name']);
                               $extention = end($temp);
                               $r_char = $this->get_random_string(6);
                               $unArr = explode("@", $un);
                               $un = $unArr[0];
                               $file_name = $un . '_' . $r_char . '_' . time() . '.' .  $extention;
                               $path = $_SERVER['DOCUMENT_ROOT'] . '/api/uploads/' . $up_folder  . '/';
                               $file_path = $path . $file_name;
                               try {

                                   if (move_uploaded_file($arr["tmp_name"], $file_path)) {
                                       $uploded_files[$i]["fn"] = $base_path . $file_name;
                                       $uploded_files[$i]["id"] = $k;
                                       if($extention != 'jpg' && $extention != 'png' && $extention != 'jpeg' && $extention != 'gif' && $extention != 'bmp')
                                       {  
                                           $ffmpeg = "C:\\ffmpeg\\bin\\ffmpeg";
                                           $videoFile = $arr["tmp_name"];
                                           /*$imageFile = $path.$un . '_' . $r_char . '_' . time() . '.jpg' ;*/
                                           $imageFile = $_SERVER['DOCUMENT_ROOT'] . 'api/uploads/'.$un . '_' . $r_char . '_' . time() . '.jpg' ;
                                           //echo $imageFile;die;
                                           $size = "120x90";
                                           $getfromsecond = 5;
                                           $cmd = "$ffmpeg -i $videoFile -an -ss $getfromsecond   -s $size $imageFile";
                                           shell_exec($cmd);
                                       }
                                   } else {
                                       $this->_sendResponse(13);
                                   }
                               } catch (Exception $e) {
                                   print_r($e->getMessage());
                               }
                               $i++;
                           }
                       }
               }

    I have put the ffmpeg folder in c drive and is there any other place where I have to place this folder in codeigniter case. Here is my core php code which works fine.

                   
                   
                     
                   <form method="post" action="index1.php" enctype="multipart/form-data">
                   <input type="file" />
                   <input type="submit" value="submit" />
                   </form>
                   
                   &lt;?php
                        if(isset($_POST['submit']))
                         {
                           $ffmpeg = "C:\\ffmpeg\\bin\\ffmpeg";
                           $videoFile = $_FILES['video']['tmp_name'];
                           foreach($_FILES as $key =>$value)
                            {
                               $param = $value['name'];
                            }
                           $tmp = explode('.',$param);
                           $imgname = $tmp[0];
                           $folder = 'upload';
                           if(!file_exists($folder))
                           {
                               mkdir($folder);
                           }
                           $imageFile = $folder."/".$imgname.".jpg";
                           $size = "120x90";
                           $getfromsecond = 5;
                           $cmd = "$ffmpeg -i $videoFile -an -ss $getfromsecond -s $size                        $imageFile";
                           if(!shell_exec($cmd))
                            {
                                echo "success";
                            }
                           else
                           {
                               echo "failed";
                           }
                  }
                   ?>
                     
                   

    I have tried many things but no luck please help thanks in advance.

  • node-fluent-ffmpeg doesn't resize videos correctly when given specific size

    8 décembre 2019, par Yagiz

    Version information

    • fluent-ffmpeg version : 2.1.2
    • ffmpeg version : ffmpeg version 4.1.3
    • OS : mac os x mojave 10.14.3

    Code to reproduce

    First cut the videos using this command :

    const cutVideo = async (currentWord) => {
       return new Promise((resolve, reject) => {
           console.log('cutting video', currentWord.file)
           ffmpeg(currentWord.file)
               .videoCodec('libx264')
               // .addOptions('-vf "setdar=ratio=16/9:max=1000"')
               .on('start', command => console.log('command', command))
               .on('error', reject)
               .on('end', resolve)
               .withSize('640x360')
               .withAspect('16:9')
               .applyAutopadding(true, 'black')
               .saveToFile(currentWord.file.replace('-unfinished', ''), './')
       })
    }

    Later merge them together using .mergeToFile() command :

    const mergeFilesAsync = async function(files, folder, filename)
    {
       return new Promise((resolve, reject) => {
           console.log('merging files', files)
           var cmd = ffmpeg({ logger: console })
               .videoCodec('libx264')
               .on('start', command => console.log('command', command))
               .on('error', reject)
               .on('end', resolve)

           for (var i = 0; i &lt; files.length; i++)
           {
               const currentWord = files[i]
               cmd.input(currentWord.file.replace('-unfinished', ''))
           }

           cmd.mergeToFile(folder + "/" + filename, folder);
       });
    }

    Expected results

    The videos resized in cutVideo function should have 640x360 size with 16:9 aspect ratio.

    Observed results

    The first video processed had a dimension of : 850 × 480, the output after processing it is : 642 × 360 (It should be 640x360)

    The second video processed had a dimension of : 1152 × 480, the output after processing it is : 638 × 360

    The third video processed had a dimension of 853 × 480, the output after processing it is : 642 × 360

    FFmpeg command produced by fluent-ffmpeg :

    ffmpeg -i /Users/yagiz/Desktop/video-creator/what's-unfinished.mp4 -y -vcodec libx264 -filter:v scale=w='if(gt(a,1.7777777777777777),640,trunc(360*a/2)*2)':h='if(lt(a,1.7777777777777777),360,trunc(640/a/2)*2)',pad=w=640:h=360:x='if(gt(a,1.7777777777777777),0,(640-iw)/2)':y='if(lt(a,1.7777777777777777),0,(360-ih)/2)':color=black /Users/yagiz/Desktop/video-creator/what's.mp4
    cutting video /Users/yagiz/Desktop/video-creator/up?-unfinished.mp4

    and

    ffmpeg -i /Users/yagiz/Desktop/video-creator/up?-unfinished.mp4 -y -vcodec libx264 -filter:v scale=w='if(gt(a,1.7777777777777777),640,trunc(360*a/2)*2)':h='if(lt(a,1.7777777777777777),360,trunc(640/a/2)*2)',pad=w=640:h=360:x='if(gt(a,1.7777777777777777),0,(640-iw)/2)':y='if(lt(a,1.7777777777777777),0,(360-ih)/2)':color=black /Users/yagiz/Desktop/video-creator/up?.mp4

    I think that 1.77777 value in this command produces a lower bound or an upper bound of the actual item.

    Any idea where the issue lies ?

    Thanks !

  • Révision 18232 : Résoud #2168 : le rafraichissement du #chemin n’etait pas explicitement demandé ...

    17 juillet 2011, par cedric -

    + le conteneur #chemin n’etait pas défini dans body.html mais dans chaque inclure hierarchie, ce qui generait une redite plus une dissymétrie par rapport aux autres blocs, empechant le fonctionnement du rafraichissement auto par la fonction js reloadExec() + un fichier _fonctions.php pour la (...)