Recherche avancée

Médias (0)

Mot : - Tags -/xmlrpc

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

Autres articles (96)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • Multilang : améliorer l’interface pour les blocs multilingues

    18 février 2011, par

    Multilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
    Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela.

  • ANNEXE : Les plugins utilisés spécifiquement pour la ferme

    5 mars 2010, par

    Le site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)

Sur d’autres sites (6606)

  • 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

    


  • Node js async/await promise problem with ytdl and ffmpeg

    31 août 2020, par WorkoutBuddy

    I built a simple youtube downloader cli. It looks like this (without any arg parsing for easier reproduction) :

    


    const ytdl = require('ytdl-core');
const config = require('config');
const progressBar = require('./progressBar');
const logger = require('./logger');
const ffmpeg = require('fluent-ffmpeg');

const url = 'https://www.youtube.com/watch?v=Np8ibIagn3M';

const getInfo = async (url) => {
    logger.info(`Getting metadata for ${url}`);
    const response = await ytdl.getBasicInfo(url);
    const info = response.videoDetails.title;
    logger.info(`Title: ${info}`);
    return info;
};

const getStream = async (url) => {
    logger.info(`Downloading from ${url} ...`);

    let allReceived = false;
    return new Promise((resolve, reject) => {
        const stream = ytdl(url, {
            quality: 'highest',
            filter: (format) => format.container === 'mp4',
        })
            .on('progress', (_, totalDownloaded, total) => {
                if (!allReceived) {
                    progressBar.start(total, 0, {
                        mbTotal: (total / 1024 / 1024).toFixed(2),
                        mbValue: 0,
                    });
                    allReceived = true;
                }
                progressBar.increment();
                progressBar.update(totalDownloaded, {
                    mbValue: (totalDownloaded / 1024 / 1024).toFixed(2),
                });
            })
            .on('end', () => {
                progressBar.stop();
                logger.info('Successfully downloaded the stream!');
            });
        return resolve(stream);
    });
};

const convertToMp3 = async (stream, title) => {
    return new Promise((resolve, reject) => {
        ffmpeg({ source: stream })
            .output(`${config.get('audioDir')}/${title}.mp3`)
            .audioBitrate('192k')
            .run();
        return resolve();
    });
};

const main = async (url) => {
    const info = await getInfo(url);
    console.log('here 1');
    const stream = await getStream(url);
    console.log('here 2');
    await convertToMp3(stream, info);
    console.log('done');
};

main(url);


    


    The output looks like :

    


    ➜ node youtube.js
info:    Getting metadata for https://www.youtube.com/watch?v=Np8ibIagn3M
info:    Title: Tu boca -  (Bachata Remix Dj Khalid)
here 1
info:    Downloading from https://www.youtube.com/watch?v=Np8ibIagn3M ...
here 2
done
[Progress] [████████████████████████████████████████] 100% | Downloaded: 7.15/7.15 MB | Elapsed Time: 5s
info:    Successfully downloaded the stream!


    


    However, I would expect this output :

    


    ➜ node youtube.js
info:    Getting metadata for https://www.youtube.com/watch?v=Np8ibIagn3M
info:    Title: Tu boca -  (Bachata Remix Dj Khalid)
here 1
info:    Downloading from https://www.youtube.com/watch?v=Np8ibIagn3M ...
[Progress] [████████████████████████████████████████] 100% | Downloaded: 7.15/7.15 MB | Elapsed Time: 5s
here 2
info:    Successfully downloaded the stream!
done


    


    I think I have troubles to understand async/await. As far as I understood, promisifying a function allows me wait for the result. However, it seems that it does not work. I do not know why and how to properly debug it.

    


    EDITED :

    


    const getStream = async (url) => {
    logger.info(`Downloading from ${url} ...`);

    let allReceived = false;
    return new Promise((resolve, reject) => {
        const stream = ytdl(url, {
            quality: 'highest',
            filter: (format) => format.container === 'mp4',
        })
            .on('progress', (_, totalDownloaded, total) => {
                console.log('totalDownloaded: ' + totalDownloaded);
                if (!allReceived) {
                    console.log('total: ' + total);
                    progressBar.start(total, 0, {
                        mbTotal: (total / 1024 / 1024).toFixed(2),
                        mbValue: 0,
                    });
                    allReceived = true;
                }
                progressBar.increment();
                progressBar.update(totalDownloaded, {
                    mbValue: (totalDownloaded / 1024 / 1024).toFixed(2),
                });
            })
            .on('end', () => {
                progressBar.stop();
                logger.info('Successfully downloaded the stream!');
                resolve(stream);
            });
    });
};


    


    But now it is like this :

    


    ➜ node youtube.js
info:    Getting metadata for https://www.youtube.com/watch?v=Np8ibIagn3M
info:    Title: Tu boca -  (Bachata Remix Dj Khalid)
here 1
info:    Downloading from https://www.youtube.com/watch?v=Np8ibIagn3M ...
[Progress] [██████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░] 14% | Downloaded: 1.02/7.15 MB | Elapsed Time: 52s


    


    Added console.log :

    


    totalDownloaded: 16384
total: 7493903
[Progress] [░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░] 0% | Downloaded: 0/7.15 MB | Elapsed Time: 0stotalDownloaded: 32768
totalDownloaded: 49152
totalDownloaded: 65536
totalDownloaded: 81920
totalDownloaded: 98304
totalDownloaded: 114688
totalDownloaded: 131072
totalDownloaded: 147456
totalDownloaded: 163840
totalDownloaded: 180224
totalDownloaded: 196608
totalDownloaded: 212992
totalDownloaded: 229376
totalDownloaded: 245760
totalDownloaded: 262144
totalDownloaded: 278528
totalDownloaded: 294912
totalDownloaded: 311296
totalDownloaded: 327680
totalDownloaded: 344064
totalDownloaded: 360448
totalDownloaded: 376832
totalDownloaded: 393216
totalDownloaded: 409600
totalDownloaded: 425984
totalDownloaded: 442368
totalDownloaded: 458752
totalDownloaded: 475136
totalDownloaded: 491520
totalDownloaded: 507904
totalDownloaded: 524288
totalDownloaded: 540672
totalDownloaded: 557056
totalDownloaded: 573440
totalDownloaded: 589824
totalDownloaded: 606208
totalDownloaded: 622592
totalDownloaded: 638976
totalDownloaded: 655360
totalDownloaded: 671744
totalDownloaded: 688128
totalDownloaded: 704512
totalDownloaded: 720896
totalDownloaded: 737280
totalDownloaded: 753664
totalDownloaded: 770048
totalDownloaded: 786432
totalDownloaded: 802816
totalDownloaded: 819200
totalDownloaded: 835584
totalDownloaded: 851968
totalDownloaded: 868352
totalDownloaded: 884736
totalDownloaded: 901120
totalDownloaded: 917504
totalDownloaded: 933888
totalDownloaded: 950272
totalDownloaded: 966656
totalDownloaded: 983040
totalDownloaded: 999424
totalDownloaded: 1015808
totalDownloaded: 1032192
totalDownloaded: 1048576
totalDownloaded: 1064960
[Progress] [██████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░] 14% | Downloaded: 1.02/7.15 MB | Elapsed Time: 25s