Recherche avancée

Médias (1)

Mot : - Tags -/punk

Autres articles (102)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

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

Sur d’autres sites (10694)

  • Replace Special Characters In Batch-File Variable Feeding FFMPEG Programme

    6 janvier 2019, par whereswaller

    I am attempting to write a batch-file that leverages the FFMPEG programme to convert all files in a folder structure to mp3 format (specifically 128kbps).

    My batch-file is presently unable to process filenames (constructed by concatenating the %_SOURCE% and %% F variables) containing certain special characters, for example :


     
    "
    ö

    How can I modify my script so that the %% F variable escapes these characters correctly ?

    Example current filename input : "C :\Users\Test\Documents\Input\Peter Bjorn And John - I Know You Don’t Love Me.mp3"

    Example desired filename input : "C :\Users\Test\Documents\Input\Peter Bjorn And John - I Know You Don"^’"t Love Me.mp3"

    Script (see line beginning "C :\ffmpeg\bin\ffmpeg.exe") :

    @echo off
    setlocal EnableExtensions DisableDelayedExpansion

    rem // Define constants here:
    set "_SOURCE=C:\Users\Test\Documents\Input" & rem // (absolute source path)
    set "_TARGET=C:\Users\Test\Documents\Output"  & rem // (absolute target path)
    set "_PATTERN=*.*" & rem // (pure file pattern for input files)
    set "_FILEEXT=.mp3"   & rem // (pure file extension of output files)

    pushd "%_TARGET%" || exit /B 1
    for /F "delims=" %%F in ('
       cd /D "%_SOURCE%" ^&^& ^(rem/ list but do not copy: ^
           ^& xcopy /L /S /Y /I ".\%_PATTERN%" "%_TARGET%" ^
           ^| find ".\" ^& rem/ remove summary line;
       ^)
    ') do (
       2> nul mkdir "%%~dpF.

       rem // Set up the correct `ffmpeg` command line here:
       set "FFREPORT=file=C\:\\Users\\Test\\Documents\\Output\\ffreport-%%~F.log:level=32"
       "C:\ffmpeg\bin\ffmpeg.exe" -report -n -i "%_SOURCE%\%%~F" -vn -c:a libmp3lame -b:a 128k "%%~dpnF%_FILEEXT%"
       if not errorlevel 1  if exist "%%~dpnF%_FILEEXT%" del /f /q "%_SOURCE%\%%~F"

    )
    popd

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

    28 septembre 2020, par Bruno Freire

    Electron : get file conversion percent in real-time :

    


    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.

    


    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.

    


    I've tried :

    


    Fork

    


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


    


    Exec Alternative 1

    


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


    


    Exec Alternative 2

    


    const exec = require('child_process').exec;
    exec('ffmpeg -i video.mp4', (error, stdout, stderr) => { 
       console.log(stdout); 
});

/*EXEC Alternative 2*/
const exec = require('child_process').exec;
const proccessing = exec('ffmpeg -i video.mp4');
proccessing.stdout.on('data', function(data) {
  console.log(data); 
});
proccessing.stdout.pipe(process.stdout);


    


    Spawn

    


    const spawn = require('child_process').spawn,
const processing = spawn('ffmpeg -i video.mp4');

processing .stdout.on('data', function (data) {
   console.log('stdout: ' + data.toString());
});

processing .stderr.on('data', function (data) {
   console.log('stderr: ' + data.toString());
});

processing .on('exit', function (code) {
   console.log('code ' + code.toString());
});


    


    SUMMARY :

    


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