Recherche avancée

Médias (91)

Autres articles (112)

  • Soumettre améliorations et plugins supplémentaires

    10 avril 2011

    Si vous avez développé une nouvelle extension permettant d’ajouter une ou plusieurs fonctionnalités utiles à MediaSPIP, faites le nous savoir et son intégration dans la distribution officielle sera envisagée.
    Vous pouvez utiliser la liste de discussion de développement afin de le faire savoir ou demander de l’aide quant à la réalisation de ce plugin. MediaSPIP étant basé sur SPIP, il est également possible d’utiliser le liste de discussion SPIP-zone de SPIP pour (...)

  • 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

  • Ajouter notes et légendes aux images

    7 février 2011, par

    Pour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
    Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
    Modification lors de l’ajout d’un média
    Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)

Sur d’autres sites (2894)

  • Urgent Help Needed : FFmpeg Integration in .NET MAUI for Android [closed]

    15 juin 2024, par Billy Vanegas

    I'm currently facing a significant 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.

    


    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.

    


    The Problem :

    


    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.

    


    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

    


    Here’s the code snippet where the issue occurs :

    


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


    


    Additional Details :

    


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

    


    I've created a method ConvertMp3ToWav to handle the conversion.
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.

    


    AndroidManifest.xml :

    


    &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;

    I urgently need guidance on how to correctly integrate and use FFmpeg in my .NET MAUI project for Android. Specifically :

    &#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;

    Any advice, solutions, or workarounds would be greatly appreciated as this is a critical part of my project and I'm running out of time to resolve it.

    &#xA;

    Thank you in advance for your help !

    &#xA;

  • FFmpeg "Non-monotonous DTS in output stream" error when processing video from Safari's MediaRecorder

    17 juillet 2024, par Hackermon

    I'm recording a video stream in Safari with MediaRecorder, then sending it to a remote server which then uses ffmpeg to reencode the video. When reencoding with FFmpeg, I get a lot of warnings and the final video is broken, frame are glitching and out of sync but the audio sounds fine.

    &#xA;

    Here's my MediaRecorder script :

    &#xA;

    const camera = await navigator.mediaDevices.getUserMedia({ audio: true, video: true });&#xA;const recorder = new MediaRecorder(camera, {&#xA;        mimeType: &#x27;video/mp4&#x27;, // Safari only supports MP4&#xA;        bitsPerSecond: 1_000_000,&#xA;});&#xA;&#xA;recorder.ondataavailable = async ({ data: blob }) => {&#xA;        // open contents in new tab&#xA;        var fileURL = URL.createObjectURL(file);&#xA;         window.open(fileURL, &#x27;_blank&#x27;);&#xA;};&#xA;&#xA;recorder.start();&#xA;setTimeout(() => recorder.stop(), 5000);&#xA;

    &#xA;

    I download the video blob from Safari and use this command to reencode it :

    &#xA;

    ffmpeg -i ./blob.mp4 -preset ultrafast -strict -2 -threads 10 -c copy ./output.mp4&#xA;

    &#xA;

    Logs :

    &#xA;

    ffmpeg version 4.2.7-0ubuntu0.1 Copyright (c) 2000-2022 the FFmpeg developers&#xA;  built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.1)&#xA;  configuration: --prefix=/usr --extra-version=0ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared&#xA;  libavutil      56. 31.100 / 56. 31.100&#xA;  libavcodec     58. 54.100 / 58. 54.100&#xA;  libavformat    58. 29.100 / 58. 29.100&#xA;  libavdevice    58.  8.100 / 58.  8.100&#xA;  libavfilter     7. 57.100 /  7. 57.100&#xA;  libavresample   4.  0.  0 /  4.  0.  0&#xA;  libswscale      5.  5.100 /  5.  5.100&#xA;  libswresample   3.  5.100 /  3.  5.100&#xA;  libpostproc    55.  5.100 / 55.  5.100&#xA;[mov,mp4,m4a,3gp,3g2,mj2 @ 0x559826616000] DTS 29 &lt; 313 out of order&#xA;Input #0, mov,mp4,m4a,3gp,3g2,mj2, from &#x27;./chunk1.mp4&#x27;:&#xA;  Metadata:&#xA;    major_brand     : iso5&#xA;    minor_version   : 1&#xA;    compatible_brands: isomiso5hlsf&#xA;    creation_time   : 2024-07-17T14:30:47.000000Z&#xA;  Duration: 00:00:01.00, start: 0.000000, bitrate: 3937 kb/s&#xA;    Stream #0:0(und): Video: h264 (Baseline) (avc1 / 0x31637661), yuv420p(progressive), 640x480 [SAR 1:1 DAR 4:3], 6218 kb/s, 33.36 fps, 600 tbr, 600 tbn, 1200 tbc (default)&#xA;    Metadata:&#xA;      creation_time   : 2024-07-17T14:30:47.000000Z&#xA;      handler_name    : Core Media Video&#xA;    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 420 kb/s (default)&#xA;    Metadata:&#xA;      creation_time   : 2024-07-17T14:30:47.000000Z&#xA;      handler_name    : Core Media Audio&#xA;File &#x27;./safari3.mp4&#x27; already exists. Overwrite ? [y/N] Output #0, mp4, to &#x27;./safari3.mp4&#x27;:&#xA;  Metadata:&#xA;    major_brand     : iso5&#xA;    minor_version   : 1&#xA;    compatible_brands: isomiso5hlsf&#xA;    encoder         : Lavf58.29.100&#xA;    Stream #0:0(und): Video: h264 (Baseline) (avc1 / 0x31637661), yuv420p(progressive), 640x480 [SAR 1:1 DAR 4:3], q=2-31, 6218 kb/s, 33.36 fps, 600 tbr, 19200 tbn, 600 tbc (default)&#xA;    Metadata:&#xA;      creation_time   : 2024-07-17T14:30:47.000000Z&#xA;      handler_name    : Core Media Video&#xA;    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 420 kb/s (default)&#xA;    Metadata:&#xA;      creation_time   : 2024-07-17T14:30:47.000000Z&#xA;      handler_name    : Core Media Audio&#xA;Stream mapping:&#xA;  Stream #0:0 -> #0:0 (copy)&#xA;  Stream #0:1 -> #0:1 (copy)&#xA;Press [q] to stop, [?] for help&#xA;[mp4 @ 0x559826644340] Non-monotonous DTS in output stream 0:0; previous: 10016, current: 928; changing to 10017. This may result in incorrect timestamps in the output file.&#xA;[mp4 @ 0x559826644340] Non-monotonous DTS in output stream 0:0; previous: 10017, current: 1568; changing to 10018. This may result in incorrect timestamps in the output file.&#xA;[mp4 @ 0x559826644340] Non-monotonous DTS in output stream 0:0; previous: 10018, current: 2208; changing to 10019. This may result in incorrect timestamps in the output file.&#xA;...x100&#xA;frame=  126 fps=0.0 q=-1.0 Lsize=     479kB time=00:00:00.97 bitrate=4026.2kbits/s speed= 130x    &#xA;video:425kB audio:51kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.652696%&#xA;

    &#xA;

    Not sure what's happening or how to fix it. This issue only happens in Safari, videos from Chrome are perfectly fine.

    &#xA;

    I've tried various flags :

    &#xA;

    -fflags &#x2B;igndts&#xA;-bsf:a aac_adtstoasc&#xA;-c:v libvpx-vp9 -c:a libopus&#xA;etc&#xA;

    &#xA;

    None of them seem to fix the issue.

    &#xA;

  • ffmpeg convert webm to mp4 throw err "Could not find codec parameters for stream 0 (Video : vp9, none(tv, bt709), 854x480) : unspecified pixel format" [closed]

    25 juillet 2024, par chikadance
    /tmp $ ffmpeg -i /tmp/t.webm /tmp/t.mp4 -y&#xA;ffmpeg version 3.4.11-0ubuntu0.1 Copyright (c) 2000-2022 the FFmpeg developers&#xA;  built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04)&#xA;  configuration: --prefix=/usr --extra-version=0ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared&#xA;  WARNING: library configuration mismatch&#xA;  avcodec     configuration: --prefix=/usr --extra-version=0ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared --enable-version3 --disable-doc --disable-programs --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libtesseract --enable-libvo_amrwbenc&#xA;  libavutil      55. 78.100 / 55. 78.100&#xA;  libavcodec     57.107.100 / 57.107.100&#xA;  libavformat    57. 83.100 / 57. 83.100&#xA;  libavdevice    57. 10.100 / 57. 10.100&#xA;  libavfilter     6.107.100 /  6.107.100&#xA;  libavresample   3.  7.  0 /  3.  7.  0&#xA;  libswscale      4.  8.100 /  4.  8.100&#xA;  libswresample   2.  9.100 /  2.  9.100&#xA;  libpostproc    54.  7.100 / 54.  7.100&#xA;[matroska,webm @ 0x560e1a59a040] Could not find codec parameters for stream 0 (Video: vp9, none(tv, bt709), 854x480): unspecified pixel format&#xA;Consider increasing the value for the &#x27;analyzeduration&#x27; and &#x27;probesize&#x27; options&#xA;Input #0, matroska,webm, from &#x27;/tmp/t.webm&#x27;:&#xA;  Metadata:&#xA;    ENCODER         : Lavf57.83.100&#xA;  Duration: 00:00:30.00, start: -0.007000, bitrate: 696 kb/s&#xA;    Stream #0:0(eng): Video: vp9, none(tv, bt709), 854x480, SAR 1:1 DAR 427:240, 29.97 fps, 29.97 tbr, 1k tbn, 1k tbc (default)&#xA;    Metadata:&#xA;      DURATION        : 00:00:29.996000000&#xA;    Stream #0:1(eng): Audio: opus, 48000 Hz, stereo, fltp (default)&#xA;    Metadata:&#xA;      DURATION        : 00:00:29.980000000&#xA;Stream mapping:&#xA;  Stream #0:0 -> #0:0 (vp9 (native) -> h264 (libx264))&#xA;  Stream #0:1 -> #0:1 (opus (native) -> aac (native))&#xA;Press [q] to stop, [?] for help&#xA;Too many packets buffered for output stream 0:1.&#xA;[aac @ 0x560e1a5a0bc0] Qavg: 226.401&#xA;[aac @ 0x560e1a5a0bc0] 2 frames left in the queue on closing&#xA;Conversion failed!&#xA;

    &#xA;

    how to convert webm to mp4

    &#xA;