Recherche avancée

Médias (0)

Mot : - Tags -/formulaire

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

Autres articles (66)

  • 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

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

  • Sélection de projets utilisant MediaSPIP

    29 avril 2011, par

    Les exemples cités ci-dessous sont des éléments représentatifs d’usages spécifiques de MediaSPIP pour certains projets.
    Vous pensez avoir un site "remarquable" réalisé avec MediaSPIP ? Faites le nous savoir ici.
    Ferme MediaSPIP @ Infini
    L’Association Infini développe des activités d’accueil, de point d’accès internet, de formation, de conduite de projets innovants dans le domaine des Technologies de l’Information et de la Communication, et l’hébergement de sites. Elle joue en la matière un rôle unique (...)

Sur d’autres sites (4097)

  • How to set AVCodecContext args with h264 correctly ?

    15 juin 2017, par wzjing

     I’m doing a video transcoder demo with ffmpeg lib and libx264 lib. I already can transcode video successully, but the output video can only play by some powerful player like VLC. I need it can be played by the Win10 default player and the Android default player. I hava found the reason may be encode AVCodecContext args. I try to copy those args frome decode AVCodecContext, the output can be played by Win10 defualt player, but the video became totally black.
     Here is my encode AVCodecContext args :

           encoder = avcodec_find_encoder(AV_CODEC_ID_H264);

           if (!encoder) {
               av_log(NULL, AV_LOG_FATAL, "Necessary encoder not found\n");
               return AVERROR_INVALIDDATA;
           }
           enc_ctx = avcodec_alloc_context3(encoder);
           enc_ctx->height = output_height;
           enc_ctx->width = output_width;
           enc_ctx->sample_aspect_ratio = dec_ctx->sample_aspect_ratio;
           enc_ctx->bit_rate = 1000000;

           /* take first format from list of supported formats */
           if (encoder->pix_fmts)
               enc_ctx->pix_fmt = AV_PIX_FMT_YUV420P;
           else
               enc_ctx->pix_fmt = dec_ctx->pix_fmt;

           enc_ctx->time_base = av_inv_q(dec_ctx->framerate);
           enc_ctx->gop_size = 12;
           av_opt_set(enc_ctx->priv_data, "preset", "slow", 0);
           av_opt_set(enc_ctx->priv_data, "tune", "zerolatency", 0);

           enc_ctx->profile = FF_PROFILE_H264_HIGH;
           enc_ctx->codec_type = AVMEDIA_TYPE_VIDEO;      

           enc_ctx->codec_tag = 0;
  • Can not use the jsmpeg in react "Unexpected use of 'self'"

    5 mai 2020, par Muhammad Anas Khan

    code that i want to convert in React

    



     &#xA;    &#xA;    <code class="echappe-js">&lt;script type=&quot;text/javascript&quot; src='http://stackoverflow.com/feeds/tag/jsmpeg.min.js'&gt;&lt;/script&gt;&#xA;&#xA;    &lt;script type=&quot;text/javascript&quot;&gt;&amp;#xA;      var canvas = document.getElementById(&quot;videoCanvas&quot;);&amp;#xA;      console.log(document.location.hostname);&amp;#xA;     var url = &quot;ws://localhost:9999/&quot;;&amp;#xA;    &lt;/script&gt;&#xA;    &#xA;&#xA;

    &#xA;&#xA;

    Can not change it to react format.When i try to convert it is giving jsmpeg error &#xA;i.e

    &#xA;&#xA;

    code that i tried but get an error

    &#xA;&#xA;

    import React from &#x27;react&#x27;;&#xA;import ReactDOM from &#x27;react-dom&#x27;;&#xA;import "./jsmpeg.min.js"&#xA;const App =()=>{&#xA;    return(&#xA;        <h1>Hello</h1>&#xA;    )&#xA;}&#xA;&#xA;&#xA;ReactDOM.render(<app></app>,document.getElementById(&#x27;root&#x27;));&#xA;

    &#xA;&#xA;

    Error

    &#xA;&#xA;

    /src/jsmpeg.min.js&#xA;Line 606:9 : Unexpected use of 'self' no-restricted-globals&#xA; Line 2771:13 : Expected an assignment or function call and instead saw an expression no-unused-expressions

    &#xA;&#xA;

    Search for the keywords to learn more about each error.

    &#xA;

  • FFMPEG rtmp stream slow and only works on chrome

    18 juin 2023, par DrMeepso

    I am trying to stream to twitch from a Node.js script for fun ! so far i have got it working but its slow and seemingly limited to 10-12 fps.

    &#xA;

    Here is my code, i am trying to stream a Node-Canvas to twitch so i can do stuff without the overhead of OBS and in a console :

    &#xA;

    import { createCanvas } from &#x27;canvas&#x27;;&#xA;import { spawn } from &#x27;child_process&#x27;&#xA;import fs from &#x27;fs&#x27;;&#xA;&#xA;const canvas = createCanvas(1920, 1080);&#xA;const ctx = canvas.getContext(&#x27;2d&#x27;);&#xA;// create a ffmpeg process that will stream the canvas to a rtmp server&#xA;const ffmpeg = spawn(&#x27;ffmpeg&#x27;, [&#xA;    &#x27;-re&#x27;, // read input at native frame rate&#xA;    &#x27;-f&#x27;, &#x27;image2pipe&#x27;, // tell ffmpeg to expect raw image stream&#xA;    &#x27;-vcodec&#x27;, &#x27;png&#x27;, // tell ffmpeg to expect jpeg encoded images&#xA;    &#x27;-r&#x27;, &#x27;10&#x27;, // tell ffmpeg to expect 60 fps&#xA;    &#x27;-s&#x27;, &#x27;1920x1080&#x27;, // tell ffmpeg to expect size 1920x1080&#xA;    &#x27;-i&#x27;, &#x27;-&#x27;, // tell ffmpeg to expect input from stdin&#xA;    //&#x27;-c:v&#x27;, &#x27;h264_amf&#x27;, // tell ffmpeg to encode in h264 codec AMD&#xA;    &#x27;-c:v&#x27;, &#x27;libx264&#x27;, // tell ffmpeg to encode in h264 codec&#xA;    &#x27;-pix_fmt&#x27;, &#x27;yuv420p&#x27;, // tell ffmpeg to encode in yuv420p format&#xA;    &#x27;-preset&#x27;, &#x27;ultrafast&#x27;, // tell ffmpeg to use ultrafast encoding preset&#xA;    &#x27;-g&#x27;, &#x27;20&#x27;, // set the keyframe interval to 2 seconds so twitch will not reject the stream&#xA;    &#x27;-f&#x27;, &#x27;flv&#x27;, // tell ffmpeg that we are going to stream flv video&#xA;    "rtmp://live.restream.io/live/"&#xA;]);&#xA;&#xA;ffmpeg.on(&#x27;close&#x27;, (code, signal) => {&#xA;    console.log(&#x27;FFmpeg child process closed, code &#x27; &#x2B; code &#x2B; &#x27;, signal &#x27; &#x2B; signal);&#xA;})&#xA;&#xA;ffmpeg.on(&#x27;error&#x27;, (err) => {&#xA;    console.log(&#x27;FFmpeg child process error: &#x27; &#x2B; err.message);&#xA;})&#xA;&#xA;ffmpeg.stderr.on(&#x27;data&#x27;, (data) => {&#xA;    //console.log(&#x27;FFmpeg stderr: &#x27; &#x2B; data);&#xA;    //ParseFFPMPEGOutput(data.toString());&#xA;})&#xA;&#xA;ffmpeg.stdout.on(&#x27;data&#x27;, (data) => {&#xA;    console.log(&#x27;FFmpeg stdout: &#x27; &#x2B; data);&#xA;})&#xA;&#xA;var DrawingCatagorys: string[] = []&#xA;fs.readFileSync(&#x27;categories.txt&#x27;).toString().split(&#x27;\n&#x27;).forEach(function (line) { DrawingCatagorys.push(line); })&#xA;&#xA;function ParseFFPMPEGOutput(data: string) {&#xA;&#xA;    if (data.includes(&#x27;frame=&#x27;)) {&#xA;        let frame = data.split(&#x27;frame=&#x27;)[1].split(&#x27;fps&#x27;)[0].trim();&#xA;        let fps = data.split(&#x27;fps=&#x27;)[1].split(&#x27;q=&#x27;)[0].trim();&#xA;        let size = data.split(&#x27;size=&#x27;)[1].split(&#x27;time=&#x27;)[0].trim();&#xA;        let time = data.split(&#x27;time=&#x27;)[1].split(&#x27;bitrate=&#x27;)[0].trim();&#xA;        let bitrate = data.split(&#x27;bitrate=&#x27;)[1].split(&#x27;speed=&#x27;)[0].trim();&#xA;&#xA;        console.log(`Frame: ${frame} FPS: ${fps} Size: ${size} Time: ${time} Bitrate: ${bitrate}`);&#xA;    }&#xA;&#xA;}&#xA;&#xA;// create a png stream&#xA;setInterval(() => {&#xA;    // convert canvas to png&#xA;    const buffer = canvas.toBuffer(&#x27;image/png&#x27;);&#xA;    // write png stream to stdin of ffmpeg process&#xA;    ffmpeg.stdin.write(buffer);&#xA;}, 2);&#xA;

    &#xA;

    Im thinking it has to do with Node-Canvas just being slow but i have no idea, also even on my gaming rig it cant pull 1x speed while streaming always sitting around 0.95 - 0.98 and about 9.2 fps. also it only works on chrome and not firefox ? i have no idea why probably a codec thing

    &#xA;