Recherche avancée

Médias (1)

Mot : - Tags -/pirate bay

Autres articles (75)

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

  • Configurer la prise en compte des langues

    15 novembre 2010, par

    Accéder à la configuration et ajouter des langues prises en compte
    Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
    De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
    Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)

  • XMP PHP

    13 mai 2011, par

    Dixit Wikipedia, XMP signifie :
    Extensible Metadata Platform ou XMP est un format de métadonnées basé sur XML utilisé dans les applications PDF, de photographie et de graphisme. Il a été lancé par Adobe Systems en avril 2001 en étant intégré à la version 5.0 d’Adobe Acrobat.
    Étant basé sur XML, il gère un ensemble de tags dynamiques pour l’utilisation dans le cadre du Web sémantique.
    XMP permet d’enregistrer sous forme d’un document XML des informations relatives à un fichier : titre, auteur, historique (...)

Sur d’autres sites (7515)

  • PHP Create video thumbnail with FFMPEG - returns error code 1

    27 février 2013, par Light

    I am trying to create a video thumbnail with FFMPEG using the following script.
    However I am getting return value of 1. What does it mean ? What is error code 1 ? I have Googled it and didn't find and answer. Thanks.
    Here is the code :

    <?php

           //thumb path should be added in the below code
           //test for thumb
           $dir_img='uploads/';
           $mediapath='thumb.jpg';
           $file_thumb=create_movie_thumb('test.mp4',$mediapath,$mediaid);

           $name_file=explode(".",$mediapath);
           $imgname="thumb_".$name_file[0].".jpg";    

           /*
             Function to create video thumbnail using ffmpeg
           */
           function create_movie_thumb($src_file,$mediapath,$mediaid)
           {

               global $CONFIG, $ERROR;

               $CONFIG['ffmpeg_path'] = '/usr/bin/'; // Change the path according to your server.
               $dir_img='uploads/';
               $CONFIG['fullpath'] = $dir_img."thumbs/";

               $src_file = $src_file;
               $name_file=explode(".",$mediapath);
               $imgname="thumb_".$name_file[0].".jpg";
               $dest_file = $CONFIG['fullpath'].$imgname;

               if (preg_match("#[A-Z]:|\\\\#Ai", __FILE__)) {
                   // get the basedir, remove '/include'
                   $cur_dir = substr(dirname(__FILE__), 0, -8);
                   $src_file = '"' . $cur_dir . '\\' . strtr($src_file, '/', '\\') . '"';
                   $ff_dest_file = '"' . $cur_dir . '\\' . strtr($dest_file, '/', '\\') . '"';
               } else {
                   $src_file = escapeshellarg($src_file);
                   $ff_dest_file = escapeshellarg($dest_file);
               }

               $output = array();

               if (eregi("win",$_ENV['OS'])) {
                   // Command to create video thumb
                   $cmd = "\"".str_replace("\\","/", $CONFIG['ffmpeg_path'])."ffmpeg\" -i ".str_replace("\\","/" ,$src_file )." -an -ss 00:00:05 -r 1 -vframes 1 -y ".str_replace("\\","/" ,$ff_dest_file);
                   exec ("\"$cmd\"", $output, $retval);
                   echo "exec1";

               } else {
                   // Command to create video thumb
                   $cmd = "{$CONFIG['ffmpeg_path']}ffmpeg -i $src_file -an -ss 00:00:05 -r 1 -vframes 1 -y $ff_dest_file";
                   exec ($cmd, $output, $retval);
                   echo "exec2";
               }


               if ($retval) {
                   $ERROR = "Error executing FFmpeg - Return value: $retval";
                   if ($CONFIG['debug_mode']) {
                       // Re-execute the command with the backtick operator in order to get all outputs
                       // will not work if safe mode is enabled
                       $output = `$cmd 2>&1`;
                       $ERROR .= "<br /><br /><div align="\&quot;left\&quot;">Cmd line : <br /><span style="&quot;font-size:120%&quot;">" . nl2br(htmlspecialchars($cmd)) . "</span></div>";
                       $ERROR .= "<br /><br /><div align="\&quot;left\&quot;">The ffmpeg program said:<br /><span style="&quot;font-size:120%&quot;">";
                       $ERROR .= nl2br(htmlspecialchars($output));
                       $ERROR .= "</span></div>";
                   }
                   echo $ERROR;
                   @unlink($dest_file);
                   return false;
               }

               $return = $dest_file;
               //@chmod($return, octdec($CONFIG[&#39;default_file_mode&#39;])); //silence the output in case chmod is disabled
               return $return;
           }
    ?>
  • Shaka Player returns 4001 error - Node.js local web server playing MPEG-DASH

    27 mai 2020, par salgarji

    I've used Chrome inspection tool to access 'Console' and analyze what is happening. Complete error information :

    &#xA;&#xA;

    D {severity: 2, category: 4, code: 4001, data: Array(1), handled: false}&#xA;category: 4&#xA;code: 4001&#xA;data: Array(1)&#xA;0: "http://localhost:8080/dash_segmentos/video.mpd"&#xA;length: 1&#xA;__proto__: Array(0)&#xA;handled: false&#xA;severity: 2&#xA;__proto__: Object&#xA;

    &#xA;&#xA;

    My Server.js file :

    &#xA;&#xA;

    var http = require(&#x27;http&#x27;);&#xA;var fs = require(&#x27;fs&#x27;);&#xA;&#xA;console.log(__dirname);&#xA;&#xA;var path=&#x27;dash_segmentos/video.mpd&#x27;;&#xA;fs.access(path, fs.constants.R_OK | fs.constants.W_OK, (err) => {&#xA;    if (err) {&#xA;        console.log("%s doesn&#x27;t exist", path);&#xA;    } else {&#xA;        console.log(&#x27;can read/write %s&#x27;, path);&#xA;    }&#xA;});&#xA;&#xA;const PORT=8080; &#xA;&#xA;fs.readFile(&#x27;./player.html&#x27;, function (err, html) {&#xA;&#xA;    if (err) throw err;    &#xA;&#xA;    http.createServer(function(request, response) {  &#xA;        response.setHeader("Access-Control-Allow-Headers", "authorization, content-type");&#xA;        response.setHeader("Access-Control-Allow-Origin", "*");&#xA;        response.setHeader("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");&#xA;        response.writeHeader(200, {"Content-Type": "text/html"}); &#xA;        response.write(html);  &#xA;        response.end();&#xA;    }).listen(PORT);&#xA;});&#xA;

    &#xA;&#xA;

    As you can see I've added CORS (I guess it's correct) and a console.log to see if it's in the proper location. Furthermore, I've verified that file is accessible with fs.access and it returns can read/write dash_segmentos/video.mpd For this reason, I'm sure I am in the correct path and referencing the right file.

    &#xA;&#xA;

    The HTML code (player.html) provided to Server.js :

    &#xA;&#xA;

    &#xA;&#xA; &#xA; <code class="echappe-js">&lt;script type=&quot;text/javascript&quot;&amp;#xA;src=&quot;https://cdnjs.cloudflare.com/ajax/libs/shaka-player/2.5.11/shaka-player.compiled.js&quot;&gt;&lt;/script&gt;&#xA; &#xA; &#xA; 
    &#xA; &#xA;

    &#xA;&#xA; &lt;script&gt;&amp;#xA;function initApp() { &amp;#xA;shaka.polyfill.installAll(); &amp;#xA;if (shaka.Player.isBrowserSupported()) { &amp;#xA; initPlayer(); &amp;#xA; } else { &amp;#xA; console.error(&amp;#x27;Browser not supported!&amp;#x27;);&amp;#xA; }}&amp;#xA;&amp;#xA;function initPlayer() { &amp;#xA;var video = document.getElementById( &amp;#x27;video&amp;#x27; );&amp;#xA;var player = new shaka.Player( video );&amp;#xA; window.player = player; &amp;#xA;player.addEventListener(&amp;#x27;error&amp;#x27;, onErrorEvent); &amp;#xA;player.load(path).then(function (){&amp;#xA;    console.log(&amp;#x27;Video loaded correctly&amp;#x27;);&amp;#xA; }).catch(onError);&amp;#xA;&amp;#xA;function onErrorEvent(event) {&amp;#xA; onError(event.detail); &amp;#xA; }&amp;#xA;function onError(error) {&amp;#xA; console.error(&amp;#x27;Codigo de error: &amp;#x27;, error.code, &amp;#x27; en &amp;#x27;, error);&amp;#xA; }&amp;#xA;}&amp;#xA;&lt;/script&gt;&#xA;&#xA;&lt;script&gt;&amp;#xA;var path=&amp;#x27;dash_segmentos/video.mpd&amp;#x27;;&amp;#xA;//var path=&amp;#x27;https://dash.akamaized.net/dash264/TestCases/2c/qualcomm/1/MultiResMPEG2.mpd&amp;#x27;;&amp;#xA;//the URL above is working! but it won&amp;#x27;t read my local mpd&amp;#xA;&amp;#xA;document.addEventListener(&amp;#x27;DOMContentLoaded&amp;#x27;, initApp);&amp;#xA;&amp;#xA; &lt;/script&gt;&#xA; &#xA;&#xA;

    &#xA;&#xA;

    I've tried changing the URL to an online resource and the player is properly working.

    &#xA;&#xA;

    My fluent-ffmpeg command which generates the video is :

    &#xA;&#xA;

    var ffmpeg = require(&#x27;fluent-ffmpeg&#x27;);&#xA;&#xA;var grabacion = new ffmpeg();&#xA;&#xA;grabacion.addInput(&#x27;0&#x27;)&#xA;.inputOptions([&#x27;-y -nostdin&#x27;, &#x27;-f avfoundation&#x27;, &#x27;-video_size 1280x720&#x27;, &#x27;-framerate 30&#x27;])&#xA;.outputOptions([&#x27;-vcodec libx264&#x27;, &#x27;-keyint_min 0&#x27;, &#x27;-g 100&#x27;, &#x27;-map 0:v&#x27;, &#x27;-b:v 1000k&#x27;, &#x27;-f dash&#x27;,&#xA; &#x27;-use_template 1&#x27;, &#x27;-use_timeline 0&#x27;, &#x27;-init_seg_name video0-$RepresentationID$-$Number$.mp4&#x27;,&#xA; &#x27;-media_seg_name video0-$RepresentationID$-$Number$.mp4&#x27;,&#x27;-single_file 0&#x27;, &#x27;-remove_at_exit 0&#x27;, &#x27;-window_size 20&#x27;, &#x27;-seg_duration 4&#x27;])&#xA;.output(&#x27;/path/to/files/dash_segmentos/video.mpd&#x27;)&#xA;.run();&#xA;

    &#xA;&#xA;

    The mpd manifest file is :

    &#xA;&#xA;

    &lt;?xml version="1.0" encoding="utf-8"?>&#xA;<mpd xmlns="urn:mpeg:dash:schema:mpd:2011" profiles="urn:mpeg:dash:profile:isoff-live:2011" type="static" mediapresentationduration="PT26.7S" maxsegmentduration="PT4.0S" minbuffertime="PT13.2S">&#xA;    <programinformation>&#xA;    </programinformation>&#xA;    <servicedescription>&#xA;    </servicedescription>&#xA;    <period start="PT0.0S">&#xA;        <adaptationset contenttype="video" startwithsap="1" segmentalignment="true" bitstreamswitching="true" framerate="30000/1001" maxwidth="1280" maxheight="720" par="16:9">&#xA;            <representation mimetype="video/mp4" codecs="avc1.7a001f" bandwidth="1000000" width="1280" height="720" sar="1:1">&#xA;                <segmenttemplate timescale="1000000" duration="4000000" initialization="video0-$RepresentationID$-$Number$.mp4" media="video0-$RepresentationID$-$Number$.mp4" startnumber="1">&#xA;                </segmenttemplate>&#xA;            </representation>&#xA;        </adaptationset>&#xA;    </period>&#xA;</mpd>&#xA;

    &#xA;&#xA;

    Is something about ffmpeg ? Permissions ? Pixel format ? Encoding ? I've tried with other mpd file provided by my Raspberry Pi using video4linux (v4l) and it returns the same error !

    &#xA;&#xA;

    I know that's a lot of code, but maybe you find it quicker than me. I guess it's a Shaka Player thing with the XML, but I can't explain how ffmpeg is wrongly creating XML code.

    &#xA;&#xA;

    Thank you in advance !!

    &#xA;

  • Revert "Revert "Merge commit ’d1d7678040cd60148f97b372cb4291bcc45b2e22’""

    4 août 2016, par Timothy Gu
    Revert "Revert "Merge commit ’d1d7678040cd60148f97b372cb4291bcc45b2e22’""
    

    This reverts commit e4af9be0f45c8f2ca148fb971f1e0c6782530e8c and redoes
    796027f22154c799e0063e2457b31e0cfd1dddae.

    Reviewed-by : Michael Niedermayer <michael@niedermayer.cc>

    • [DH] libavcodec/h264_slice.c
    • [DH] libavcodec/h264dec.c
    • [DH] libavcodec/h264dec.h