Recherche avancée

Médias (0)

Mot : - Tags -/configuration

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

Autres articles (94)

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

  • Les sons

    15 mai 2013, par
  • Gestion de la ferme

    2 mars 2010, par

    La ferme est gérée dans son ensemble par des "super admins".
    Certains réglages peuvent être fais afin de réguler les besoins des différents canaux.
    Dans un premier temps il utilise le plugin "Gestion de mutualisation"

Sur d’autres sites (5986)

  • Unable to build solution in Visual Studio 2019 : The BaseOutputPath/OutputPath property is not set for project

    23 juillet 2022, par mhadi

    In an effort to integrate FFmpeg with Unity, I have been trying to build a solution file in Visual Studio 2019. However, I am currently unable to resolve the following error when I try to build in Visual Studio :

    


    


    The BaseOutputPath/OutputPath property is not set for project
'FFmpegUnityInterop.vcxproj'. Please check to make sure that you have
specified a valid combination of Configuration and Platform for this
project. Configuration='Release' Platform='x64'. This error may
also appear if some other project is trying to follow a
project-to-project reference to this project, this project has been
unloaded or is not included in the solution, and the referencing
project does not build using the same or an equivalent Configuration
or Platform.

    


    


    I have tried a number of solutions, including :

    


      

    1. Manually adding the OutputPath in 'FFmpegUnityInterop.vcxproj'&#xA;<outputpath>bin/Build/</outputpath>.
    2. &#xA;

    3. In the FFmpegUnityInterop.vcxproj file, moving the ProjectProperty with my preferred configuration and platform combination to the very top of the list of ProjectProperties (there are 8 of them).
    4. &#xA;

    5. Building with different configuration and platforms.
    6. &#xA;

    7. Trying to build from VS Dev Command prompt using the following command :&#xA;MSbuild.exe "FFmpegUnityInterop.sln" /p:Configuration=Release /p:Platform="x64", as well as from the Visual Studio IDE.
    8. &#xA;

    9. Tried setting the OutputPath in the command line command&#xA;(>MSbuild.exe FFmpegUnityInterop.sln /p:Configuration=Release /p:Platform="AnyCPU" /p:OutputPath = bin\Debug), only to have&#xA;MSbuild throw error MSB1008 (MSBUILD : error MSB1008 : Only one&#xA;project can be specified.)
    10. &#xA;

    11. Setting the configuration and platform manually in the Configuration Manager GUI in&#xA;Visual Studio.
    12. &#xA;

    &#xA;

    I may have missed an attempted solution or two above, but I've tried most of the suggestions I found online, only to get the error pasted above. Part of me suspects that my compilation of FFmpeg libraries didn't execute fully, but I unfortunately do not have enough experience to verify that. Any suggestions to resolve this would be much appreciated.

    &#xA;

    PS. The project was developed privately by a private entity that is currently unreachable

    &#xA;

  • FFMPEG using AV_PIX_FMT_D3D11 gives "Error registering the input resource" from NVENC

    13 novembre 2024, par nbabcock

    Input frames start on the GPU as ID3D11Texture2D pointers.

    &#xA;

    I encode them to H264 using FFMPEG + NVENC. NVENC works perfectly if I download the textures to CPU memory as format AV_PIX_FMT_BGR0, but I'd like to cut out the CPU texture download entirely, and pass the GPU memory pointer directly into the encoder in native format. I write frames like this :

    &#xA;

    int write_gpu_video_frame(ID3D11Texture2D* gpuTex, AVFormatContext* oc, OutputStream* ost) {&#xA;    AVFrame *hw_frame = ost->hw_frame;&#xA;&#xA;    printf("gpuTex address = 0x%x\n", &amp;gpuTex);&#xA;&#xA;    hw_frame->data[0] = (uint8_t *) gpuTex;&#xA;    hw_frame->data[1] = (uint8_t *) (intptr_t) 0;&#xA;    hw_frame->pts     = ost->next_pts&#x2B;&#x2B;;&#xA;&#xA;    return write_frame(oc, ost->enc, ost->st, hw_frame);&#xA;    // write_frame is identical to sample code in ffmpeg repo&#xA;}&#xA;

    &#xA;

    Running the code with this modification gives the following error :

    &#xA;

    gpuTex address = 0x4582f6d0&#xA;[h264_nvenc @ 00000191233e1bc0] Error registering an input resource: invalid call (9):&#xA;[h264_nvenc @ 00000191233e1bc0] Could not register an input HW frame&#xA;Error sending a frame to the encoder: Unknown error occurred&#xA;

    &#xA;


    &#xA;

    Here's some supplemental code used in setting up and configuring the hw context and encoder :

    &#xA;

    /* A few config flags */&#xA;#define ENABLE_NVENC TRUE&#xA;#define USE_D3D11 TRUE // Skip downloading textures to CPU memory and send it straight to NVENC&#xA;

    &#xA;

    /* Init hardware frame context */&#xA;static int set_hwframe_ctx(AVCodecContext* ctx, AVBufferRef* hw_device_ctx) {&#xA;    AVBufferRef*       hw_frames_ref;&#xA;    AVHWFramesContext* frames_ctx = NULL;&#xA;    int                err        = 0;&#xA;&#xA;    if (!(hw_frames_ref = av_hwframe_ctx_alloc(hw_device_ctx))) {&#xA;        fprintf(stderr, "Failed to create HW frame context.\n");&#xA;        throw;&#xA;    }&#xA;    frames_ctx                    = (AVHWFramesContext*) (hw_frames_ref->data);&#xA;    frames_ctx->format            = AV_PIX_FMT_D3D11;&#xA;    frames_ctx->sw_format         = AV_PIX_FMT_NV12;&#xA;    frames_ctx->width             = STREAM_WIDTH;&#xA;    frames_ctx->height            = STREAM_HEIGHT;&#xA;    //frames_ctx->initial_pool_size = 20;&#xA;    if ((err = av_hwframe_ctx_init(hw_frames_ref)) &lt; 0) {&#xA;        fprintf(stderr, "Failed to initialize hw frame context. Error code: %s\n", av_err2str(err));&#xA;        av_buffer_unref(&amp;hw_frames_ref);&#xA;        throw;&#xA;    }&#xA;    ctx->hw_frames_ctx = av_buffer_ref(hw_frames_ref);&#xA;    if (!ctx->hw_frames_ctx)&#xA;        err = AVERROR(ENOMEM);&#xA;&#xA;    av_buffer_unref(&amp;hw_frames_ref);&#xA;    return err;&#xA;}&#xA;

    &#xA;

    /* Add an output stream. */&#xA;static void add_video_stream(&#xA;    OutputStream* ost,&#xA;    AVFormatContext* oc,&#xA;    const AVCodec** codec,&#xA;    enum AVCodecID  codec_id,&#xA;    int width,&#xA;    int height&#xA;) {&#xA;    AVCodecContext* c;&#xA;    int             i;&#xA;    bool            nvenc = false;&#xA;&#xA;    /* find the encoder */&#xA;    if (ENABLE_NVENC) {&#xA;        printf("Getting nvenc encoder\n");&#xA;        *codec = avcodec_find_encoder_by_name("h264_nvenc");&#xA;        nvenc  = true;&#xA;    }&#xA;    &#xA;    if (!ENABLE_NVENC || *codec == NULL) {&#xA;        printf("Getting standard encoder\n");&#xA;        avcodec_find_encoder(codec_id);&#xA;        nvenc = false;&#xA;    }&#xA;    if (!(*codec)) {&#xA;        fprintf(stderr, "Could not find encoder for &#x27;%s&#x27;\n",&#xA;                avcodec_get_name(codec_id));&#xA;        exit(1);&#xA;    }&#xA;&#xA;    ost->st = avformat_new_stream(oc, NULL);&#xA;    if (!ost->st) {&#xA;        fprintf(stderr, "Could not allocate stream\n");&#xA;        exit(1);&#xA;    }&#xA;    ost->st->id = oc->nb_streams - 1;&#xA;    c           = avcodec_alloc_context3(*codec);&#xA;    if (!c) {&#xA;        fprintf(stderr, "Could not alloc an encoding context\n");&#xA;        exit(1);&#xA;    }&#xA;    ost->enc = c;&#xA;&#xA;    printf("Using video codec %s\n", avcodec_get_name(codec_id));&#xA;&#xA;    c->codec_id = codec_id;&#xA;    c->bit_rate = 4000000;&#xA;    /* Resolution must be a multiple of two. */&#xA;    c->width  = STREAM_WIDTH;&#xA;    c->height = STREAM_HEIGHT;&#xA;    /* timebase: This is the fundamental unit of time (in seconds) in terms&#xA;        * of which frame timestamps are represented. For fixed-fps content,&#xA;        * timebase should be 1/framerate and timestamp increments should be&#xA;        * identical to 1. */&#xA;    ost->st->time_base = {1, STREAM_FRAME_RATE};&#xA;    c->time_base       = ost->st->time_base;&#xA;    c->gop_size = 12; /* emit one intra frame every twelve frames at most */&#xA;&#xA;    if (nvenc &amp;&amp; USE_D3D11) {&#xA;        const std::string hw_device_name = "d3d11va";&#xA;        AVHWDeviceType    device_type    = av_hwdevice_find_type_by_name(hw_device_name.c_str());&#xA;&#xA;        // set up hw device context&#xA;        AVBufferRef *hw_device_ctx;&#xA;        // const char*  device = "0"; // Default GPU (may be integrated in the case of switchable graphics!)&#xA;        const char*  device = "1";&#xA;        ret = av_hwdevice_ctx_create(&amp;hw_device_ctx, device_type, device, nullptr, 0);&#xA;&#xA;        if (ret &lt; 0) {&#xA;            fprintf(stderr, "Could not create hwdevice context; %s", av_err2str(ret));&#xA;        }&#xA;&#xA;        set_hwframe_ctx(c, hw_device_ctx);&#xA;        c->pix_fmt = AV_PIX_FMT_D3D11;&#xA;    } else if (nvenc &amp;&amp; !USE_D3D11)&#xA;        c->pix_fmt = AV_PIX_FMT_BGR0;&#xA;    else&#xA;        c->pix_fmt = STREAM_PIX_FMT;&#xA;&#xA;    if (c->codec_id == AV_CODEC_ID_MPEG2VIDEO) {&#xA;        /* just for testing, we also add B-frames */&#xA;        c->max_b_frames = 2;&#xA;    }&#xA;&#xA;    if (c->codec_id == AV_CODEC_ID_MPEG1VIDEO) {&#xA;        /* Needed to avoid using macroblocks in which some coeffs overflow.&#xA;            * This does not happen with normal video, it just happens here as&#xA;            * the motion of the chroma plane does not match the luma plane. */&#xA;        c->mb_decision = 2;&#xA;    }&#xA;&#xA;    /* Some formats want stream headers to be separate. */&#xA;    if (oc->oformat->flags &amp; AVFMT_GLOBALHEADER)&#xA;        c->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;&#xA;}&#xA;

    &#xA;

  • FFmpeg Integration in .NET MAUI for Android [closed]

    15 juin 2024, par Billy Vanegas

    I'm facing a challenge with integrating FFmpeg into my .NET MAUI project for Android. While everything works smoothly on Windows with Visual Studio 2022, I'm having a hard time replicating this on the Android platform. Despite exploring various NuGet packages like FFMpegCore, which appear to be wrappers around FFmpeg but don't include FFmpeg itself, I'm still at a loss.

    &#xA;

    I've tried following the instructions for integrating ffmpeg-kit for Android, but I keep running into issues, resulting in repeated failures and growing confusion. It feels like there is no straightforward way to seamlessly incorporate FFmpeg into a .NET MAUI project that works consistently across both iOS and Android.

    &#xA;

    The Problem :

    &#xA;

    I need to convert MP3 files to WAV format using FFmpeg on the Android platform within a .NET MAUI project. I’m using the FFMpegCore library and have downloaded the FFmpeg binaries from the official FFmpeg website.

    &#xA;

    However, when attempting to use these binaries on an Android emulator, I encounter a permission denied error in the working directory : /data/user/0/com.companyname.projectname/files/ffmpeg

    &#xA;

    Here’s the code snippet where the issue occurs :

    &#xA;

    await FFMpegArguments&#xA;      .FromFileInput(mp3Path)&#xA;      .OutputToFile(wavPath, true, options => options&#xA;          .WithAudioCodec("pcm_s16le")&#xA;          .WithAudioSamplingRate(44100)&#xA;          .WithAudioBitrate(320000)&#xA;          )&#xA;      .ProcessAsynchronously();&#xA;    &#xA;

    &#xA;

    I've updated AndroidManifest.xml with permissions, but the issue persists.

    &#xA;

    I've created a method ConvertMp3ToWav to handle the conversion.&#xA;I also have a method ExtractFFmpegBinaries to manage FFmpeg binaries extraction, but it seems the permission issue might be tied to how these binaries are accessed or executed.

    &#xA;

    AndroidManifest.xml :

    &#xA;

    &lt;?xml version="1.0" encoding="utf-8"?>&#xA;<manifest>&#xA;    <application></application>&#xA;    &#xA;    &#xA;    &#xA;    &#xA;</manifest>&#xA;

    &#xA;

    Method ConvertMp3ToWav :

    &#xA;

    private async Task ConvertMp3ToWav(string mp3Path, string wavPath)&#xA;{&#xA;    try&#xA;    {&#xA;        // Check directory and create if not exists&#xA;        var directory = Path.GetDirectoryName(wavPath);&#xA;        if (!Directory.Exists(directory))&#xA;            Directory.CreateDirectory(directory!);&#xA;&#xA;        // Check if WAV file exists&#xA;        if (!File.Exists(wavPath))&#xA;            Console.WriteLine($"File not found {wavPath}, creating empty file.");&#xA;            using var fs = new FileStream(wavPath, FileMode.CreateNew);&#xA;&#xA;        // Check if MP3 file exists&#xA;        if (!File.Exists(mp3Path))&#xA;            Console.WriteLine($"File not found {mp3Path}");&#xA;&#xA;        // Extract FFmpeg binaries&#xA;        string? ffmpegBinaryPath = await ExtractFFmpegBinaries(Platform.AppContext);&#xA;&#xA;        // Configure FFmpeg options&#xA;        FFMpegCore.GlobalFFOptions.Configure(new FFOptions { BinaryFolder = Path.GetDirectoryName(ffmpegBinaryPath!)! });&#xA;&#xA;        // Convert MP3 to WAV&#xA;        await FFMpegArguments&#xA;              .FromFileInput(mp3Path)&#xA;              .OutputToFile(wavPath, true, options => options&#xA;                  .WithAudioCodec("pcm_s16le")&#xA;                  .WithAudioSamplingRate(44100)&#xA;                  .WithAudioBitrate(320000)&#xA;                  )&#xA;              .ProcessAsynchronously();&#xA;    }&#xA;    catch (Exception ex)&#xA;    {&#xA;        Console.WriteLine($"An error occurred during the conversion process: {ex.Message}");&#xA;        throw;&#xA;    }&#xA;}&#xA;

    &#xA;

    Method ExtractFFmpegBinaries :

    &#xA;

    private async Task<string> ExtractFFmpegBinaries(Context context)&#xA;{&#xA;    var architectureFolder = "x86"; // Adjust according to device architecture&#xA;    var ffmpegBinaryName = "ffmpeg"; &#xA;    var ffmpegBinaryPath = Path.Combine(context.FilesDir!.AbsolutePath, ffmpegBinaryName);&#xA;    var tempFFMpegFileName = Path.Combine(FileSystem.AppDataDirectory, ffmpegBinaryName);&#xA;&#xA;    if (!File.Exists(ffmpegBinaryPath))&#xA;    {&#xA;        try&#xA;        {&#xA;            var assetPath = $"Libs/{architectureFolder}/{ffmpegBinaryName}";&#xA;            using var assetStream = context.Assets!.Open(assetPath);&#xA;           &#xA;            await using var tempFFMpegFile = File.OpenWrite(tempFFMpegFileName);&#xA;            await assetStream.CopyToAsync(tempFFMpegFile);&#xA;&#xA;            // Adjust permissions for FFmpeg binary&#xA;            Java.Lang.Runtime.GetRuntime()!.Exec($"chmod 755 {tempFFMpegFileName}");&#xA;        }&#xA;        catch (Exception ex)&#xA;        {&#xA;            Console.WriteLine($"An error occurred while extracting FFmpeg binaries: {ex.Message}");&#xA;            throw;&#xA;        }&#xA;    }&#xA;    else&#xA;    {&#xA;        Console.WriteLine($"FFmpeg binaries already extracted to: {ffmpegBinaryPath}");&#xA;    }&#xA;&#xA;    return tempFFMpegFileName!;&#xA;}&#xA;</string>

    &#xA;

    What I Need :

    &#xA;

    How to correctly integrate and use FFmpeg in my .NET MAUI project for Android ? Specifically :

    &#xA;

      &#xA;
    • How to properly set up and configure FFmpeg binaries for use on Android within a .NET MAUI project.
    • &#xA;

    • How to resolve the permission denied issue when attempting to execute FFmpeg binaries.
    • &#xA;

    &#xA;