Recherche avancée

Médias (91)

Autres articles (56)

  • Les tâches Cron régulières de la ferme

    1er décembre 2010, par

    La gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
    Le super Cron (gestion_mutu_super_cron)
    Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

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

  • How to new & delete AVPacket ?

    22 août 2014, par PatrickSCLin

    I’m working with a FFmpeg project right now, I have to store the data of AVPacket which from av_read_frame, and fill data to new AVPacket for following decoding.

    here is my problem, when I try to new & free an AVPacket, memory leaks
    always happen.

    I just doing a simple testing :

    for(;;)
    {
       AVPacket pkt;

       av_new_packet(&pkt, 1000);

       av_init_packet(&pkt);

       av_free_packet(&pkt);
    }

    Is something wrong in here ?

  • Store converted video in a buffer to transfer to S3

    24 mai 2012, par Chris

    I have a system set up to upload an image, take that temporarily uploaded file, convert it to a resized jpeg, read the buffer of that conversion and send the buffer to amazon S3 for storage as an image. It works wonderfully because no permanent file is stored on the my server, everything is on S3.

    Now I am attempting to add this same functionality but with video. The process goes through, but the resulting files stored on Amazons S3 servers are 1.5kb a piece, instead of multimb videos.

    My code is as follows :

    public function transfer($method, $file, $bucketName, $filename, $contentType){
       switch($method){
           case 'file':
               if($this->s3->putObject($this->s3->inputFile($file, false), $bucketName, $filename, S3::ACL_PUBLIC_READ, array(), $contentType))
                   return true;
               else
                   return false;
               break;
           case 'string':
               if ($this->s3->putObject($file, $bucketName, $filename, S3::ACL_PUBLIC_READ, array(), $contentType))
                   return true;
               else
                   return false;
               break;
           case 'resource':
               if($this->s3->putObject($this->s3->inputResource(fopen($file, 'rb'), filesize($file)), $bucketName, $filename, S3::ACL_PUBLIC_READ, array(), $contentType))
                   return true;
               else
                   return false;
               break;
       }
       return false;
    }  


    /**
    *   AmazonS3Handler - convert()
    */

    public function convert($file, $type)
    {
            $ffmpeg = "/usr/bin/ffmpeg";
       $cmd['webm'] = $ffmpeg. " -i ". $file ." -vcodec libvpx -acodec libvorbis -ac 2 -f webm -g 30 2>&1";
       $cmd['ogv'] = $ffmpeg. " -i ". $file ." -vcodec libtheora -acodec libvorbis -ac 2 2>&1";
       $cmd['mp4'] = $ffmpeg. " -i ". $file ." -vcodec libx264 -acodec libfaac -ac 2 2>&1";
       $cmd['jpg'] = $ffmpeg. " -i ". $file ." -vframes 30";

       ob_start();
       passthru($cmd[$type]);
       $fileContents = ob_get_contents();
       ob_end_clean();
       return $fileContents;
    }

    From my understanding, passthru should return raw output which could be picked up by the output buffer.

    Am I doing something wrong ? Is there a better way to convert a video on my servers but keep the data on S3 ?

    Thanks !

    EDIT : I've boiled it down to the executing of the command. FFMPEG wasn't being located, so I changed the path to "/usr/bin/ffmpeg", no more error 127, now when I run exec() (not passthru) I get error 1

    EDIT2 : Here is the output of running the script :

    Array
    (
    [0] => ffmpeg version 0.7.3-4:0.7.3-0ubuntu0.11.10.1, Copyright (c) 2000-2011 the Libav developers
    [1] =>   built on Jan  4 2012 16:08:51 with gcc 4.6.1
    [2] =>   configuration: --extra-version='4:0.7.3-0ubuntu0.11.10.1' --arch=amd64 --prefix=/usr --enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --enable-libvpx --enable-runtime-cpudetect --enable-vaapi --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libdc1394 --enable-shared --disable-static
    [3] =>   libavutil    51.  7. 0 / 51.  7. 0
    [4] =>   libavcodec   53.  6. 0 / 53.  6. 0
    [5] =>   libavformat  53.  3. 0 / 53.  3. 0
    [6] =>   libavdevice  53.  0. 0 / 53.  0. 0
    [7] =>   libavfilter   2.  4. 0 /  2.  4. 0
    [8] =>   libswscale    2.  0. 0 /  2.  0. 0
    [9] =>   libpostproc  52.  0. 0 / 52.  0. 0
    [10] =>
    [11] => Seems stream 1 codec frame rate differs from container frame rate: 2000.00 (2000/1) -> 30.30 (1000/33)
    [12] => Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'iv.m4v':
    [13] =>   Metadata:
    [14] =>     major_brand     : M4V
    [15] =>     minor_version   : 1
    [16] =>     compatible_brands: M4V M4A mp42isom
    [17] =>     creation_time   : 2012-01-23 04:00:18
    [18] =>     encoder         : Mac OS X v10.7.2 (CMA 889, CM 705.42, x86_64)
    [19] =>   Duration: 00:00:11.70, start: 0.000000, bitrate: 345 kb/s
    [20] =>     Stream #0.0(und): Audio: aac, 44100 Hz, stereo, s16, 125 kb/s
    [21] =>     Metadata:
    [22] =>       creation_time   : 2012-01-23 04:00:18
    [23] =>     Stream #0.1(und): Video: h264 (Main), yuv420p, 640x360 [PAR 1:1 DAR 16:9], 206 kb/s, 30.30 fps, 30.30 tbr, 1k tbn, 2k tbc
    [24] =>     Metadata:
    [25] =>       creation_time   : 2012-01-23 04:00:18
    [26] => iv.webm: Permission denied
    )

    It looks like the permissions aren't set right, however the file has chmod 777 permissions. What other permissions need to get changed ?

  • How to force Constant Bit Rate using FFMPEG

    6 octobre 2014, par user1338254

    I use FFMPEG (command line Input) to convert my videos to a specific output format. The problem I am facing is when I try to pass a constant bit rate(700 kbps) to FFMPEG, the result is an output video with a different bit rate(say 1000 kbps). This phenomenon occurs invariably for all videos.Why is this happening ? I need to maintain a constant bit rate. Can anyone help me out.

    My FFMPEG version is 0.5

    The command line parameter which I am passing to FFMPEG is,

    -i {inputfile}
    -b 700k -ab 64k
    -vcodec libx264
    -acodec libfaac -ac 2 -ar 44100
    -y -s 320x240
    {outputfile}

    EDIT :

    I was able to force CBR with a fluctuation of 3% when I used the following parameters.

    ffmpeg -i myfile.avi
    -b 4000k -minrate 4000k
    -maxrate 4000k -bufsize 1835k   out.m2v

    But when I used -maxrate and - minrate along with my parameter set I was not able to force CBR. My parameter set is as follows,

    -i {inputfile}
    -b 1200k -minrate 1200k
    -maxrate 1200k -bufsize 1200k
    -ab 64k -vcodec libx264
    -acodec libfaac -ac 2 -ar 44100
    -y -s 320x240
    {outputfile}

    Why is this happening ?