
Recherche avancée
Médias (16)
-
#7 Ambience
16 octobre 2011, par
Mis à jour : Juin 2015
Langue : English
Type : Audio
-
#6 Teaser Music
16 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#5 End Title
16 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#3 The Safest Place
16 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#4 Emo Creates
15 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#2 Typewriter Dance
15 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
Autres articles (103)
-
Modifier la date de publication
21 juin 2013, parComment 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, parMediaspip 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 2013Puis-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 AlmasahProblem
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
java.lang.Error: FFmpegKit failed to start on brand: samsung, model: SM-A105G, device: a10, api level: 30,
abis: armeabi-v7a armeabi, 32bit abis: armeabi-v7a armeabi, 64bit abis: .
 at com.antonkarpenko.ffmpegkit.AbiDetect.<clinit>(SourceFile:3)
 at com.antonkarpenko.ffmpegkit.FFmpegKitConfig.<clinit>(SourceFile:16)
 ...
Caused by: java.lang.UnsatisfiedLinkError: Bad JNI version returned from JNI_OnLoad in
"/data/app/.../lib/arm/libffmpegkit_abidetect.so": 0
 at java.lang.Runtime.loadLibrary0(Runtime.java:1087)
 at java.lang.System.loadLibrary(System.java:1664)

</clinit></clinit>


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


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




What’s strange
In debug the plugin loads and prints :


I/ffmpeg-kit: Loaded ffmpeg-kit-full-gpl-arm-v7a-neon-6.0-20250810.



and the app works normally.


Environment


Flutter (stable), Android


compileSdk = 35, minSdk = 24, targetSdk = 35


NDK I tried :


26.1.10909125 (recommended by many plugins)


25.2.9519653


Devices that crash in release :


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


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


Dependencies (relevant)


I mainly need FFmpeg through a video editor workflow.


Tried these FFmpeg packages :


ffmpeg_kit_flutter_new 3.2.0 → release crash


ffmpeg_kit_flutter_new 1.6.1 → release crash


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


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


App config
android/app/build.gradle


plugins {
 id "com.android.application"
 id "kotlin-android"
 id "dev.flutter.flutter-gradle-plugin"
}

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
 localPropertiesFile.withReader('UTF-8') { reader ->
 localProperties.load(reader)
 }
}

def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
 keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}


def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
 flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
 flutterVersionName = '1.0'
}

android {
 namespace "id.fitacademy.app"
 compileSdk = 35
 ndkVersion = "26.1.10909125"

 compileOptions {
 sourceCompatibility JavaVersion.VERSION_1_8
 targetCompatibility JavaVersion.VERSION_1_8
 }

 kotlinOptions {
 jvmTarget = JavaVersion.VERSION_1_8
 }

 sourceSets {
 main.java.srcDirs += 'src/main/kotlin'
 }

 defaultConfig {
 applicationId "id.fitacademy.app"
 minSdkVersion 24
 targetSdkVersion 35
 versionCode flutterVersionCode.toInteger()
 versionName flutterVersionName
 multiDexEnabled true
 ndk { abiFilters "armeabi-v7a" }
 }

 packagingOptions {
 jniLibs { useLegacyPackaging true } // muat .so via ekstraksi
 // pickFirsts += ['**/libc++_shared.so'] // aktifkan hanya kalau ada konflik duplikat
 }

 signingConfigs {
 release {
 keyAlias keystoreProperties['keyAlias']
 keyPassword keystoreProperties['keyPassword']
 storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
 storePassword keystoreProperties['storePassword']
 }
 debug {
 keyAlias keystoreProperties['keyAlias']
 keyPassword keystoreProperties['keyPassword']
 storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
 storePassword keystoreProperties['storePassword']
 }
 }
 buildTypes {
 release {
 signingConfig signingConfigs.release
 }
 debug {
 signingConfig signingConfigs.debug
 }
 }
}

flutter {
 source '../..'
}




AndroidManifest.xml


<manifest>

 
 
 
 
 
 
 
 
 
 
 

 <queries>
 <package></package>
 <package></package>
 <package></package>
 <package></package>
 <package></package>
 <package></package>
 <package></package>

 <provider></provider> 
 <provider></provider> 

 <intent>
 <action></action>
 <data></data>
 </intent>
 </queries>

 
 
 
 
 
 <action></action>
 <category></category>
 

 
 
 
 <action></action>
 <category></category>
 <category></category>
 <data></data>
 <data></data>
 <data></data>
 <data></data>
 
 

 
 


 
 

 <provider>
 
 </provider>

 
 
 
</manifest>



APK / AAB inspection


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


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


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


So the .so is present in the release artifact.


What I tried


Switch NDK 25.2 ↔ 26.1 and align with plugins.


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


packagingOptions jniLibs useLegacyPackaging true .


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


With and without abiFilters.


Full flutter clean, delete Gradle caches, rebuild.


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


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


-
Failed to play m3u8 stream continously with ffmpeg APIs
7 novembre 2024, par wangt13I am working on an embedded Linux system (5.10.24), where I want to play m3u8 audio stream with FFMPEG APIs.


Here is my code.


#include 
#include 
#include <alsa></alsa>asoundlib.h>

#include <libswresample></libswresample>swresample.h>
#include <libavcodec></libavcodec>avcodec.h>
#include <libavformat></libavformat>avformat.h>
#include <libswscale></libswscale>swscale.h>

int init_pcm_play(snd_pcm_t **playback_handle,snd_pcm_uframes_t chunk_size,unsigned int rate,int bits_per_sample,int channels)
{
 snd_pcm_hw_params_t *hw_params;
 snd_pcm_format_t format;

 //1. openPCM,
 if (0 > snd_pcm_open(playback_handle, "default", SND_PCM_STREAM_PLAYBACK, 0))
 {
 printf("snd_pcm_open err\n");
 return -1;
 }
 //2. snd_pcm_hw_params_t
 if(0 > snd_pcm_hw_params_malloc (&hw_params))
 {
 printf("snd_pcm_hw_params_malloc err\n");
 return -1;
 }
 //3. hw_params
 if(0 > snd_pcm_hw_params_any (*playback_handle, hw_params))
 {
 printf("snd_pcm_hw_params_any err\n");
 return -1;
 }
 //4.
 if (0 > snd_pcm_hw_params_set_access (*playback_handle, hw_params, SND_PCM_ACCESS_RW_INTERLEAVED))
 {
 printf("snd_pcm_hw_params_any err\n");
 return -1;
 }

 //5. SND_PCM_FORMAT_U8,8
 if(8 == bits_per_sample) {
 format = SND_PCM_FORMAT_U8;
 }
 if(16 == bits_per_sample) {
 format = SND_PCM_FORMAT_S16_LE;
 }
 if (0 > snd_pcm_hw_params_set_format (*playback_handle, hw_params, format))
 {
 printf("snd_pcm_hw_params_set_format err\n");
 return -1;
 }

 //6.
 if (0 > snd_pcm_hw_params_set_rate_near (*playback_handle, hw_params, &rate, 0))
 {
 printf("snd_pcm_hw_params_set_rate_near err\n");
 return -1;
 }
 //7.
 if (0 > snd_pcm_hw_params_set_channels(*playback_handle, hw_params, 2))
 {
 printf("snd_pcm_hw_params_set_channels err\n");
 return -1;
 }

 //8. set hw_params
 if (0 > snd_pcm_hw_params (*playback_handle, hw_params))
 {
 printf("snd_pcm_hw_params err\n");
 return -1;
 }

 snd_pcm_hw_params_get_period_size(hw_params, &chunk_size, 0);

 snd_pcm_hw_params_free (hw_params);

 return 0;
}

int main(int argc, char *argv[])
{
 AVFormatContext *pFormatCtx = NULL; //for opening multi-media file
 int audioStream = -1;
 AVCodecContext *pCodecCtx = NULL;
 AVCodec *pCodec = NULL; // the codecer
 AVFrame *pFrame = NULL;
 AVPacket *packet;
 uint8_t *out_buffer;
 struct SwrContext *au_convert_ctx;
 snd_pcm_t *playback_handle;
 int bits_per_sample = 0;

 if (avformat_open_input(&pFormatCtx, argv[1], NULL, NULL) != 0) {
 printf("Failed to open video file!");
 return -1; // Couldn't open file
 }

 if(avformat_find_stream_info(pFormatCtx,NULL)<0)
 {
 printf("Failed to find stream info.\n");
 return -1;
 }

 audioStream = av_find_best_stream(pFormatCtx, AVMEDIA_TYPE_AUDIO, -1, -1, NULL, 0);
 if (audioStream == -1) {
 printf("Din't find a video stream!");
 return -1;// Didn't find a video stream
 }

 av_dump_format(pFormatCtx, audioStream, NULL, false);

 // Find the decoder for the video stream
 pCodec = avcodec_find_decoder(pFormatCtx->streams[audioStream]->codecpar->codec_id);
 if (pCodec == NULL) {
 printf("Unsupported codec!\n");
 return -1; // Codec not found
 }

 // Copy context
 pCodecCtx = avcodec_alloc_context3(pCodec);
 AVCodecParameters *pCodecParam = pFormatCtx->streams[audioStream]->codecpar;

 if (avcodec_parameters_to_context(pCodecCtx, pCodecParam) < 0) {
 printf("Failed to set codec params\n");
 return -1;
 }
 // Open codec
 if (avcodec_open2(pCodecCtx, pCodec, NULL) < 0) {
 printf("Failed to open decoder!\n");
 return -1; // Could not open codec
 }
 packet = av_packet_alloc();
 pFrame = av_frame_alloc();

 uint64_t iInputLayout = av_get_default_channel_layout(pCodecCtx->channels);
 enum AVSampleFormat eInputSampleFormat = pCodecCtx->sample_fmt;
 int iInputSampleRate = pCodecCtx->sample_rate;


 uint64_t iOutputLayout = av_get_default_channel_layout(pCodecCtx->channels);
 int iOutputChans = pCodecCtx->channels;
 enum AVSampleFormat eOutputSampleFormat = AV_SAMPLE_FMT_S16;
 int iOutputSampleRate = pCodecCtx->sample_rate;

 au_convert_ctx = swr_alloc_set_opts(NULL,iOutputLayout, eOutputSampleFormat, iOutputSampleRate,
 iInputLayout,eInputSampleFormat, iInputSampleRate, 0, NULL);
 swr_init(au_convert_ctx);
 int iConvertLineSize = 0;
 int iConvertBuffSize = av_samples_get_buffer_size(&iConvertLineSize, iOutputChans, pCodecCtx->frame_size, eOutputSampleFormat, 0);
 printf("ochans: %d, ifrmsmp: %d, osfmt: %d, cbufsz: %d\n", iOutputChans, pCodecCtx->frame_size, eOutputSampleFormat, iConvertBuffSize);
 out_buffer = (uint8_t *) av_malloc(iConvertBuffSize);

 if(eOutputSampleFormat == AV_SAMPLE_FMT_S16 )
 {
 bits_per_sample = 16;
 }
 /*** alsa handle ***/
 init_pcm_play(&playback_handle,256, iOutputSampleRate,bits_per_sample,2);

 if (0 > snd_pcm_prepare (playback_handle))
 {
 printf("snd_pcm_prepare err\n");
 return -1;
 }

 while (av_read_frame(pFormatCtx, packet) >= 0) {
 if (packet->stream_index == audioStream) {
 avcodec_send_packet(pCodecCtx, packet);
 while (avcodec_receive_frame(pCodecCtx, pFrame) == 0) {
 int outframes = swr_convert(au_convert_ctx, &out_buffer, pCodecCtx->frame_size, (const uint8_t **) pFrame->data, pFrame->nb_samples); // 转换音频
 snd_pcm_writei(playback_handle, out_buffer, outframes);
 av_frame_unref(pFrame);
 }
 }
 av_packet_unref(packet);
 }
 swr_free(&au_convert_ctx);
 snd_pcm_close(playback_handle);
 av_freep(&out_buffer);

 return 0;
}



When I ran it, i got following output.


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



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

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


-
Ffmpeg used to slow down mp3. Some audio players get length wrong [closed]
14 août 2023, par AlanFRCPathI have used ffmpeg to slow down an audio file using :


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


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


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.


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