Recherche avancée

Médias (29)

Mot : - Tags -/Musique

Autres articles (77)

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

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

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

Sur d’autres sites (8583)

  • 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 < 0)
               return ret;
       }
       ctx = (DXVA2Context *)ist->hwaccel_ctx;
       ctx->deviceHandle = hwnd;
       if (s->codec_id == AV_CODEC_ID_H264 &&
           (s->profile & ~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 < 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, &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 !

  • Issue with image using ffmpeg to combining it on PHP

    8 mai 2017, par 7sega7

    I’m trying to combine images with ffmpeg on PHP.

    First, I save the image with this and resizing then :

    $imagen = file_get_contents($_SESSION['img']);
    file_put_contents('img_prod.jpg', $imagen);
    $img = resize_imagejpg('img_prod.jpg', 650,360);
    imagejpeg($img, 'img_prod.jpg');

    Then I create a png with only a title or info. At the moment I’m giving the text with a form, later I’ll do with BD.
    For this I’m using the imagettftext :

    titulo = explode("-", $_SESSION['title']);
    $im = imagecreatetruecolor(400, 30);
    $white= imagecolorallocate($im, 255, 255, 255);
    $black= imagecolorallocate($im, 0, 0, 0);
    imagefilledrectangle($im, 0, 0, 399, 29, $white);
    $font= 'Comfortaa.ttf';
    imagettftext($im, 10, 0, 15, 10, $black, $font, $titulo[$i]);
    imagepng($im, "img_con_texto.png");
    imagedestroy($im);

    What I’m doing here is, first I get the Title for my form, and with the explode, every time I read a "-", I put all the text in another line. I simplified this on the code quote por easy read.
    Then I create the color, I filled the all rectangle with one color, pick the font and put the font, color font and the text on a image and destroy the variable for using again with another text.

    At the end, I use ffmpeg to put the image for "file_get_contents" and the image with the text.

    echo shell_exec('ffmpeg -y -i marco.png -i img_prod.jpg -filter_complex "overlay=20:(main_h-overlay_h)/2" out_img_prod.jpg')

    The "marco.png" it is just a white image with no contents. I open paint, change the resize pixels for 850/480 and saving that as marco.png.

    Then I add the text on the right side with the last image :

    echo shell_exec('ffmpeg -y -i out_img_prod.jpg -i img_con_texto.png -filter_complex "overlay=500:140" prod_title.jpg');

    The issue is that, when I do this, the text have a light gray color on the background. When I create the img with the text, It have white background color and it is a .png So I don’t know why It have that gray background color.
    This is the image from the last code : image with text

    If I did the same with paint or gimp, adding mannualy the text on the image on the left, the background gray color dissapear so, It is possible to quit that light grey color ?

    PD : I quit some code for a simple read, so maybe I miss to quit variables. Also, If the img is more smaller and the text don’t collide with the text, the light gray color still there.

  • Bye Bye FATE Machine

    4 septembre 2010, par Multimedia Mike — FATE Server

    This is the computer that performed the lion’s share of FATE cycles for the past 1.5 years before Mans put a new continuous integration system into service. I’ve now decided to let the machine go. I can’t get over how odd this feels since this thing is technically the best machine I own.



    It’s a small form factor Shuttle PC (SD37P2 v2) ; Core 2 Duo 2.13 GHz ; 2 GB RAM ; 400 GB SATA HD ; equipped with the only consistently functional optical drive in my house (uh oh). I used it as my primary desktop from March 2007 – November 2008, at which point I repurposed it for FATE cycles.

    As mentioned, the craziest part is that this is technically the best computer in my house. My new EeePC 1201PN isn’t at quite the same level ; my old EeePC can’t touch it, of course ; the Mac Mini has a little more RAM but doesn’t stack up in nearly all other areas. But the Shuttle just isn’t seeing that much use since the usurpation. I had it running automated backup duty for multimedia.cx but that’s easy enough to move to another, lower-powered system.

    Maybe the prognosticators are correct and the PC industry has matured to the point where raw computing power simply doesn’t matter anymore. I fancy myself as someone who knows how to put CPU power to work but even I don’t know what to do with the computing capacity I purchased over 3 years ago.

    Where will the Shuttle go ? A good home, I trust– I know a family that just arrived in the country and could use a computer.