Recherche avancée

Médias (0)

Mot : - Tags -/interaction

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

Autres articles (11)

  • Contribute to a better visual interface

    13 avril 2011

    MediaSPIP is based on a system of themes and templates. Templates define the placement of information on the page, and can be adapted to a wide range of uses. Themes define the overall graphic appearance of the site.
    Anyone can submit a new graphic theme or template and make it available to the MediaSPIP community.

  • Ajouter des informations spécifiques aux utilisateurs et autres modifications de comportement liées aux auteurs

    12 avril 2011, par

    La manière la plus simple d’ajouter des informations aux auteurs est d’installer le plugin Inscription3. Il permet également de modifier certains comportements liés aux utilisateurs (référez-vous à sa documentation pour plus d’informations).
    Il est également possible d’ajouter des champs aux auteurs en installant les plugins champs extras 2 et Interface pour champs extras.

  • Qu’est ce qu’un éditorial

    21 juin 2013, par

    Ecrivez votre de point de vue dans un article. Celui-ci sera rangé dans une rubrique prévue à cet effet.
    Un éditorial est un article de type texte uniquement. Il a pour objectif de ranger les points de vue dans une rubrique dédiée. Un seul éditorial est placé à la une en page d’accueil. Pour consulter les précédents, consultez la rubrique dédiée.
    Vous pouvez personnaliser le formulaire de création d’un éditorial.
    Formulaire de création d’un éditorial Dans le cas d’un document de type éditorial, les (...)

Sur d’autres sites (4352)

  • Pipe output of ffmpeg using nodejs stdout

    21 mai 2014, par rughimire

    I am not being able to pipe the output of the ffmpeg over a stdout.

    Following are the block of code what I coded so far.

       var http = require('http')
       , fs = require('fs')
       var child_process = require("child_process")

       http.createServer(function (req, res) {
       console.log("Request:", dump_req(req) , "\n")

       // path of the
       var path = 'test-mp4.mp4'  //test-mp4-long.mp4
       , stat = fs.statSync(path)
       , total = stat.size


       var range = req.headers.range
       , parts = range.replace(/bytes=/, "").split("-")
       , partialstart = parts[0]
       , partialend = parts[1]
       , start = parseInt(partialstart, 10)
       , end = partialend ? parseInt(partialend, 10) : total-1
       , chunksize = (end-start)+1


       console.log('RANGE: ' + start + ' - ' + end + ' = ' + chunksize +  "\n")


       var ffmpeg = child_process.spawn("ffmpeg",[
               "-i", path,             // path
               "-b:v" , "64k",         // bitrate to 64k
               "-bufsize", "64k",
               "-"                     // Output to STDOUT
           ]);


       //set header
       res.writeHead(206
       , { 'Content-Range': 'bytes ' + start + '-' + end + '/' + total
       , 'Accept-Ranges': 'bytes', 'Content-Length': chunksize
       , 'Content-Type': 'video/mp4'
       })

       stdout[ params[1] ] = ffmpeg.stdout

       // Pipe the video output to the client response
       ffmpeg.stdout.pipe(res);

       console.log("Response", dump_res(res), "\n")
       }).listen(1337)

    When i replaced the ffmpeg stuffs from above code, all works fine. Following is the part of the code when i replace the ffmpeg stuffs.

    var file = fs.createReadStream(path, {start: start, end: end})

    And piping like :

    file.pipe(res)

    What wrong I am running ?

    Edit :
    The ffmpeg command works fine. I have tested this through the command line and generating proper output.

  • FFmpeg file conversion exceeds maximum execution time

    5 mai 2014, par Paul Ledger

    I have a file upload system the checks the file format, etc and converts to an mp4 if necessary. This works fine as long as the video file(s) total length is less than 30 seconds.
    I have been testing this two short clips about 10 seconds each and it work fine but when I test this with a clip that this 33 seconds I get the error :

    Fatal error : Maximum execution time of 30 seconds exceeded in
    C :\xampp\htdocs\own_it_all\global.func\file_upload.php on line
    59

    I could just increase the maximum execution time in the php.ini file but as the max length of a video is 20 mins this wouldn’t seem very user friendly making the user wait 20 mins per video.
    Is there a way of converting the video instantly or as near as ?

    This is the exec cmd i have :

    $cmd = "ffmpeg -i $input -vcodec h264 -acodec aac -strict -2 $o";

    As the up-loader allows multiple uploads this is inside a for loop.

    foreach($_FILES['file']['name'] as $key => $name){
           if($_FILES['file']['error'][$key] === 0){
               $temp = $_FILES['file']['tmp_name'][$key];
               $ext = explode('.',$name);
               $ext = strtolower(end($ext));
               $_file = md5($temp).time();
               $file = $_file.'.'.$ext;
               if(in_array($ext,$allowed) === true &&  move_uploaded_file($temp,"../uploads/{$file}") === true){
                   $file_type = explode('/',$_FILES['file']['type'][$key]);
                   if($file_type[0] === 'image'){
                       $succedeed[] = array('name' => $name,'file' => $file, 'type' => 'image');              
                   }else{
                       $ffmpeg = 'ffmpeg';
                       $output = dirname(__DIR__).'/uploads/thumbs/'.$_file.'.jpg';
                       $input = dirname(__DIR__).'/uploads/'.$file;
                       $mov = new ffmpeg_movie($input);
                       $d =  $mov->getDuration();
                       $iscopy = $mov->getCopyright();
                       $h = $mov->getFrameHeight();
                       $w = $mov->getFrameWidth();
                       $pos = ceil((int)$d /3);
                       $size = $w.'x'.$h;
                       $i = explode('.',$input);
                       $o = $i[0].'.mp4';
                       if(ceil($d) < 1200){
                           if($ext != 'mp4'){
                               $cmd = "ffmpeg -i $input -vcodec h264 -acodec aac -strict -2 $o";
                               //$cmd = "ffmpeg -i $input -vcodec h264 -acodec aac -s $size $o";
                               shell_exec($cmd);
                               $toclear[] = array('file' => $file);
                           }
                           $cmd = "ffmpeg -ss $pos -i $o -an -s $size $output";
                           shell_exec($cmd);
                           $total_time += $pos;
                           $succedeed[] = array('name' => $name,'file' => 'thumbs/'.$_file.'.jpg', 'type' => 'mp4');                          

                       }else{
                           $failed[] = array('name' => $name, 'file' => $file, 'error' => 'Video length cannot exceed 20mins.');
                       }          
                   }

               }else{
                   $failed[] = array('name' => $name, 'file' => $file, 'error' => 'File type not allowed');
               }
           }
       }
  • I have a series of images recorded by a webcam with unstable frame rate at about 22 fps. Did ffmpeg interpolate these image into other fps ? [closed]

    13 septembre 2020, par yangze68

    I have a series of images and its recorded timestamps. Their real fps is about 22 and it's unstable. If I use the FFmpeg to encode it into a 30fps video, do these really change the fps and interpolate image at an interval of 1/30 per second ? or Just arrange those images in the interval of 1/30 and decrease the total duration time ?

    


    my command :
ffmpeg -framerate 30 -i img%03d.png output.mp4