Recherche avancée

Médias (1)

Mot : - Tags -/Rennes

Autres articles (39)

  • Encoding and processing into web-friendly formats

    13 avril 2011, par

    MediaSPIP automatically converts uploaded files to internet-compatible formats.
    Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
    Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
    Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
    All uploaded files are stored online in their original format, so you can (...)

  • Librairies et logiciels spécifiques aux médias

    10 décembre 2010, par

    Pour un fonctionnement correct et optimal, plusieurs choses sont à prendre en considération.
    Il est important, après avoir installé apache2, mysql et php5, d’installer d’autres logiciels nécessaires dont les installations sont décrites dans les liens afférants. Un ensemble de librairies multimedias (x264, libtheora, libvpx) utilisées pour l’encodage et le décodage des vidéos et sons afin de supporter le plus grand nombre de fichiers possibles. Cf. : ce tutoriel ; FFMpeg avec le maximum de décodeurs et (...)

  • Submit bugs and patches

    13 avril 2011

    Unfortunately a software is never perfect.
    If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
    If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
    You may also (...)

Sur d’autres sites (6671)

  • How to link FFmpeg libraries with CMake in windows

    4 juillet 2021, par ldall03

    I'm new to CMake and not very familiar with how linking/compiling works. I am on windows 10 using MinGW in CLion. As the title says I want to use FFmpeg libraries in my c++ code. I downloaded the source code from : https://ffmpeg.org/download.html (Download Source Code button). I unzipped it and put the libavcodec library in my project. Here is my project structure :

    


    project
   \-- cmake-build-debug
   \-- src
      \-- vendor
         \-- libavcodec
   \-- main.cpp
   \--CMakeLists.txt


    


    Here is my main.cpp file :

    


    extern "C" {&#xA;#include "libavcodec/avcodec.h"&#xA;}&#xA;&#xA;#include <iostream>&#xA;&#xA;int main(int argc, char *argv[]) {&#xA;    std::cout &lt;&lt; "Hello World\n";&#xA;    return 0;&#xA;}&#xA;&#xA;</iostream>

    &#xA;

    And my CMakeLists.txt file :

    &#xA;

    cmake_minimum_required(VERSION 3.19)&#xA;project(VidShare)&#xA;&#xA;set(CMAKE_CXX_STANDARD 17)&#xA;set(CMAKE_INCLUDE_CURRENT_DIR ON)&#xA;set(CMAKE_CXX_STANDARD_REQUIRED ON)&#xA;set(CMAKE_PREFIX_PATH  "C:/Qt/6.1.1/mingw81_64/lib/cmake")&#xA;&#xA;find_package(Qt6Widgets REQUIRED)&#xA;&#xA;set(CMAKE_AUTOMOC ON)&#xA;set(CMAKE_AUTORCC ON)&#xA;set(CMAKE_AUTOUIC ON)&#xA;&#xA;add_executable(VidShare main.cpp)&#xA;include_directories(src src/vendor)&#xA;target_link_libraries(VidShare Qt6::Widgets Qt6::Core Qt6::Gui)&#xA;

    &#xA;

    Ignore the Qt stuff it works fine.

    &#xA;

    And well when I build I get this error message :

    &#xA;

    fatal error: libavutil/avconfig.h: No such file or directory&#xA; #include "libavutil/avconfig.h"&#xA;

    &#xA;

    I've seen that I had to run a configure script in the FFmpeg main file but I'm on windows so I can't really do that. I don't know if I have to use other kinds of libraries or if I downloaded the wrong thing... I am really at lost here. There is probably a better or more convenient way of doing what I want but I could not find many resources on it... Help would be appreciated :)

    &#xA;

  • Not able to link ffmpeg library in cython package

    12 août 2020, par Sagar Donadkar

    I am using cython package to call Cpp API and in my cpp code i am using ffmpeg library when i try to build my code i got and linking issue&#xA;In header file add include ffmpeg header file to call ffmpeg library function

    &#xA;

    header file&#xA;#ifndef RECTANGLE_H&#xA;#define RECTANGLE_H&#xA;#include <iostream>&#xA;&#xA;extern "C"&#xA;{&#xA;    #include "libavformat/avformat.h"&#xA;    #include "libavutil/dict.h"&#xA;}&#xA;&#xA;using namespace std;&#xA;&#xA;namespace shapes &#xA;{&#xA;    class Rectangle {&#xA;        public:&#xA;            int x0, y0, x1, y1;&#xA;            Rectangle();&#xA;            Rectangle(int x0, int y0, int x1, int y1);&#xA;            ~Rectangle();&#xA;            int getArea();&#xA;            int ffmpegFile();&#xA;            void getSize(int* width, int* height);&#xA;            void move(int dx, int dy);&#xA;    };&#xA;}&#xA;&#xA;#endif&#xA;</iostream>

    &#xA;

    Rectangle.Cpp file in ffmpegFile() i am using ffmpeg example code to test ffmpeg my code where i call mostly ffmpeg API

    &#xA;

    &#xA;#include <iostream>&#xA;#include "Rectangle.hpp"&#xA;&#xA;namespace shapes {&#xA;    &#xA;&#xA;    // Default constructor&#xA;    Rectangle::Rectangle () {}&#xA;&#xA;    // Overloaded constructor&#xA;    Rectangle::Rectangle (int x0, int y0, int x1, int y1) {&#xA;        this->x0 = x0;&#xA;        this->y0 = y0;&#xA;        this->x1 = x1;&#xA;        this->y1 = y1;&#xA;    }&#xA;&#xA;    // Destructor&#xA;    Rectangle::~Rectangle () {}&#xA;&#xA;    // Return the area of the rectangle&#xA;    int Rectangle::getArea () {&#xA;        return 10;&#xA;    }&#xA;&#xA;    // Get the size of the rectangle.&#xA;    // Put the size in the pointer args&#xA;    void Rectangle::getSize (int *width, int *height) {&#xA;        (*width) = x1 - x0;&#xA;        (*height) = y1 - y0;&#xA;    }&#xA;&#xA;    // Move the rectangle by dx dy&#xA;    void Rectangle::move (int dx, int dy) {&#xA;        this->x0 &#x2B;= dx;&#xA;        this->y0 &#x2B;= dy;&#xA;        this->x1 &#x2B;= dx;&#xA;        this->y1 &#x2B;= dy;&#xA;    }&#xA;    int Rectangle::ffmpegFile()&#xA;    {&#xA;        AVFormatContext *fmt_ctx = NULL;&#xA;        AVDictionaryEntry *tag = NULL;&#xA;        int ret = 0;&#xA;        char* filename = "D:\\Discovery.mp4";&#xA;&#xA;        if ((ret = avformat_open_input(&amp;fmt_ctx, filename, NULL, NULL)))&#xA;            return ret;&#xA;&#xA;        if ((ret = avformat_find_stream_info(fmt_ctx, NULL)) &lt; 0) {&#xA;            av_log(NULL, AV_LOG_ERROR, "Cannot find stream information\n");&#xA;            return ret;&#xA;        }&#xA;&#xA;        while ((tag = av_dict_get(fmt_ctx->metadata, "", tag, AV_DICT_IGNORE_SUFFIX)))&#xA;            printf("%s=%s\n", tag->key, tag->value);&#xA;&#xA;        avformat_close_input(&amp;fmt_ctx);&#xA;        return ret;&#xA;    }&#xA;}&#xA;</iostream>

    &#xA;

    Rectangle.pxd file declaration for cpp file function and variable

    &#xA;

    cdef extern from "Rectangle.cpp":&#xA;    pass&#xA;cdef extern from "Rectangle.hpp" namespace "shapes":&#xA;    cdef cppclass Rectangle:&#xA;        Rectangle() except &#x2B;&#xA;        Rectangle(int, int, int, int) except &#x2B;&#xA;        int x0, y0, x1, y1&#xA;        int getArea()&#xA;        void getSize(int* width, int* height)&#xA;        void move(int, int)&#xA;        int ffmpegFile()&#xA;

    &#xA;

    rect.pyx file i am calling cpp API form pyx file

    &#xA;

    # distutils: language = c&#x2B;&#x2B;&#xA;&#xA;from Rectangle cimport Rectangle&#xA;&#xA;cdef class PyRectangle:&#xA;    cdef Rectangle c_rect  # Hold a C&#x2B;&#x2B; instance which we&#x27;re wrapping&#xA;&#xA;    def __cinit__(self, int x0, int y0, int x1, int y1):&#xA;        self.c_rect = Rectangle(x0, y0, x1, y1)&#xA;&#xA;    def get_area(self):&#xA;        return self.c_rect.getArea()&#xA;&#xA;    def get_size(self):&#xA;        cdef int width, height&#xA;        self.c_rect.getSize(&amp;width, &amp;height)&#xA;        return width, height&#xA;&#xA;    def move(self):&#xA;        print(self.c_rect.ffmpegFile())&#xA;

    &#xA;

    setup.py&#xA;I provided pyx file and ffmpeg library path as well as include path

    &#xA;

    from setuptools import setup,Extension&#xA;from Cython.Build import cythonize &#xA;&#xA;&#xA;directives={&#x27;linetrace&#x27;:False, &#x27;language_level&#x27;:3}&#xA;&#xA;setup(name = &#x27;superfastcode&#x27;, version = &#x27;1.0&#x27;,&#xA;    description = &#x27;Python Package with superfastcode C&#x2B;&#x2B; extension&#x27;,&#xA;    ext_modules=cythonize([&#xA;    Extension(&#xA;        &#x27;demo&#x27;,["rect.pyx"],&#xA;        include_dirs=[&#x27;ffmpeg\\include&#x27;],)&#xA;        library_dirs=["ffmpeg\\lib"],&#xA;        libraries=["avcodec","avformat","avutil","swscale","avdevice","avfilter","postproc","swresample"]),&#xA;        &#xA;]))&#xA;

    &#xA;

    getting below error

    &#xA;

    PS D:\SiVUE\Backend\Cython\demo> python setup.py build_ext --inplace&#xA;Compiling rect.pyx because it depends on .\Rectangle.pxd.&#xA;[1/1] Cythonizing rect.pyx&#xA;C:\python3.8\lib\site-packages\Cython\Compiler\Main.py:369: FutureWarning: Cython directive &#x27;language_level&#x27; not set, using 2 for now (Py2). This will change in a later release! File: D:\SiVUE\Backend\Cython\demo\rect.pyx&#xA;  tree = Parsing.p_module(s, pxd, full_module_name)&#xA;running build_ext&#xA;building &#x27;demo&#x27; extension&#xA;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -I. -Iffmpeg\include -IC:\python3.8\include -IC:\python3.8\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" /EHsc /Tprect.cpp /Fobuild\temp.win32-3.8\Release\rect.obj&#xA;rect.cpp&#xA;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\bin\HostX86\x86\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:ffmpeg\lib /LIBPATH:C:\python3.8\libs /LIBPATH:C:\python3.8\PCbuild\win32 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\lib\x86" "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x86" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\ucrt\x86" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x86" avcodec.lib avformat.lib avutil.lib swscale.lib avdevice.lib avfilter.lib postproc.lib swresample.lib /EXPORT:PyInit_demo build\temp.win32-3.8\Release\rect.obj /OUT:build\lib.win32-3.8\demo.cp38-win32.pyd /IMPLIB:build\temp.win32-3.8\Release\demo.cp38-win32.lib&#xA;   Creating library build\temp.win32-3.8\Release\demo.cp38-win32.lib and object build\temp.win32-3.8\Release\demo.cp38-win32.exp&#xA;rect.obj : error LNK2001: unresolved external symbol _avformat_open_input&#xA;rect.obj : error LNK2001: unresolved external symbol _av_log&#xA;rect.obj : error LNK2001: unresolved external symbol _avformat_close_input&#xA;rect.obj : error LNK2001: unresolved external symbol _avformat_find_stream_info&#xA;rect.obj : error LNK2001: unresolved external symbol _av_dict_get&#xA;build\lib.win32-3.8\demo.cp38-win32.pyd : fatal error LNK1120: 5 unresolved externals&#xA;error: command &#x27;C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.26.28801\\bin\\HostX86\\x86\\link.exe&#x27; failed with exit status 1120&#xA;

    &#xA;

    Thank You

    &#xA;

  • How to link .so library on Android

    9 juin 2014, par Sayaki

    I’m trying to use FFMpeg with Android. First of all I have tryed to build FFMpeg on my Mac but I cant do that. I checked many solution on Internet but none working. Becouse of that I try to build FFMpeg on Ubuntu 12.04. I try a lot of solutions bu finally I found this example and I succeed build it. Then I get headers files and .so files. Then I copy all of them on my mac and try to use it in my project. I copy this files to my project. Now my project tree looks like this :

    picture

    Here is my Android.mk file :

    LOCAL_PATH := $(call my-dir)

    include $(CLEAR_VARS)
    LOCAL_MODULE := avformat
    LOCAL_SRC_FILES := libavformat.so
    LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include/libavformat
    include $(PREBUILT_SHARED_LIBRARY)

    include $(CLEAR_VARS)

    LOCAL_MODULE    := ndksetup
    LOCAL_SRC_FILES := native.c
    LOCAL_LDLIBS := -llog
    LOCAL_C_INCLUDES := $(LOCAL_PATH)/include

    include $(BUILD_SHARED_LIBRARY)

    Here is my Application.mk file :

    APP_MODULES := ndksetup
    APP_PLATFORM := android-8
    LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libavformat.so

    Here is my natice.c file :

    #include
    #include
    #include <android></android>log.h>
    #include "include/libavcodec/avcodec.h"
    #include "include/libavformat/avformat.h"

    #define DEBUG_TAG "NDKSetupActivity"

    void Java_com_example_ndksetup_MainActivity_printLog(JNIEnv *env, jobject this,
           jstring logString) {
       av_register_all();
       jboolean isCopy;
       const char * szLogString = (*env)->GetStringUTFChars(env, logString,
               &amp;isCopy);

       __android_log_print(ANDROID_LOG_DEBUG, DEBUG_TAG, "NDK: %s", szLogString);

       (*env)->ReleaseStringUTFChars(env, logString, szLogString);
    }

    jint Java_com_example_ndksetup_MainActivity_fibonacci(JNIEnv * env,
           jobject this, jint value) {
       if (value &lt;= 1)
           return value;
       return Java_com_example_ndksetup_MainActivity_fibonacci(env, this,
               value - 1)
               + Java_com_example_ndksetup_MainActivity_fibonacci(env, this,
                       value - 2);
    }

    I get error

    [armeabi] SharedLibrary  : libndksetup.so
    /Applications/adt-bundle-mac-x86_64-20140321/sdk/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /Users/michal/Desktop/NDKSetup/obj/local/armeabi/objs/ndksetup/native.o: in function Java_com_example_ndksetup_MainActivity_printLog:/Users/michal/Desktop/NDKSetup/jni/native.c:11: error: undefined reference to 'av_register_all'
    collect2: ld returned 1 exit status
    make: *** [/Users/michal/Desktop/NDKSetup/obj/local/armeabi/libndksetup.so] Error 1

    And I really dont know how to deal with it. Can you tell me what Im dooing wrong and how can I fix it ? Or maybe there is another way to use .so library in Android