Recherche avancée

Médias (2)

Mot : - Tags -/doc2img

Autres articles (53)

  • La sauvegarde automatique de canaux SPIP

    1er avril 2010, par

    Dans le cadre de la mise en place d’une plateforme ouverte, il est important pour les hébergeurs de pouvoir disposer de sauvegardes assez régulières pour parer à tout problème éventuel.
    Pour réaliser cette tâche on se base sur deux plugins SPIP : Saveauto qui permet une sauvegarde régulière de la base de donnée sous la forme d’un dump mysql (utilisable dans phpmyadmin) mes_fichiers_2 qui permet de réaliser une archive au format zip des données importantes du site (les documents, les éléments (...)

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

  • 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

Sur d’autres sites (10574)

  • Linker command failed with exit code 1 when building ffmpeg static libraries

    19 juillet 2017, par Wilsom Sanders

    I’m trying to build ffmpeg static libraries and link them to an android project in order to implement a video player. Goal is to make a player capable of receiving video file from various sources similar to p2p file sharing networks. (target api is 21 level which is 1 level short from supposed official solution with MediaSource)

    I managed to compile ffmpeg from this repo (all the code used as-is) but later i got stuck on a linking problem. Whenever I try to compile I get list of ffmpeg methods called in my code and a short eloquent message :

    Linker command failed with exit code 1

    I have no clue how to pass -v flag to the linker in android studio. Would be great if somebody hinted me that.

    I use android studio, build with gradle and cmake.

    There’s my files :
    build.gradle (Project)

    // Top-level build file where you can add configuration options common to all sub-projects/modules.

    buildscript {
       repositories {
           jcenter()
       }
       dependencies {
           classpath 'com.android.tools.build:gradle:2.3.1'

           // NOTE: Do not place your application dependencies here; they belong
           // in the individual module build.gradle files
       }
    }

    allprojects {
       repositories {
           jcenter()
       }
    }

    task clean(type: Delete) {
       delete rootProject.buildDir
    }

    build.gradle (Module)

    apply plugin: 'com.android.application'

       android {
           compileSdkVersion 25
           buildToolsVersion "25.0.3"
           productFlavors {
               x86 {
                   ndk {
                       abiFilter "x86"
                   }
               }
               arm {
                   ndk {
                       abiFilters "armeabi-v7a"
                   }
               }
               armv7 {
                   ndk {
                       abiFilters "armeabi-v7a"
                   }
               }
           }
           defaultConfig {
               applicationId "com.example.ledo.ndkapplication"
               minSdkVersion 22
               targetSdkVersion 25
               versionCode 1
               versionName "1.0"
               testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
               externalNativeBuild {
                   cmake {
                       cppFlags "-std=c++11 -frtti -fexceptions"
                       arguments '-DANDROID_PLATFORM=android-16'
                   }
               }
           }
           buildTypes {
               release {
                   minifyEnabled false
                   proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
               }
           }
           externalNativeBuild {
               cmake {
                   path "CMakeLists.txt"
               }
           }
           splits {
               abi {
                   enable true
                   reset()
                   include 'x86', 'armeabi-v7a'
                   universalApk true
               }
           }
       }

       dependencies {
           compile fileTree(dir: 'libs', include: ['*.jar'])
           androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
               exclude group: 'com.android.support', module: 'support-annotations'
           })
           compile 'com.android.support:appcompat-v7:25.3.1'
           compile 'com.android.support.constraint:constraint-layout:1.0.2'
           compile 'com.android.support:design:25.3.1'
           compile 'com.writingminds:FFmpegAndroid:0.3.2'
           testCompile 'junit:junit:4.12'
       }

    CMakeLists.txt

    # For more information about using CMake with Android Studio, read the
    # documentation: https://d.android.com/studio/projects/add-native-code.html

    # Sets the minimum version of CMake required to build the native library.

    cmake_minimum_required(VERSION 2.8)

    # Creates and names a library, sets it as either STATIC
    # or SHARED, and provides the relative paths to its source code.
    # You can define multiple libraries, and CMake builds them for you.
    # Gradle automatically packages shared libraries with your APK.

    add_library( # Sets the name of the library.
                native-lib

                # Sets the library as a shared library.
                SHARED

                # Provides a relative path to your source file(s).
                src/main/cpp/native-lib.cpp
                src/main/cpp/NativePlayer.h
                src/main/cpp/NativePlayer.cpp)

    # Searches for a specified prebuilt library and stores the path as a
    # variable. Because CMake includes system libraries in the search path by
    # default, you only need to specify the name of the public NDK library
    # you want to add. CMake verifies that the library exists before
    # completing its build.

    find_library( # Sets the name of the path variable.
                 log-lib

                 # Specifies the name of the NDK library that
                 # you want CMake to locate.
                 log )
    find_library(png-lib png)

    # Specifies libraries CMake should link to your target library. You
    # can link multiple libraries, such as libraries you define in this
    # build script, prebuilt third-party libraries, or system libraries.

    #avcodec
    #avfilter
    #avformat
    #avutil
    #swresample
    #swscale

    #${ANDROID_ABI}

    message(${ANDROID_ABI})
    set(FFMPEG_ROOT_DIR src/main/libs/ffmpeg/${ANDROID_ABI})

    add_library(avcodec STATIC IMPORTED)
    add_library(avformat STATIC IMPORTED)
    add_library(avfilter STATIC IMPORTED)
    add_library(avutil STATIC IMPORTED)
    add_library(swresample STATIC IMPORTED)
    add_library(swscale STATIC IMPORTED)

    #SET_TARGET_PROPERTIES(avcodec PROPERTIES LINKER_LANGUAGE C)
    set_target_properties(avcodec PROPERTIES IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/${FFMPEG_ROOT_DIR}/lib/libavcodec.a)
    #SET_TARGET_PROPERTIES(avfilter PROPERTIES LINKER_LANGUAGE C)
    set_target_properties(avfilter PROPERTIES IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/${FFMPEG_ROOT_DIR}/lib/libavfilter.a)
    #SET_TARGET_PROPERTIES(avformat PROPERTIES LINKER_LANGUAGE C)
    set_target_properties(avformat PROPERTIES IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/${FFMPEG_ROOT_DIR}/lib/libavformat.a)
    #SET_TARGET_PROPERTIES(avutil PROPERTIES LINKER_LANGUAGE C)
    set_target_properties(avutil PROPERTIES IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/${FFMPEG_ROOT_DIR}/lib/libavutil.a)
    #SET_TARGET_PROPERTIES(swresample PROPERTIES LINKER_LANGUAGE C)
    set_target_properties(swresample PROPERTIES IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/${FFMPEG_ROOT_DIR}/lib/libswresample.a)
    #SET_TARGET_PROPERTIES(swscale PROPERTIES LINKER_LANGUAGE C)
    set_target_properties(swscale PROPERTIES IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/${FFMPEG_ROOT_DIR}/lib/libswscale.a)

    include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/${FFMPEG_ROOT_DIR}/include )
    include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/${FFMPEG_ROOT_DIR}/lib )
    target_link_libraries( # Specifies the target library.
                          native-lib

                          # Links the target library to the log library
                          # included in the NDK.
                          ${log-lib}
                          avcodec
                          avformat
                          #avfilter
                          #swresample
                          #swscale
                          #avutil
                          GLESv2)

    I have .a files in following locations :

    • %PROJECT_DIR%/app/src/libs/ffmpeg/armeabi-v7a
    • %PROJECT_DIR%/app/src/libs/ffmpeg/armeabi-v7a-neon
    • %PROJECT_DIR%/app/src/libs/ffmpeg/x86

    It doesn’t look to me that linker misses files themselves. (I get different out put if I misplace them.)

  • Android ffmpeg. Linker command failed with exit code 1

    8 juin 2017, par Wilsom Sanders

    I’m trying to build ffmpeg static libraries and link them to an android project in order to implement a video player. Goal is to make a player capable of receiving video file from various sources similar to p2p file sharing networks. (target api is 21 level which is 1 level short from supposed official solution with MediaSource)

    I managed to compile ffmpeg from this repo (all the code used as-is) but later i got stuck on a linking problem. Whenever I try to compile I get list of ffmpeg methods called in my code and a short eloquent message :

    Linker command failed with exit code 1

    I have no clue how to pass -v flag to the linker in android studio. Would be great if somebody hinted me that.

    I use android studio, build with gradle and cmake.

    There’s my files :
    build.gradle (Project)

    // Top-level build file where you can add configuration options common to all sub-projects/modules.

    buildscript {
       repositories {
           jcenter()
       }
       dependencies {
           classpath 'com.android.tools.build:gradle:2.3.1'

           // NOTE: Do not place your application dependencies here; they belong
           // in the individual module build.gradle files
       }
    }

    allprojects {
       repositories {
           jcenter()
       }
    }

    task clean(type: Delete) {
       delete rootProject.buildDir
    }

    build.gradle (Module)

    apply plugin: 'com.android.application'

       android {
           compileSdkVersion 25
           buildToolsVersion "25.0.3"
           productFlavors {
               x86 {
                   ndk {
                       abiFilter "x86"
                   }
               }
               arm {
                   ndk {
                       abiFilters "armeabi-v7a"
                   }
               }
               armv7 {
                   ndk {
                       abiFilters "armeabi-v7a"
                   }
               }
           }
           defaultConfig {
               applicationId "com.example.ledo.ndkapplication"
               minSdkVersion 22
               targetSdkVersion 25
               versionCode 1
               versionName "1.0"
               testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
               externalNativeBuild {
                   cmake {
                       cppFlags "-std=c++11 -frtti -fexceptions"
                       arguments '-DANDROID_PLATFORM=android-16'
                   }
               }
           }
           buildTypes {
               release {
                   minifyEnabled false
                   proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
               }
           }
           externalNativeBuild {
               cmake {
                   path "CMakeLists.txt"
               }
           }
           splits {
               abi {
                   enable true
                   reset()
                   include 'x86', 'armeabi-v7a'
                   universalApk true
               }
           }
       }

       dependencies {
           compile fileTree(dir: 'libs', include: ['*.jar'])
           androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
               exclude group: 'com.android.support', module: 'support-annotations'
           })
           compile 'com.android.support:appcompat-v7:25.3.1'
           compile 'com.android.support.constraint:constraint-layout:1.0.2'
           compile 'com.android.support:design:25.3.1'
           compile 'com.writingminds:FFmpegAndroid:0.3.2'
           testCompile 'junit:junit:4.12'
       }

    CMakeLists.txt

    # For more information about using CMake with Android Studio, read the
    # documentation: https://d.android.com/studio/projects/add-native-code.html

    # Sets the minimum version of CMake required to build the native library.

    cmake_minimum_required(VERSION 2.8)

    # Creates and names a library, sets it as either STATIC
    # or SHARED, and provides the relative paths to its source code.
    # You can define multiple libraries, and CMake builds them for you.
    # Gradle automatically packages shared libraries with your APK.

    add_library( # Sets the name of the library.
                native-lib

                # Sets the library as a shared library.
                SHARED

                # Provides a relative path to your source file(s).
                src/main/cpp/native-lib.cpp
                src/main/cpp/NativePlayer.h
                src/main/cpp/NativePlayer.cpp)

    # Searches for a specified prebuilt library and stores the path as a
    # variable. Because CMake includes system libraries in the search path by
    # default, you only need to specify the name of the public NDK library
    # you want to add. CMake verifies that the library exists before
    # completing its build.

    find_library( # Sets the name of the path variable.
                 log-lib

                 # Specifies the name of the NDK library that
                 # you want CMake to locate.
                 log )
    find_library(png-lib png)

    # Specifies libraries CMake should link to your target library. You
    # can link multiple libraries, such as libraries you define in this
    # build script, prebuilt third-party libraries, or system libraries.

    #avcodec
    #avfilter
    #avformat
    #avutil
    #swresample
    #swscale

    #${ANDROID_ABI}

    message(${ANDROID_ABI})
    set(FFMPEG_ROOT_DIR src/main/libs/ffmpeg/${ANDROID_ABI})

    add_library(avcodec STATIC IMPORTED)
    add_library(avformat STATIC IMPORTED)
    add_library(avfilter STATIC IMPORTED)
    add_library(avutil STATIC IMPORTED)
    add_library(swresample STATIC IMPORTED)
    add_library(swscale STATIC IMPORTED)

    #SET_TARGET_PROPERTIES(avcodec PROPERTIES LINKER_LANGUAGE C)
    set_target_properties(avcodec PROPERTIES IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/${FFMPEG_ROOT_DIR}/lib/libavcodec.a)
    #SET_TARGET_PROPERTIES(avfilter PROPERTIES LINKER_LANGUAGE C)
    set_target_properties(avfilter PROPERTIES IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/${FFMPEG_ROOT_DIR}/lib/libavfilter.a)
    #SET_TARGET_PROPERTIES(avformat PROPERTIES LINKER_LANGUAGE C)
    set_target_properties(avformat PROPERTIES IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/${FFMPEG_ROOT_DIR}/lib/libavformat.a)
    #SET_TARGET_PROPERTIES(avutil PROPERTIES LINKER_LANGUAGE C)
    set_target_properties(avutil PROPERTIES IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/${FFMPEG_ROOT_DIR}/lib/libavutil.a)
    #SET_TARGET_PROPERTIES(swresample PROPERTIES LINKER_LANGUAGE C)
    set_target_properties(swresample PROPERTIES IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/${FFMPEG_ROOT_DIR}/lib/libswresample.a)
    #SET_TARGET_PROPERTIES(swscale PROPERTIES LINKER_LANGUAGE C)
    set_target_properties(swscale PROPERTIES IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/${FFMPEG_ROOT_DIR}/lib/libswscale.a)

    include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/${FFMPEG_ROOT_DIR}/include )
    include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/${FFMPEG_ROOT_DIR}/lib )
    target_link_libraries( # Specifies the target library.
                          native-lib

                          # Links the target library to the log library
                          # included in the NDK.
                          ${log-lib}
                          avcodec
                          avformat
                          #avfilter
                          #swresample
                          #swscale
                          #avutil
                          GLESv2)

    I have .a files in following locations :
    %PROJECT_DIR%/app/src/libs/ffmpeg/armeabi-v7a
    %PROJECT_DIR%/app/src/libs/ffmpeg/armeabi-v7a-neon
    %PROJECT_DIR%/app/src/libs/ffmpeg/x86

    It doesn’t look to me that linker misses files themselves. (I get different out put if I misplace them.)

  • ffmpeg Command in Docker with Rust Tokio Closes Warp Server Connection (curl 52 Error)

    3 juin 2024, par user762345

    I’m encountering an issue where executing an ffmpeg concatenation command through Rust’s Tokio process in a Docker container causes subsequent HTTP requests to fail. The error occurs exclusively after running the ffmpeg command and making immediate requests, resulting in a “curl 52 empty response from server” error with the connection being closed. Notably, this issue does not occur when running the same setup outside of Docker. Additionally, if no HTTP requests are made after the ffmpeg command, the curl 52 error does not occur.

    


    Here is the verbose curl output of my minimum reproducible example (see below).

    


    curl -v "http://localhost:3030"
*   Trying 127.0.0.1:3030...
* Connected to localhost (127.0.0.1) port 3030 (#0)
> GET / HTTP/1.1
> Host: localhost:3030
> User-Agent: curl/8.1.2
> Accept: */*
> 
* Empty reply from server
* Closing connection 0
curl: (52) Empty reply from server


    


    Here are Docker logs from my minimum reproducible example (see below). The wav files are concatenated successfully, then the container appears to rebuild.

    


    [2024-06-03T05:26:58Z INFO  minimal_docker_webserver_post_error] Starting server on 0.0.0.0:3030
[2024-06-03T05:26:58Z INFO  warp::server] Server::run; addr=0.0.0.0:3030
[2024-06-03T05:26:58Z INFO  warp::server] listening on http://0.0.0.0:3030
[2024-06-03T05:27:07Z INFO  minimal_docker_webserver_post_error] WAV files concatenated successfully
[Running 'cargo run']
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.06s
     Running `target/debug/minimal_docker_webserver_post_error`
[2024-06-03T05:27:08Z INFO  minimal_docker_webserver_post_error] Starting server on 0.0.0.0:3030
[2024-06-03T05:27:08Z INFO  warp::server] Server::run; addr=0.0.0.0:3030
[2024-06-03T05:27:08Z INFO  warp::server] listening on http://0.0.0.0:3030


    


    What I have tried :
I tried using different web frameworks (Warp, Actix-web) and request crates (reqwest, ureq). I also tried running the setup outside of Docker, which worked as expected without any issues. Additionally, I tried running the setup in Docker without making any HTTP requests after the ffmpeg command, and the connection closed successfully without errors. I also tried posting to httpbin with a minimal request, but the issue persisted.

    


    Minimum reproducible example :

    


    main.rs

    


    use warp::Filter;&#xA;use reqwest::Client;&#xA;use std::convert::Infallible;&#xA;use log::{info, error};&#xA;use env_logger;&#xA;use tokio::process::Command;&#xA;&#xA;#[tokio::main]&#xA;async fn main() {&#xA;    std::env::set_var("RUST_LOG", "debug");&#xA;    env_logger::init();&#xA;&#xA;    let route = warp::path::end()&#xA;        .and_then(handle_request);&#xA;&#xA;    info!("Starting server on 0.0.0.0:3030");&#xA;    warp::serve(route)&#xA;        .run(([0, 0, 0, 0], 3030))&#xA;        .await;&#xA;}&#xA;&#xA;async fn handle_request() -> Result<impl infallible="infallible"> {&#xA;    let client = Client::new();&#xA;&#xA;    let output = Command::new("ffmpeg")&#xA;        .args(&amp;[&#xA;            "y",&#xA;            "-i", "concat:/usr/src/minimal_docker_webserver_post_error/file1.wav|/usr/src/minimal_docker_webserver_post_error/file2.wav",&#xA;            "-c", "copy",&#xA;            "/usr/src/minimal_docker_webserver_post_error/combined.wav"&#xA;        ])&#xA;        .output()&#xA;        .await;&#xA;&#xA;    match output {&#xA;        Ok(output) => {&#xA;            if output.status.success() {&#xA;                info!("WAV files concatenated successfully");&#xA;            } else {&#xA;                error!("Failed to concatenate WAV files: {:?}", output);&#xA;                return Ok(warp::reply::with_status("Failed to concatenate WAV files", warp::http::StatusCode::INTERNAL_SERVER_ERROR));&#xA;            }&#xA;        },&#xA;        Err(e) => {&#xA;            error!("Failed to execute ffmpeg: {:?}", e);&#xA;            return Ok(warp::reply::with_status("Failed to execute ffmpeg", warp::http::StatusCode::INTERNAL_SERVER_ERROR));&#xA;        }&#xA;    }&#xA;&#xA;    // ISSUE: Connection closes with curl: (52) Empty reply from server&#xA;    match client.get("https://httpbin.org/get").send().await {&#xA;        Ok(response) => info!("GET request successful: {:?}", response),&#xA;        Err(e) => error!("GET request failed: {:?}", e),&#xA;    }&#xA;&#xA;    match client.post("https://httpbin.org/post")&#xA;        .body("field1=value1&amp;field2=value2")&#xA;        .send().await {&#xA;        Ok(response) => info!("POST request successful: {:?}", response),&#xA;        Err(e) => error!("POST request failed: {:?}", e),&#xA;    }&#xA;&#xA;    Ok(warp::reply::with_status("Request handled", warp::http::StatusCode::OK))&#xA;}&#xA;</impl>

    &#xA;

    FFMPEG command to generate the two wav files for concatenation

    &#xA;

    ffmpeg -f lavfi -i "sine=frequency=1000:duration=5" file1.wav &amp;&amp; ffmpeg -f lavfi -i "sine=frequency=500:duration=5" file2.wav&#xA;

    &#xA;

    Dockerfile

    &#xA;

    # Use the official Rust image as the base image&#xA;FROM rust:latest&#xA;&#xA;# Install cargo-watch&#xA;RUN cargo install cargo-watch&#xA;&#xA;# Install ffmpeg&#xA;RUN apt-get update &amp;&amp; apt-get install -y ffmpeg&#xA;&#xA;# Set the working directory inside the container&#xA;WORKDIR /usr/src/minimal_docker_webserver_post_error&#xA;&#xA;# Copy the Cargo.toml and Cargo.lock files&#xA;COPY Cargo.toml Cargo.lock ./&#xA;&#xA;# Copy the source code&#xA;COPY src ./src&#xA;&#xA;# Copy wav files&#xA;COPY file1.wav /usr/src/minimal_docker_webserver_post_error/file1.wav&#xA;COPY file2.wav /usr/src/minimal_docker_webserver_post_error/file2.wav&#xA;&#xA;# Install dependencies&#xA;RUN cargo build --release&#xA;&#xA;# Expose the port that the application will run on&#xA;EXPOSE 3030&#xA;&#xA;# Set the entry point to use cargo-watch&#xA;CMD ["cargo", "watch", "-x", "run"]&#xA;

    &#xA;

    Cargo.toml

    &#xA;

    [package]&#xA;name = "minimal_docker_webserver_post_error"&#xA;version = "0.1.0"&#xA;edition = "2021"&#xA;&#xA;# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html&#xA;&#xA;[dependencies]&#xA;warp = "0.3"&#xA;reqwest = { version = "0.12.4", features = ["json"] }&#xA;tokio = { version = "1", features = ["full"] }&#xA;log = "0.4"&#xA;env_logger = "0.11.3"&#xA;

    &#xA;

    Making the request to the warp server

    &#xA;

    curl -v "http://localhost:3030"&#xA;

    &#xA;