Recherche avancée

Médias (91)

Autres articles (42)

  • Submit enhancements and plugins

    13 avril 2011

    If you have developed a new extension to add one or more useful features to MediaSPIP, let us know and its integration into the core MedisSPIP functionality will be considered.
    You can use the development discussion list to request for help with creating a plugin. As MediaSPIP is based on SPIP - or you can use the SPIP discussion list SPIP-Zone.

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
    This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)

  • Les formats acceptés

    28 janvier 2010, par

    Les commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
    ffmpeg -codecs ffmpeg -formats
    Les format videos acceptés en entrée
    Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
    Les formats vidéos de sortie possibles
    Dans un premier temps on (...)

Sur d’autres sites (8044)

  • avformat : Auto-detect mjpeg 2000 in mpeg-ts

    11 octobre 2016, par Ståle Kristoffersen
    avformat : Auto-detect mjpeg 2000 in mpeg-ts
    

    This makes it possible to decode motion jpeg 2000
    encoded in a transport stream without a correct PMT/PAT.

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

    • [DH] libavformat/Makefile
    • [DH] libavformat/allformats.c
    • [DH] libavformat/mj2kdec.c
    • [DH] libavformat/utils.c
    • [DH] libavformat/version.h
  • Render an IDirect3DSurface9 from DXVA2 ?

    18 janvier 2019, par TTGroup

    I got a IDirect3DSurface9 from DXVA2 video decoder using hardware acceleration.

    I’m try to Render this hardware IDirect3DSurface9 on My Window via its handle. The following is my summary code.

    The first, I call dxva2_init(AVCodecContext *s, HWND hwnd) ; with hwnd is window’s handle

    int dxva2_init(AVCodecContext *s, HWND hwnd)
    {
       InputStream *ist = (InputStream *)s->opaque;
       int loglevel = (ist->hwaccel_id == HWACCEL_AUTO) ? AV_LOG_VERBOSE : AV_LOG_ERROR;
       DXVA2Context *ctx;
       int ret;

       if (!ist->hwaccel_ctx) {
           ret = dxva2_alloc(s);
           if (ret &lt; 0)
               return ret;
       }
       ctx = (DXVA2Context *)ist->hwaccel_ctx;
       ctx->deviceHandle = hwnd;
       if (s->codec_id == AV_CODEC_ID_H264 &amp;&amp;
           (s->profile &amp; ~FF_PROFILE_H264_CONSTRAINED) > FF_PROFILE_H264_HIGH) {
           av_log(NULL, loglevel, "Unsupported H.264 profile for DXVA2 HWAccel: %d\n", s->profile);
           return AVERROR(EINVAL);
       }

       if (ctx->decoder)
           dxva2_destroy_decoder(s);

       ret = dxva2_create_decoder(s);
       if (ret &lt; 0) {
           av_log(NULL, loglevel, "Error creating the DXVA2 decoder\n");
           return ret;
       }

       return 0;
    }

    After Decoding successful, I got got a IDirect3DSurface9, and I Render it by following function.

    int dxva2_render(AVCodecContext *s, AVFrame *frame)
    {
       LPDIRECT3DSURFACE9 surface = (LPDIRECT3DSURFACE9)frame->data[3];
       InputStream        *ist = (InputStream *)s->opaque;
       DXVA2Context       *ctx = (DXVA2Context *)ist->hwaccel_ctx;

       try
       {
           lockRenderCS.Enter();
           HRESULT hr = ctx->d3d9device->Clear(0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(255, 0, 0), 1.0f, 0);
           if (hr != D3D_OK)
               return 0;

           hr = ctx->d3d9device->BeginScene();
           if (hr != D3D_OK)
               return 0;

           hr = ctx->d3d9device->GetBackBuffer(0, 0, D3DBACKBUFFER_TYPE_MONO, &amp;pBackBuffer);
           if (hr != D3D_OK)
               return 0;

           hr = ctx->d3d9device->StretchRect(surface, NULL, pBackBuffer, NULL, D3DTEXF_LINEAR);
           if (hr != D3D_OK)
               return 0;

           hr = ctx->d3d9device->EndScene();
           if (hr != D3D_OK)
               return 0;

           hr = ctx->d3d9device->Present(NULL, NULL, NULL, NULL);
           if (hr != D3D_OK)
               return 0;
       }
       finally
       {
           lockRenderCS.Leave();
       }
       return 0;
    }

    Note : All D3D function above : Clear(), BeginScene(), GetBackBuffer(), StretchRect(), EndScene(), Present() were return Successful. But the frame was not display on My Window.

    I Guess that, I miss some code for integrated My Window Handle with DXVA2Context. In this code I only assign : ctx->deviceHandle = hwnd; in function dxva2_init().

    I search many times, but so far I still cannot find the solution, Anyone can help me ?

    Many Thanks !

  • Electron and NodeJS : Execute shell command asyncronously with live stream

    28 septembre 2020, par Bruno Freire

    Electron : get file conversion percent in real-time :

    &#xA;

    I wanna run the command ffmpeg -i video.mp4 (example) to convert a video into another format. But I want to get the conversion percent that is streamed in the process output and get it in my Electron App or NodeJS.

    &#xA;

    I've tried all methods : spawn fork exec and all of them return me the last line of the process output. I want a LIVE Stream of each line that is been written, to show the percent progress.

    &#xA;

    I've tried :

    &#xA;

    Fork

    &#xA;

    const {fork} = require(&#x27;child_process&#x27;)&#xA;    const forked = fork(&#x27;ffmpeg -i video.mp4&#x27;);&#xA;    forked.on(&#x27;message&#x27;, (msg) => {&#xA;        console.log(msg);&#xA;})&#xA;

    &#xA;

    Exec Alternative 1

    &#xA;

    const execFile = require(&#x27;child_process&#x27;).execFile;&#xA;    execFile(&#x27;ffmpeg -i video.mp4&#x27;, [], (e, stdout, stderr) => {&#xA;        if (e instanceof Error){&#xA;            console.error(e);&#xA;            &#xA;        }&#xA;        console.log(&#x27;stdout &#x27;, stdout)&#xA;        console.log(&#x27;stderr &#x27;, stderr);&#xA;})&#xA;

    &#xA;

    Exec Alternative 2

    &#xA;

    const exec = require(&#x27;child_process&#x27;).exec;&#xA;    exec(&#x27;ffmpeg -i video.mp4&#x27;, (error, stdout, stderr) => { &#xA;       console.log(stdout); &#xA;});&#xA;&#xA;/*EXEC Alternative 2*/&#xA;const exec = require(&#x27;child_process&#x27;).exec;&#xA;const proccessing = exec(&#x27;ffmpeg -i video.mp4&#x27;);&#xA;proccessing.stdout.on(&#x27;data&#x27;, function(data) {&#xA;  console.log(data); &#xA;});&#xA;proccessing.stdout.pipe(process.stdout);&#xA;

    &#xA;

    Spawn

    &#xA;

    const spawn = require(&#x27;child_process&#x27;).spawn,&#xA;const processing = spawn(&#x27;ffmpeg -i video.mp4&#x27;);&#xA;&#xA;processing .stdout.on(&#x27;data&#x27;, function (data) {&#xA;   console.log(&#x27;stdout: &#x27; &#x2B; data.toString());&#xA;});&#xA;&#xA;processing .stderr.on(&#x27;data&#x27;, function (data) {&#xA;   console.log(&#x27;stderr: &#x27; &#x2B; data.toString());&#xA;});&#xA;&#xA;processing .on(&#x27;exit&#x27;, function (code) {&#xA;   console.log(&#x27;code &#x27; &#x2B; code.toString());&#xA;});&#xA;

    &#xA;

    SUMMARY :

    &#xA;