Recherche avancée

Médias (1)

Mot : - Tags -/Rennes

Autres articles (87)

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

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

Sur d’autres sites (5325)

  • VP8 Codec SDK "Aylesbury" Release

    28 octobre 2010, par noreply@blogger.com (John Luther)

    Today we’re making available "Aylesbury," our first named release of libvpx, the VP8 codec SDK. VP8 is the video codec used in WebM. Note that the VP8 specification has not changed, only the SDK.

    What’s an Aylesbury ? It’s a breed of duck. We like ducks, so we plan to use duck-related names for each major libvpx release, in alphabetical order. Our goal is to have one named release of libvpx per calendar quarter, each with a theme.

    You can download the Aylesbury libvpx release from our Downloads page or check it out of our Git repository and build it yourself. In the coming days Aylesbury will be integrated into all of the WebM project components (DirectShow filters, QuickTime plugins, etc.). We encourage anyone using our components to upgrade to the Aylesbury releases.

    For Aylesbury the theme was faster decoder, better encoder. We used our May 19, 2010 launch release of libvpx as the benchmark. We’re very happy with the results (see graphs below) :

    • 20-40% (average 28%) improvement in libvpx decoder speed
    • Over 7% overall PSNR improvement (6.3% SSIM) in VP8 "best" quality encoding mode, and up to 60% improvement on very noisy, still or slow moving source video.




    The main improvements to the decoder are :

    • Single-core assembly "hot spot" optimizations, including improved vp8_sixtap_predict() and SSE2 loopfilter functions
    • Threading improvements for more efficient use of multiple processor cores
    • Improved memory handling and reduced footprint
    • Combining IDCT and reconstruction steps
    • SSSE3 usage in functions where appropriate

    On the encoder front, we concentrated on clips in the 30-45 dB range and saw the biggest gains in higher-quality source clips (greater that 38 dB), low to medium-motion clips, and clips with noisy source material. Many code contributions made this possible, but a few of the highlights were :

    • Adaptive width and strength alternate reference frame noise suppression filter with optional motion compensation.
    • Transform improvements (improved accuracy and reduction in round trip error)
    • Trellis-based quantized coefficient optimization
    • Two-pass rate control and quantizer changes
    • Rate distortion changes
    • Zero bin and rounding changes
    • Work on MB-level quality control and bit allocation

    We’re targeting Q1 2011 for the next named libvpx release, which we’re calling Bali. The theme for that release will be faster encoder. We are constantly working on improvements to video quality in the encoder, so after Aylesbury we won’t tie that work to specific named releases.

    WebM at Streaming Media West

    Members of the WebM project will discuss Aylesbury during a session at the Streaming Media West conference on November 3rd (session C203 : WebM Open Video Project Update). For more information, visit www.streamingmedia.com/west.

    John Luther is Product Manager of the WebM Project.

  • evrcdec : fix sign error

    4 mai 2013, par Michael Niedermayer
    evrcdec : fix sign error
    

    The specification wants round(abs(x))) * sign(x) which is
    equivakent to round(x)

    Fixes out of array access

    Found-by : Mateusz "j00ru" Jurczyk and Gynvael Coldwind
    Signed-off-by : Michael Niedermayer <michaelni@gmx.at>

    • [DH] libavcodec/evrcdec.c
  • using ffmpeg as multiple downloads

    26 avril 2013, par user2321982

    well guys, I'm having problems with my application.
    well I'll explain more, I'm using the plugin uploader uploads multiple videos and I'm using the ffmpeg extension to my php version.

    <code class="echappe-js">&lt;script type=&quot;text/javascript&quot;&gt;<br />
    // Convert divs to queue widgets when the DOM is ready<br />
    $(function() {<br />
       $(&quot;#uploader&quot;).pluploadQueue({<br />
           // General settings<br />
           runtimes : &amp;#39;gears,flash,silverlight,browserplus,html5&amp;#39;,<br />
           url : &amp;#39;upload.php?id=&amp;lt;?= $login_usuario; ?&gt;&amp;amp;name=&amp;lt;?= $name_user; ?&gt;&amp;#39;,<br />
           flash_swf_url : &amp;#39;plugins/plupload/plupload.flash.swf&amp;#39;,<br />
           containers: &amp;#39;plupload&amp;#39;,<br />
           multipart: true,<br />
           urlstream_upload: true,<br />
           multipart_params:{directory:&amp;#39;uploads&amp;#39;},<br />
           multi_selection: true,<br />
    <br />
           max_file_size : &amp;#39;500mb&amp;#39;,<br />
           chunk_size : &amp;#39;1mb&amp;#39;,<br />
           unique_names : true,<br />
    <br />
           // Specify what files to browse for<br />
           filters : [<br />
               {title : &quot;Video Files&quot;, extensions : &quot;avi,mpg,wmv,flv,3gp,mpeg,mpeg4,mpg4,mp4&quot;}<br />
           ],<br />
           // Silverlight settings<br />
           silverlight_xap_url : &amp;#39;plugins/plupload/plupload.silverlight.xap&amp;#39;<br />
       });<br />
    <br />
       uploader.ini();<br />
    <br />
    // Client side form validation<br />
           $(&amp;#39;form&amp;#39;).submit(function(e) {<br />
               var uploader = $(&amp;#39;#uploader&amp;#39;).plupload(&amp;#39;getUploader&amp;#39;);<br />
    <br />
               // Files in queue upload them first<br />
               if (uploader.files.length &gt; 0) {<br />
                   // When all files are uploaded submit form<br />
                   uploader.bind(&amp;#39;StateChanged&amp;#39;, function() {<br />
                       if (uploader.files.length === (uploader.total.uploaded + uploader.total.failed)) {<br />
                           $(&amp;#39;form&amp;#39;)[0].submit();<br />
                       }<br />
                   });<br />
    <br />
                   uploader.start();<br />
               } else<br />
                   alert(&amp;#39;You must at least upload one file.&amp;#39;);<br />
    <br />
               return false;<br />
           });<br />
       });<br />
    &lt;/script&gt;

    You browser doesn't have Flash, Silverlight, Gears, BrowserPlus or HTML5 support.

    well he calls javascript in a php file, in case it will upload the videos.

    what I want is to get the length, resolution, file size and take a screenshot of the video randomly, so far so good, the problem is that it only works with only one upload at a time.
    When sending more than one he does the procedure with ffmpeg, besides the most is not taking a screenshot of the video.
    below is my code

    &lt;?php
    ini_set(&#39;max_execution_time&#39;, 300); //300 seconds = 5 minutes
    if (!extension_loaded (&#39;ffmpeg&#39;) ) exit ( &#39;ffmpeg não foi carregado!&#39; );
    // HTTP headers for no cache etc
    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
    header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
    header("Cache-Control: no-store, no-cache, must-revalidate");
    header("Cache-Control: post-check=0, pre-check=0", false);
    header("Pragma: no-cache");

    include("includes/seguranca.php");
    include("includes/classes/class.mysql.php");
    include("includes/funcoes/sql_inject.php");

    $id_user = anti_injection($_GET[&#39;id&#39;]);
    session_start();

    // Settings
    //$targetDir = ini_get("upload_tmp_dir") . DIRECTORY_SEPARATOR . "plupload";
    $targetDir = &#39;uploads/&#39;;

    //$cleanupTargetDir = false; // Remove old files
    //$maxFileAge = 60 * 60; // Temp file age in seconds

    // 5 minutes execution time
    @set_time_limit(5 * 60);

    // Uncomment this one to fake upload time
    // usleep(5000);

    // Get parameters
    $chunk = isset($_REQUEST["chunk"]) ? $_REQUEST["chunk"] : 0;
    $chunks = isset($_REQUEST["chunks"]) ? $_REQUEST["chunks"] : 0;
    $fileName = isset($_REQUEST["name"]) ? $_REQUEST["name"] : &#39;&#39;;

    // Clean the fileName for security reasons
    $fileName = preg_replace(&#39;/[^\w\._]+/&#39;, &#39;&#39;, $fileName);

    // Make sure the fileName is unique but only if chunking is disabled
    if ($chunks &lt; 2 &amp;&amp; file_exists($targetDir . DIRECTORY_SEPARATOR . $fileName)) {
       $ext = strrpos($fileName, &#39;.&#39;);
       $fileName_a = substr($fileName, 0, $ext);
       $fileName_b = substr($fileName, $ext);

       $count = 1;
       while (file_exists($targetDir . DIRECTORY_SEPARATOR . $fileName_a . &#39;_&#39; . $count . $fileName_b))
           $count++;

       $fileName = $fileName_a . &#39;_&#39; . $count . $fileName_b;


    }

    // Create target dir
    if (!file_exists($targetDir))
       @mkdir($targetDir);

    // Look for the content type header
    if (isset($_SERVER["HTTP_CONTENT_TYPE"]))
       $contentType = $_SERVER["HTTP_CONTENT_TYPE"];

    if (isset($_SERVER["CONTENT_TYPE"]))
       $contentType = $_SERVER["CONTENT_TYPE"];

    // Handle non multipart uploads older WebKit versions didn&#39;t support multipart in HTML5
    if (strpos($contentType, "multipart") !== false) {
       if (isset($_FILES[&#39;file&#39;][&#39;tmp_name&#39;]) &amp;&amp; is_uploaded_file($_FILES[&#39;file&#39;][&#39;tmp_name&#39;])) {


           // Open temp file
           $out = fopen($targetDir . DIRECTORY_SEPARATOR . $fileName, $chunk == 0 ? "wb" : "ab");
           if ($out) {
               // Read binary input stream and append it to temp file
               $in = fopen($_FILES[&#39;file&#39;][&#39;tmp_name&#39;], "rb");

               if ($in) {
                   while ($buff = fread($in, 4096))
                       fwrite($out, $buff);
               } else
                   die(&#39;{"jsonrpc" : "2.0", "error" : {"code": 101, "message": "Failed to open input stream."}, "id" : "id"}&#39;);
               fclose($in);
               fclose($out);
               @unlink($_FILES[&#39;file&#39;][&#39;tmp_name&#39;]);



           } else
               die(&#39;{"jsonrpc" : "2.0", "error" : {"code": 102, "message": "Failed to open output stream."}, "id" : "id"}&#39;);
       } else
           die(&#39;{"jsonrpc" : "2.0", "error" : {"code": 103, "message": "Failed to move uploaded file."}, "id" : "id"}&#39;);
    } else {
       // Open temp file
       $out = fopen($targetDir . DIRECTORY_SEPARATOR . $fileName, $chunk == 0 ? "wb" : "ab");
       if ($out) {
           // Read binary input stream and append it to temp file
           $in = fopen("php://input", "rb");

           if ($in) {
               while ($buff = fread($in, 4096))
                   fwrite($out, $buff);
           } else
               die(&#39;{"jsonrpc" : "2.0", "error" : {"code": 101, "message": "Failed to open input stream."}, "id" : "id"}&#39;);

           fclose($in);
           fclose($out);
       } else
           die(&#39;{"jsonrpc" : "2.0", "error" : {"code": 102, "message": "Failed to open output stream."}, "id" : "id"}&#39;);
    }
    $photoName = $_FILES[&#39;file&#39;][&#39;name&#39;];

    $exploded_photoName = explode(&#39;.&#39;, $photoName);

    $user_id = $_SESSION[&#39;SESS_MEMBER_ID&#39;];

    if(!isset($_SESSION[$photoName])) {

       $_SESSION[$photoName] = &#39;1&#39;;
    }

    if($chunk==1){

    $movie_file = realpath("/uploads/".$fileName);

    // instancia a classe ffmpeg_movie para pegarmos as informações que queremos o vídeo
    $movie = new ffmpeg_movie($movie_file);
    // pegamos a duranção do video em segundos
    $duration = round ( $movie->getDuration() , 0 );
    // recebemos o número de frames do vídeo
    $totalFrames = $movie->getFrameCount();
    // recebemos a altura do vídeo em pixels
    $height = $movie->getFrameHeight ();
    // recebemos a largura do vídeo em pixels
    $width = $movie->getFrameWidth ();

    $thumbnailOf = $movie->getFrameRate() * 5;

    $thumbnailOf = round ( $movie->getFrameCount() / 2 );

    // precisamos criar uma imagem GD para o ffmpeg-php trabalhar nela
    $image = imagecreatetruecolor ($width,$height ) ;
    // criamos a instancia do frame com a classe ffmpeg_frame
    $frame = new ffmpeg_frame ($image);
    // escolhemos o frame que queremos salvar como jpeg
    $thumbnailOf = rand (1,$movie->getFrameCount());
    // recebe o frame
    $frame = $movie->getFrame ( $thumbnailOf );
    // converte para uma imagem GD
    $image = $frame->toGDImage ();

    $size = filesize("uploads/".$fileName);

    $valuea = rand(0,100);
    $valueb = rand(0,100);
    $valuec = rand(0,10);

    $nome = @md5(date(&#39;now&#39;) * $valuea - $valueb / $valuec);

    $dir = realpath("uploads/snapshots/$nome.jpg");
    //salva no HD.
    imagejpeg($image, $dir, 100);


    $resolu = $width."x".$height;

       mysql_query("INSERT INTO video
    (poster_id,duration,video,titulo,resolucao,tamanho)
       VALUES
    (&#39;$id_user&#39;,&#39;$duration&#39;,&#39;$fileName&#39;,&#39;$exploded_photoName[0]&#39;,&#39;$resolu&#39;,&#39;$size&#39;)") or die(mysql_error());

    }
    // Return JSON-RPC response
    die(&#39;{"jsonrpc" : "2.0", "result" : null, "id" : "id"}&#39;);

    ?>

    I did another method not so effective to do what I want but it only works if I open the page individually.

    I removed the code from ffmpeg extension and put an include to that page.

    &lt;?
    ini_set(&#39;max_execution_time&#39;, 300); //300 seconds = 5 minutes
    if (!extension_loaded (&#39;ffmpeg&#39;) ) exit ( &#39;ffmpeg não foi carregado!&#39; );

    include("includes/seguranca.php");
    include("includes/classes/class.mysql.php");
    include("includes/funcoes/sql_inject.php");

    $id_user = @anti_injection($_GET[&#39;id&#39;]);

    class process{
       public $videos;
       public $target;
       public $id_vid;

    public function screen(){

    $videos = $this->videos;
    $target = $this->target;

    $movie_file = realpath($videos);
    // instancia a classe ffmpeg_movie para pegarmos as informações que queremos o vídeo
    $movie = new ffmpeg_movie($movie_file);
    $totalFrames = $movie->getFrameCount();
    $thumbnailOf = $movie->getFrameRate() * 5;
    $thumbnailOf = round ( $movie->getFrameCount() / 2 );

    // criamos a instancia do frame com a classe ffmpeg_frame
    $frame = new ffmpeg_frame ( $image );
    // escolhemos o frame que queremos salvar como jpeg

    $thumbnailOf = rand (1,$movie->getFrameCount());
    // recebe o frame
    $frame = $movie->getFrame ( $thumbnailOf );
    // converte para uma imagem GD
    $image = $frame->toGDImage ();
    $valuea = rand(0,100);
    $valueb = rand(0,100);
    $valuec = rand(0,10);

    $nome = @md5(date(&#39;now&#39;) * $valuea - $valueb / $valuec);

    $dir = $target."snapshots/".$nome.".jpeg";
    //salva no HD.
    imagejpeg($image,$dir, 100);

    $q = new Query;
    $q  ->update(&#39;video&#39;)
       ->set(
           array(
              &#39;screen&#39;=>$nome.".jpeg"
           )
       )
           ->where_equal_to(
                   array(
                           &#39;id_video&#39;=>$this->id_vid
                   )
           )
           ->limit(1)

       ->run();

    }


    public function duration(){

    $videos = $this->videos;    
    $movie_file = realpath($videos);
    // instancia a classe ffmpeg_movie para pegarmos as informações que queremos o vídeo
    $movie = new ffmpeg_movie($movie_file);
    // pegamos a duranção do video em segundos
    $duration = round ( $movie->getDuration() , 0 );

    $q = new Query;
    $q  ->update(&#39;video&#39;)
       ->set(
           array(
              &#39;duration&#39;=>$duration
           )
       )
           ->where_equal_to(
                   array(
                           &#39;id_video&#39;=>$this->id_vid
                   )
           )
           ->limit(1)

       ->run();
    }


    public function resolution(){

    $videos = $this->videos;    
    $movie_file = realpath($videos);
    // instancia a classe ffmpeg_movie para pegarmos as informações que queremos o vídeo
    $movie = new ffmpeg_movie($movie_file);
    // recebemos a altura do vídeo em pixels
    $height = $movie->getFrameHeight ();
    // recebemos a largura do vídeo em pixels
    $width = $movie->getFrameWidth ();
    $resolucao =  $width."x".$height;


    $q = new Query;
    $q  ->update(&#39;video&#39;)
       ->set(
           array(
              &#39;resolucao&#39;=>$resolucao
           )
       )
       ->where_equal_to(
                   array(
                           &#39;id_video&#39;=>$this->id_vid
                   )
           )
           ->limit(1)

       ->run();
    }

    final public function checar($a){

    $q = new Query;
    $q  ->update(&#39;video&#39;)
       ->set(
           array(
              &#39;process&#39;=>$a
           )
       )
       ->where_equal_to(
                   array(
                           &#39;id_video&#39;=>$this->id_vid
                   )
           )
           ->limit(1)

       ->run();

    }

    }

    $q=new Query;
    $q->select(
                   array(
                           &#39;id_video&#39;,
                           &#39;video&#39;,
                           &#39;dir&#39;,
                           &#39;screen&#39;,
                           &#39;poster_id&#39;,
                           &#39;resolucao&#39;,
                           &#39;duration&#39;
                   )
           )
           ->from(&#39;video&#39;)



           ->run();
    if($q){
           $users=$q->get_selected();
           foreach($users as $user){
            $c = new process;

            $c->videos = $user[&#39;video&#39;];
            $c->target = $user[&#39;dir&#39;];
            $c->id_vid = $user[&#39;id_video&#39;];

           if(($user[&#39;screen&#39;] == &#39;NULL&#39;) or ($user[&#39;duration&#39;] == &#39;NULL&#39;) or ($user[&#39;resolucao&#39;] == &#39;NULL&#39;)){
                   $c->checar(0);

                   if($user[&#39;screen&#39;] == &#39;NULL&#39;){      
                   $c->screen();
                   }

                   if($user[&#39;duration&#39;] == &#39;NULL&#39;){
                   $c->duration();
                   }

                   if($user[&#39;resolucao&#39;] == &#39;NULL&#39;){
                   $c->resolution();  
                   }

           }else{

           $c->checar(1);

           }

           }
    }
    else{
           echo &#39;Sorry, no users found.&#39;;
    }



    ?>