Recherche avancée

Médias (2)

Mot : - Tags -/map

Autres articles (97)

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

  • (Dés)Activation de fonctionnalités (plugins)

    18 février 2011, par

    Pour gérer l’ajout et la suppression de fonctionnalités supplémentaires (ou plugins), MediaSPIP utilise à partir de la version 0.2 SVP.
    SVP permet l’activation facile de plugins depuis l’espace de configuration de MediaSPIP.
    Pour y accéder, il suffit de se rendre dans l’espace de configuration puis de se rendre sur la page "Gestion des plugins".
    MediaSPIP est fourni par défaut avec l’ensemble des plugins dits "compatibles", ils ont été testés et intégrés afin de fonctionner parfaitement avec chaque (...)

  • ANNEXE : Les plugins utilisés spécifiquement pour la ferme

    5 mars 2010, par

    Le site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)

Sur d’autres sites (5964)

  • Is there a way to use ffmpeg binary on anroid platform in MAUI project ?

    18 août 2023, par Mrand

    Currently I'm working on my test project about capabilities of MAUI and ffmpeg, so I can create my own applications. I got stuck on problem about using ffmpeg on platforms other than Windows (for example Anroid).

    


    I tried googling the problem, didn't find anything helpful. Right now my ffmpeg for Android binary is situated inside Platforms/Android/Assets/libs as AndroidAsset. And I'm using code below to put my binary on Android to execute in the future

    


    protected override void OnCreate(Bundle bundle)
{
    base.OnCreate(bundle);

    if (ContextCompat.CheckSelfPermission(this, Manifest.Permission.ReadExternalStorage) != Permission.Granted 
        || ContextCompat.CheckSelfPermission(this, Manifest.Permission.WriteExternalStorage) != Permission.Granted 
        || ContextCompat.CheckSelfPermission(this, Manifest.Permission.Internet) != Permission.Granted) 
    {
        ActivityCompat.RequestPermissions(this, new string[] {
          Manifest.Permission.ReadExternalStorage, Manifest.Permission.WriteExternalStorage, Manifest.Permission.Internet
        }, 0);
    }

    PrepareFFmpeg();
}

private void PrepareFFmpeg()
{
    var assetManager = Android.App.Application.Context.Assets;
    string path = "libs/ffmpeg";
    string destinationPath = Path.Combine(Android.App.Application.Context.ApplicationInfo.DataDir, "ffmpeg");

    var directoryPath = Path.GetDirectoryName(destinationPath);
    if (!Directory.Exists(directoryPath))
    {
        Directory.CreateDirectory(directoryPath);
    }

    using (var inputStream = assetManager.Open(path))
    {
        if (File.Exists(destinationPath)) 
        {
            File.Delete(destinationPath);
        }

        using (var outputStream = File.Create(destinationPath))
        {
            inputStream.CopyTo(outputStream);
        }
    }

    Java.Lang.JavaSystem.SetProperty("java.io.tmpdir", destinationPath);
    Java.Lang.Runtime.GetRuntime().Exec("chmod 700 " + destinationPath);

    FFmpeg.SetExecutablesPath(destinationPath);
}


    


    public static class FFmpegService
{
    public static async Task ConvertVideoAsync(string inputPath, string outputPath, string format)
    {
        if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
        {
            string ffmpegPath = GetFFmpegPath();
            string arguments = $"-i \"{inputPath}\" \"{outputPath}.{format}\"";

            ProcessStartInfo startInfo = new ProcessStartInfo
            {
                FileName = ffmpegPath,
                Arguments = arguments,
                RedirectStandardOutput = true,
                RedirectStandardError = true,
                UseShellExecute = false,
                CreateNoWindow = true,
            };

            using Process process = new Process { StartInfo = startInfo };
            process.Start();
            await process.WaitForExitAsync();
        }
        else
        {
            //IConversion conversion = await FFmpeg.Conversions.FromSnippet.Convert(inputPath, $"{outputPath}.{f*-  .ormat}");
            //string command = $"-i {inputPath} -f {format} {outputPath}";

            //ProcessStartInfo psi = new ProcessStartInfo();
            //psi.FileName = FFmpeg.ExecutablesPath;
            //psi.Arguments = command;
            //psi.RedirectStandardOutput = true;
            //psi.RedirectStandardError = true;
            //psi.UseShellExecute = false;

            //Process process = Process.Start(psi);
            //process.WaitForExit();

            //string output = process.StandardOutput.ReadToEnd();
            //string error = process.StandardError.ReadToEnd();

            string outputPathWithFormat = $"{outputPath}.{format}";
            IConversion conversion = await FFmpeg.Conversions.FromSnippet.Convert(inputPath, outputPathWithFormat);
            IConversionResult result = await conversion.Start();
        }
    }

    private static string GetFFmpegPath()
    {
        //string platformFolder = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "Windows" : "Android";
        //return Path.Combine("Platforms", platformFolder, "ffmpeg", "ffmpeg");
        if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
        {
            return Path.Combine("Platforms", "Windows", "ffmpeg", "ffmpeg");
        }
        else
        {
            return null;
        }
    }
}


    


    I'm trying to use FFmpegService to convert video in any desired format I can by passing it in the arguments of the method (Windows works fine).

    


    In my service I also tried to use Xabe.FFmpeg but it always gives couldn't find part of path (path here). When using more manual approach I face another problem every time : Permission denied.
For path I tried /data/data/APPNAME and cache directories. It always results in problems mentioned above.

    


    I downloaded FFmpeg binary from this repository : https://github.com/tomaszzmuda/Xabe.FFmpeg/releases/tag/executables

    


    My goal is to get conversion working for any format and for at least two platforms : Android and Windows, but if you can tell me how to do it on other platforms as well - I would be grateful.

    


    Additional question : If you can tell me the best practice setting standard path for storing converted audio and video, thanks.

    


    If you need more details, please specify I would happily provide them.
P.S. : don't look at the quality of code, I tried to code this for week so I didn't care about quality, I just want to learn how can I do this.

    


    Thanks for your time and attention !

    


    Project : Maui Blazor .Net 7.0

    


  • Point CMake project to specific include file

    16 novembre 2011, par Unapiedra

    I am trying to build OpenCV 2.3.0 with FFMPEG enabled. Since Ubuntu 11.10 only supplies libavcodec/format with version 0.7 and the ticket #1020(link below) indicates that it should work with 0.8.

    If I try to compile I get the following error :

    [ 18%] Building CXX object modules/highgui/CMakeFiles/opencv_highgui.dir/src/cap_ffmpeg.o
    In file included from /home/chris/src/OpenCV-2.3.0/modules/highgui/src/cap_ffmpeg.cpp:45:0:
    /home/foo/src/OpenCV-2.3.0/modules/highgui/src/cap_ffmpeg_impl.hpp:103:36: fatal error: libavformat/avformat.h: No such file or directory
    compilation terminated.

    This file lives in /opt/linux64-debug/include/ffmpeg/libavformat/avformat.h. I tried pointing make at that with CMAKE_INCLUDE_DIRECTORY,PATH, CMAKE_PREFIX_PATH and CMAKE_LIBRARY_PATH. None of that worked. ( I always used the path /opt/linux64-debug/include/ffmpeg.)

    https://code.ros.org/trac/opencv/ticket/1020

  • A C language ffmpeg project organized with CMakeLists, encounters errors in the Windows MinGW64 environment

    20 juin 2023, par flywen

    Project Structure

    


    ffmpeg-tutorial

    


      

    • include

        

      • libavcodec
      • 


      • libavdevice
      • 


      • libavfilter
      • 


      • libavformat
      • 


      • libavutil
      • 


      • libswresample
      • 


      • libswscale
      • 


      


    • 


    • lib

        

      • pkgconfig
      • 


      • libavcodec.a
      • 


      • libavdevice.a
      • 


      • libavfilter.a
      • 


      • libformat.a
      • 


      • libavutil.a
      • 


      • libswresample.a
      • 


      • libswscale.a
      • 


      


    • 


    • CMakeLists.txt
    • 


    • main.c
    • 


    


    CMakeLists.txt

    


    cmake_minimum_required(VERSION 3.20)
project(ffmpeg_tutorial)

set(CMAKE_C_STANDARD 11)

include_directories(include)
link_directories(lib)
add_executable(ffmpeg_tutorial main.cpp)
target_link_libraries(ffmpeg_tutorial
        avformat
        avcodec
        avutil
        swscale
        swresample
        z
        bz2
        iconv
        ws2_32
        schannel
        kernel32
        advapi32
        kernel32
        user32
        gdi32
        winspool
        shell32
        ole32
        oleaut32
        uuid
        comdlg32
        advapi32
        )


    


    main.c

    


    #include 
#include "libavcodec/avcodec.h"
#include "libavformat/avformat.h"
#include "libswresample/swresample.h"
int main() {
    std::cout << "Hello, World!" << std::endl;
    std::cout << av_version_info() << std::endl;
    printf("ffmpeg version is %s\n", av_version_info());
    // Open input file
    AVFormatContext *inputContext = nullptr;
    if (avformat_open_input(&inputContext, "input.mp3", nullptr, nullptr) != 0) {
        printf("Couldn't open input file\n");
        return -1;
    }

    // Read input stream
    if (avformat_find_stream_info(inputContext, nullptr) < 0) {
        printf("Couldn't find stream information\n");
        return -1;
    }

    // Get audio stream index
    int audioStream = -1;
    for (int i = 0; i < inputContext->nb_streams; i++) {
        if (inputContext->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) {
            audioStream = i;
            break;
        }
    }

    if (audioStream == -1) {
        printf("Couldn't find audio stream\n");
        return -1;
    }
}



    


    IDE

    


    clion

    


    ERRORS

    


    [ 50%] Building CXX object CMakeFiles/ffmpeg_tutorial.dir/main.cpp.obj
[100%] Linking CXX executable ffmpeg_tutorial.exe
D:/Msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: G:/cywen_private/cpp_projects/ffmpeg-tutorial/lib/libavformat.a(tls_schannel.o): in function `tls_write':
D:\Msys64\usr\src\ffmpeg/libavformat/tls_schannel.c:563: undefined reference to `EncryptMessage'
D:/Msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: G:/cywen_private/cpp_projects/ffmpeg-tutorial/lib/libavformat.a(tls_schannel.o): in function `tls_read':
D:\Msys64\usr\src\ffmpeg/libavformat/tls_schannel.c:441: undefined reference to `DecryptMessage'
D:/Msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: G:/cywen_private/cpp_projects/ffmpeg-tutorial/lib/libavcodec.a(mfenc.o):mfenc.c:(.rdata$.refptr.IID_ICodecAPI[.refptr.IID_ICodecAPI]+0x0): undefined reference to `IID_ICodecAPI'
D:/Msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: G:/cywen_private/cpp_projects/ffmpeg-tutorial/lib/libavcodec.a(tiff.o): in function `tiff_uncompress_lzma':
D:\Msys64\usr\src\ffmpeg/libavcodec/tiff.c:577: undefined reference to `lzma_stream_decoder'
D:/Msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:\Msys64\usr\src\ffmpeg/libavcodec/tiff.c:582: undefined reference to `lzma_code'
D:/Msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:\Msys64\usr\src\ffmpeg/libavcodec/tiff.c:583: undefined reference to `lzma_end'
D:/Msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: G:/cywen_private/cpp_projects/ffmpeg-tutorial/lib/libavutil.a(random_seed.o): in function `av_get_random_seed':
D:\Msys64\usr\src\ffmpeg/libavutil/random_seed.c:127: undefined reference to `BCryptOpenAlgorithmProvider'
D:/Msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:\Msys64\usr\src\ffmpeg/libavutil/random_seed.c:130: undefined reference to `BCryptGenRandom'
D:/Msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:\Msys64\usr\src\ffmpeg/libavutil/random_seed.c:131: undefined reference to `BCryptCloseAlgorithmProvider'
collect2.exe: error: ld returned 1 exit status
mingw32-make[3]: *** [CMakeFiles\ffmpeg_tutorial.dir\build.make:95: ffmpeg_tutorial.exe] Error 1
mingw32-make[2]: *** [CMakeFiles\Makefile2:82: CMakeFiles/ffmpeg_tutorial.dir/all] Error 2
mingw32-make[1]: *** [CMakeFiles\Makefile2:89: CMakeFiles/ffmpeg_tutorial.dir/rule] Error 2
mingw32-make: *** [Makefile:123: ffmpeg_tutorial] Error 2


    


    What is the way I compile ffmpeg

    


      

    • downlaod msys2

      


    • 


    • install mingw64

      


    • 


    


    pacman -S mingw-w64-x86_64-toolchain


    


      

    • install make,diffutils,nasm,yasm,pkg-config

      


    • 


    


    pacman -S base-devl yasm nasm pkg-config


    


      

    • download ffmpeg 5.1

      


    • 


    • compile

      


    • 


    


    cd ffmpeg
./configure --disable-shared --enable-static --arch=x86_64 --target-os=mingw32 --cross-prefix=x86_64-w64-mingw32- --pkg-config-flags=--static --prefix=../ffmpeg-build

make -j $(nproc)

make install



    


    Project Repoistory

    


    https://github.com/joinwen/learn_ffmpeg.git

    


    Expectation

    


      

    1. How to solve errors
    2. 


    3. In CMakeLists target_link_libraries's parameters is too much, Can I make it short
    4. 


    5. some advices on the project
    6.