Recherche avancée

Médias (16)

Mot : - Tags -/mp3

Autres articles (103)

  • Modifier la date de publication

    21 juin 2013, par

    Comment changer la date de publication d’un média ?
    Il faut au préalable rajouter un champ "Date de publication" dans le masque de formulaire adéquat :
    Administrer > Configuration des masques de formulaires > Sélectionner "Un média"
    Dans la rubrique "Champs à ajouter, cocher "Date de publication "
    Cliquer en bas de la page sur Enregistrer

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

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

  • Flutter Android release crash with ffmpeg_kit_flutter_new : Bad JNI version returned from JNI_OnLoad in libffmpegkit_abidetect.so (debug works) [closed]

    20 août, par Muhammad Rakha Almasah

    Problem
My Flutter app crashes only in release when the FFmpegKit plugin is registered. The app runs fine in debug on the same devices. The crash happens before my UI shows up, during plugin registration.

    


    Error (release logcat)

    


    On Samsung SM-A105G (Android 11, API 30, 32-bit device) :

    


    E/AndroidRuntime: FATAL EXCEPTION: main&#xA;java.lang.Error: FFmpegKit failed to start on brand: samsung, model: SM-A105G, device: a10, api level: 30,&#xA;abis: armeabi-v7a armeabi, 32bit abis: armeabi-v7a armeabi, 64bit abis: .&#xA;    at com.antonkarpenko.ffmpegkit.AbiDetect.<clinit>(SourceFile:3)&#xA;    at com.antonkarpenko.ffmpegkit.FFmpegKitConfig.<clinit>(SourceFile:16)&#xA;    ...&#xA;Caused by: java.lang.UnsatisfiedLinkError: Bad JNI version returned from JNI_OnLoad in&#xA;"/data/app/.../lib/arm/libffmpegkit_abidetect.so": 0&#xA;    at java.lang.Runtime.loadLibrary0(Runtime.java:1087)&#xA;    at java.lang.System.loadLibrary(System.java:1664)&#xA;&#xA;</clinit></clinit>

    &#xA;

    On Redmi 24094RAD4G (Android 15/35, 64-bit) :

    &#xA;

    java.lang.Error: FFmpegKit failed to start on brand: Redmi, model: 24094RAD4G, device: citrine, api level: 35,&#xA;abis: arm64-v8a armeabi-v7a armeabi, 32bit abis: armeabi-v7a armeabi, 64bit abis: arm64-v8a.&#xA;...&#xA;Caused by: java.lang.UnsatisfiedLinkError: Bad JNI version returned from JNI_OnLoad in&#xA;"/data/app/.../split_config.arm64_v8a.apk!/lib/arm64-v8a/libffmpegkit_abidetect.so": 0&#xA;&#xA;

    &#xA;

    What’s strange&#xA;In debug the plugin loads and prints :

    &#xA;

    I/ffmpeg-kit: Loaded ffmpeg-kit-full-gpl-arm-v7a-neon-6.0-20250810.&#xA;

    &#xA;

    and the app works normally.

    &#xA;

    Environment

    &#xA;

    Flutter (stable), Android

    &#xA;

    compileSdk = 35, minSdk = 24, targetSdk = 35

    &#xA;

    NDK I tried :

    &#xA;

    26.1.10909125 (recommended by many plugins)

    &#xA;

    25.2.9519653

    &#xA;

    Devices that crash in release :

    &#xA;

    Samsung SM-A105G (32-bit only, API 30)

    &#xA;

    Redmi 24094RAD4G (arm64-v8a capable, API 35)

    &#xA;

    Dependencies (relevant)

    &#xA;

    I mainly need FFmpeg through a video editor workflow.

    &#xA;

    Tried these FFmpeg packages :

    &#xA;

    ffmpeg_kit_flutter_new 3.2.0 → release crash

    &#xA;

    ffmpeg_kit_flutter_new 1.6.1 → release crash

    &#xA;

    (for testing) the discontinued ffmpeg_kit_flutter 6.0.3 → gradle couldn’t resolve com.arthenica:ffmpeg-kit-https:6.0-2 in release

    &#xA;

    Other media deps : video_editor (git), video_thumbnail (git), video_player, etc

    &#xA;

    App config&#xA;android/app/build.gradle

    &#xA;

    plugins {&#xA;    id "com.android.application"&#xA;    id "kotlin-android"&#xA;    id "dev.flutter.flutter-gradle-plugin"&#xA;}&#xA;&#xA;def localProperties = new Properties()&#xA;def localPropertiesFile = rootProject.file(&#x27;local.properties&#x27;)&#xA;if (localPropertiesFile.exists()) {&#xA;    localPropertiesFile.withReader(&#x27;UTF-8&#x27;) { reader ->&#xA;        localProperties.load(reader)&#xA;    }&#xA;}&#xA;&#xA;def keystoreProperties = new Properties()&#xA;def keystorePropertiesFile = rootProject.file(&#x27;key.properties&#x27;)&#xA;if (keystorePropertiesFile.exists()) {&#xA;    keystoreProperties.load(new FileInputStream(keystorePropertiesFile))&#xA;}&#xA;&#xA;&#xA;def flutterVersionCode = localProperties.getProperty(&#x27;flutter.versionCode&#x27;)&#xA;if (flutterVersionCode == null) {&#xA;    flutterVersionCode = &#x27;1&#x27;&#xA;}&#xA;&#xA;def flutterVersionName = localProperties.getProperty(&#x27;flutter.versionName&#x27;)&#xA;if (flutterVersionName == null) {&#xA;    flutterVersionName = &#x27;1.0&#x27;&#xA;}&#xA;&#xA;android {&#xA;    namespace "id.fitacademy.app"&#xA;    compileSdk = 35&#xA;    ndkVersion = "26.1.10909125"&#xA;&#xA;    compileOptions {&#xA;        sourceCompatibility JavaVersion.VERSION_1_8&#xA;        targetCompatibility JavaVersion.VERSION_1_8&#xA;    }&#xA;&#xA;    kotlinOptions {&#xA;        jvmTarget = JavaVersion.VERSION_1_8&#xA;    }&#xA;&#xA;    sourceSets {&#xA;        main.java.srcDirs &#x2B;= &#x27;src/main/kotlin&#x27;&#xA;    }&#xA;&#xA;    defaultConfig {&#xA;        applicationId "id.fitacademy.app"&#xA;        minSdkVersion 24&#xA;        targetSdkVersion 35&#xA;        versionCode flutterVersionCode.toInteger()&#xA;        versionName flutterVersionName&#xA;        multiDexEnabled true&#xA;        ndk { abiFilters "armeabi-v7a" }&#xA;    }&#xA;&#xA;    packagingOptions {&#xA;        jniLibs { useLegacyPackaging true }   // muat .so via ekstraksi&#xA;        // pickFirsts &#x2B;= [&#x27;**/libc&#x2B;&#x2B;_shared.so&#x27;]  // aktifkan hanya kalau ada konflik duplikat&#xA;    }&#xA;&#xA;    signingConfigs {&#xA;       release {&#xA;           keyAlias keystoreProperties[&#x27;keyAlias&#x27;]&#xA;           keyPassword keystoreProperties[&#x27;keyPassword&#x27;]&#xA;           storeFile keystoreProperties[&#x27;storeFile&#x27;] ? file(keystoreProperties[&#x27;storeFile&#x27;]) : null&#xA;           storePassword keystoreProperties[&#x27;storePassword&#x27;]&#xA;       }&#xA;        debug {&#xA;            keyAlias keystoreProperties[&#x27;keyAlias&#x27;]&#xA;            keyPassword keystoreProperties[&#x27;keyPassword&#x27;]&#xA;            storeFile keystoreProperties[&#x27;storeFile&#x27;] ? file(keystoreProperties[&#x27;storeFile&#x27;]) : null&#xA;            storePassword keystoreProperties[&#x27;storePassword&#x27;]&#xA;        }&#xA;   }&#xA;   buildTypes {&#xA;       release {&#xA;           signingConfig signingConfigs.release&#xA;       }&#xA;        debug {&#xA;            signingConfig signingConfigs.debug&#xA;        }&#xA;   }&#xA;}&#xA;&#xA;flutter {&#xA;    source &#x27;../..&#x27;&#xA;}&#xA;&#xA;

    &#xA;

    AndroidManifest.xml

    &#xA;

    <manifest>&#xA;&#xA;    &#xA;    &#xA;    &#xA;    &#xA;    &#xA;    &#xA;    &#xA;    &#xA;    &#xA;    &#xA;    &#xA;&#xA;    <queries>&#xA;        <package></package>&#xA;        <package></package>&#xA;        <package></package>&#xA;        <package></package>&#xA;        <package></package>&#xA;        <package></package>&#xA;        <package></package>&#xA;&#xA;        <provider></provider> &#xA;        <provider></provider> &#xA;&#xA;        <intent>&#xA;            <action></action>&#xA;            <data></data>&#xA;        </intent>&#xA;    </queries>&#xA;&#xA;    &#xA;        &#xA;            &#xA;            &#xA;            &#xA;                <action></action>&#xA;                <category></category>&#xA;            &#xA;&#xA;            &#xA;            &#xA;            &#xA;                <action></action>&#xA;                <category></category>&#xA;                <category></category>&#xA;                <data></data>&#xA;                <data></data>&#xA;                <data></data>&#xA;                <data></data>&#xA;            &#xA;        &#xA;&#xA;        &#xA;        &#xA;&#xA;&#xA;        &#xA;        &#xA;&#xA;        <provider>&#xA;            &#xA;        </provider>&#xA;&#xA;        &#xA;        &#xA;    &#xA;</manifest>&#xA;

    &#xA;

    APK / AAB inspection

    &#xA;

    jar tf app-release.apk | findstr ffmpegkit_abidetect shows the library is packaged, e.g. :

    &#xA;

    lib/arm/libffmpegkit_abidetect.so (on 32-bit build)

    &#xA;

    lib/arm64-v8a/libffmpegkit_abidetect.so (on 64-bit)

    &#xA;

    So the .so is present in the release artifact.

    &#xA;

    What I tried

    &#xA;

    Switch NDK 25.2 ↔ 26.1 and align with plugins.

    &#xA;

    Add android:extractNativeLibs="true" in the manifest.

    &#xA;

    packagingOptions jniLibs useLegacyPackaging true .

    &#xA;

    Build both APK and AAB, and also flutter run —release -d .

    &#xA;

    With and without abiFilters.

    &#xA;

    Full flutter clean, delete Gradle caches, rebuild.

    &#xA;

    Verified .env files and other assets are included (unrelated but checked).

    &#xA;

    The crash always happens at plugin startup in release with :&#xA;Bad JNI version returned from JNI_OnLoad in ... libffmpegkit_abidetect.so : 0.

    &#xA;

  • Failed to play m3u8 stream continously with ffmpeg APIs

    7 novembre 2024, par wangt13

    I am working on an embedded Linux system (5.10.24), where I want to play m3u8 audio stream with FFMPEG APIs.

    &#xA;

    Here is my code.

    &#xA;

    #include &#xA;#include &#xA;#include <alsa></alsa>asoundlib.h>&#xA;&#xA;#include <libswresample></libswresample>swresample.h>&#xA;#include <libavcodec></libavcodec>avcodec.h>&#xA;#include <libavformat></libavformat>avformat.h>&#xA;#include <libswscale></libswscale>swscale.h>&#xA;&#xA;int init_pcm_play(snd_pcm_t **playback_handle,snd_pcm_uframes_t chunk_size,unsigned int rate,int bits_per_sample,int channels)&#xA;{&#xA;    snd_pcm_hw_params_t *hw_params;&#xA;    snd_pcm_format_t format;&#xA;&#xA;    //1. openPCM,&#xA;    if (0 > snd_pcm_open(playback_handle, "default", SND_PCM_STREAM_PLAYBACK, 0))&#xA;    {&#xA;        printf("snd_pcm_open err\n");&#xA;        return -1;&#xA;    }&#xA;    //2. snd_pcm_hw_params_t&#xA;    if(0 > snd_pcm_hw_params_malloc (&amp;hw_params))&#xA;    {&#xA;        printf("snd_pcm_hw_params_malloc err\n");&#xA;        return -1;&#xA;    }&#xA;    //3. hw_params&#xA;    if(0 > snd_pcm_hw_params_any (*playback_handle, hw_params))&#xA;    {&#xA;        printf("snd_pcm_hw_params_any err\n");&#xA;        return -1;&#xA;    }&#xA;    //4.&#xA;    if (0 > snd_pcm_hw_params_set_access (*playback_handle, hw_params, SND_PCM_ACCESS_RW_INTERLEAVED))&#xA;    {&#xA;        printf("snd_pcm_hw_params_any err\n");&#xA;        return -1;&#xA;    }&#xA;&#xA;    //5. SND_PCM_FORMAT_U8,8&#xA;    if(8 == bits_per_sample) {&#xA;        format = SND_PCM_FORMAT_U8;&#xA;    }&#xA;    if(16 == bits_per_sample) {&#xA;        format = SND_PCM_FORMAT_S16_LE;&#xA;    }&#xA;    if (0 > snd_pcm_hw_params_set_format (*playback_handle, hw_params, format))&#xA;    {&#xA;        printf("snd_pcm_hw_params_set_format err\n");&#xA;        return -1;&#xA;    }&#xA;&#xA;    //6.&#xA;    if (0 > snd_pcm_hw_params_set_rate_near (*playback_handle, hw_params, &amp;rate, 0))&#xA;    {&#xA;        printf("snd_pcm_hw_params_set_rate_near err\n");&#xA;        return -1;&#xA;    }&#xA;    //7.&#xA;    if (0 > snd_pcm_hw_params_set_channels(*playback_handle, hw_params, 2))&#xA;    {&#xA;        printf("snd_pcm_hw_params_set_channels err\n");&#xA;        return -1;&#xA;    }&#xA;&#xA;    //8. set hw_params&#xA;    if (0 > snd_pcm_hw_params (*playback_handle, hw_params))&#xA;    {&#xA;        printf("snd_pcm_hw_params err\n");&#xA;        return -1;&#xA;    }&#xA;&#xA;    snd_pcm_hw_params_get_period_size(hw_params, &amp;chunk_size, 0);&#xA;&#xA;    snd_pcm_hw_params_free (hw_params);&#xA;&#xA;    return 0;&#xA;}&#xA;&#xA;int main(int argc, char *argv[])&#xA;{&#xA;    AVFormatContext *pFormatCtx = NULL; //for opening multi-media file&#xA;    int audioStream = -1;&#xA;    AVCodecContext *pCodecCtx = NULL;&#xA;    AVCodec *pCodec = NULL; // the codecer&#xA;    AVFrame *pFrame = NULL;&#xA;    AVPacket *packet;&#xA;    uint8_t *out_buffer;&#xA;    struct SwrContext *au_convert_ctx;&#xA;    snd_pcm_t *playback_handle;&#xA;    int bits_per_sample = 0;&#xA;&#xA;    if (avformat_open_input(&amp;pFormatCtx, argv[1], NULL, NULL) != 0) {&#xA;        printf("Failed to open video file!");&#xA;        return -1; // Couldn&#x27;t open file&#xA;    }&#xA;&#xA;    if(avformat_find_stream_info(pFormatCtx,NULL)&lt;0)&#xA;    {&#xA;        printf("Failed to find stream info.\n");&#xA;        return -1;&#xA;    }&#xA;&#xA;    audioStream = av_find_best_stream(pFormatCtx, AVMEDIA_TYPE_AUDIO, -1, -1, NULL, 0);&#xA;    if (audioStream == -1) {&#xA;        printf("Din&#x27;t find a video stream!");&#xA;        return -1;// Didn&#x27;t find a video stream&#xA;    }&#xA;&#xA;    av_dump_format(pFormatCtx, audioStream, NULL, false);&#xA;&#xA;    // Find the decoder for the video stream&#xA;    pCodec = avcodec_find_decoder(pFormatCtx->streams[audioStream]->codecpar->codec_id);&#xA;    if (pCodec == NULL) {&#xA;        printf("Unsupported codec!\n");&#xA;        return -1; // Codec not found&#xA;    }&#xA;&#xA;    // Copy context&#xA;    pCodecCtx = avcodec_alloc_context3(pCodec);&#xA;    AVCodecParameters *pCodecParam = pFormatCtx->streams[audioStream]->codecpar;&#xA;&#xA;     if (avcodec_parameters_to_context(pCodecCtx, pCodecParam) &lt; 0) {&#xA;        printf("Failed to set codec params\n");&#xA;        return -1;&#xA;    }&#xA;    // Open codec&#xA;    if (avcodec_open2(pCodecCtx, pCodec, NULL) &lt; 0) {&#xA;        printf("Failed to open decoder!\n");&#xA;        return -1; // Could not open codec&#xA;    }&#xA;    packet = av_packet_alloc();&#xA;    pFrame = av_frame_alloc();&#xA;&#xA;    uint64_t iInputLayout                    = av_get_default_channel_layout(pCodecCtx->channels);&#xA;    enum AVSampleFormat eInputSampleFormat   = pCodecCtx->sample_fmt;&#xA;    int         iInputSampleRate             = pCodecCtx->sample_rate;&#xA;&#xA;&#xA;    uint64_t iOutputLayout                   = av_get_default_channel_layout(pCodecCtx->channels);&#xA;    int      iOutputChans                    = pCodecCtx->channels;&#xA;    enum AVSampleFormat eOutputSampleFormat  = AV_SAMPLE_FMT_S16;&#xA;    int         iOutputSampleRate            = pCodecCtx->sample_rate;&#xA;&#xA;    au_convert_ctx = swr_alloc_set_opts(NULL,iOutputLayout, eOutputSampleFormat, iOutputSampleRate,&#xA;        iInputLayout,eInputSampleFormat, iInputSampleRate, 0, NULL);&#xA;    swr_init(au_convert_ctx);&#xA;    int iConvertLineSize = 0;&#xA;    int iConvertBuffSize  = av_samples_get_buffer_size(&amp;iConvertLineSize, iOutputChans, pCodecCtx->frame_size, eOutputSampleFormat, 0);&#xA;    printf("ochans: %d, ifrmsmp: %d, osfmt: %d, cbufsz: %d\n", iOutputChans, pCodecCtx->frame_size, eOutputSampleFormat, iConvertBuffSize);&#xA;    out_buffer = (uint8_t *) av_malloc(iConvertBuffSize);&#xA;&#xA;    if(eOutputSampleFormat == AV_SAMPLE_FMT_S16 )&#xA;    {&#xA;        bits_per_sample = 16;&#xA;    }&#xA;    /*** alsa handle ***/&#xA;    init_pcm_play(&amp;playback_handle,256, iOutputSampleRate,bits_per_sample,2);&#xA;&#xA;    if (0 > snd_pcm_prepare (playback_handle))&#xA;    {&#xA;        printf("snd_pcm_prepare err\n");&#xA;        return -1;&#xA;    }&#xA;&#xA;    while (av_read_frame(pFormatCtx, packet) >= 0) {&#xA;        if (packet->stream_index == audioStream) {&#xA;            avcodec_send_packet(pCodecCtx, packet);&#xA;            while (avcodec_receive_frame(pCodecCtx, pFrame) == 0) {&#xA;                int outframes = swr_convert(au_convert_ctx, &amp;out_buffer, pCodecCtx->frame_size, (const uint8_t **) pFrame->data, pFrame->nb_samples); // 转换音频&#xA;                snd_pcm_writei(playback_handle, out_buffer, outframes);&#xA;                av_frame_unref(pFrame);&#xA;            }&#xA;        }&#xA;        av_packet_unref(packet);&#xA;    }&#xA;    swr_free(&amp;au_convert_ctx);&#xA;    snd_pcm_close(playback_handle);&#xA;    av_freep(&amp;out_buffer);&#xA;&#xA;    return 0;&#xA;}&#xA;

    &#xA;

    When I ran it, i got following output.

    &#xA;

    ./ffmpeg_test http://live.ximalaya.com/radio-first-page-app/live/2730/64.m3&#xA;u8&#xA;[hls @ 0x21a8020] Skip (&#x27;#EXT-X-VERSION:3&#x27;)&#xA;[hls @ 0x21a8020] Opening &#x27;http://broadcast.tx.xmcdn.com/live/2730_64_241104_000015_2186.aac&#x27; for reading&#xA;[hls @ 0x21a8020] Opening &#x27;http://broadcast.tx.xmcdn.com/live/2730_64_241104_000015_2187.aac&#x27; for reading&#xA;Input #0, hls, from &#x27;(null)&#x27;:&#xA;  Duration: N/A, bitrate: N/A&#xA;  Program 0&#xA;    Metadata:&#xA;      variant_bitrate : 0&#xA;  Stream #0:0: Audio: aac (HE-AAC), 44100 Hz, stereo, fltp&#xA;    Metadata:&#xA;      variant_bitrate : 0&#xA;[http @ 0x21b7ba0] Opening &#x27;http://broadcast.tx.xmcdn.com/live/2730_64_241104_000015_2188.aac&#x27; for reading&#xA;[hls @ 0x21a8020] Skip (&#x27;#EXT-X-VERSION:3&#x27;)&#xA;[http @ 0x21d4c20] Opening &#x27;http://broadcast.tx.xmcdn.com/live/2730_64_241104_000015_2189.aac&#x27; for reading&#xA;

    &#xA;

    At the beginning, it can play the audio, until a second Opening http://... occurred.

    &#xA;

    How to make it work to play m3u8 audio stream continously ?

    &#xA;

  • Ffmpeg used to slow down mp3. Some audio players get length wrong [closed]

    14 août 2023, par AlanFRCPath

    I have used ffmpeg to slow down an audio file using :

    &#xA;

    ffmpeg -i input.mp3 -filter:a "atempo=0.8" -vn output.mp3

    &#xA;

    It produces a 45'55" output from a 36'44" input as expected.

    &#xA;

    In linux mplayer shows the output file as 45'55" as does ffprobe but XMMS shows it as double at 91'10". The audioplayer in my car which plays mp3 files on USB keys also misreads it length.

    &#xA;

    Can anyone provide some insight into what is going on here ?

    &#xA;