
Recherche avancée
Médias (3)
-
GetID3 - Bloc informations de fichiers
9 avril 2013, par
Mis à jour : Mai 2013
Langue : français
Type : Image
-
GetID3 - Boutons supplémentaires
9 avril 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Image
-
Collections - Formulaire de création rapide
19 février 2013, par
Mis à jour : Février 2013
Langue : français
Type : Image
Autres articles (107)
-
Gestion des droits de création et d’édition des objets
8 février 2011, parPar défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;
-
(Dés)Activation de fonctionnalités (plugins)
18 février 2011, parPour 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 (...) -
Activation de l’inscription des visiteurs
12 avril 2011, parIl est également possible d’activer l’inscription des visiteurs ce qui permettra à tout un chacun d’ouvrir soit même un compte sur le canal en question dans le cadre de projets ouverts par exemple.
Pour ce faire, il suffit d’aller dans l’espace de configuration du site en choisissant le sous menus "Gestion des utilisateurs". Le premier formulaire visible correspond à cette fonctionnalité.
Par défaut, MediaSPIP a créé lors de son initialisation un élément de menu dans le menu du haut de la page menant (...)
Sur d’autres sites (8453)
-
Android : FFmpegFrameRecorder (JavaCV) UnsatisfiedLinkError
7 décembre 2015, par Olcay ErtaşI am trying to record video using
OpenCV
with some overlayed data. I have addedOpenCV
to my project and get camera preview successfully. While searching for how can I record video I came across toJavaCV
.JavaCV
has a sapmle activity calledRecordActivity
to demostrate video recording. It adds aCameraView
dynamically with code and get camera frames and record them inonPreviewFrame
method of theCameraView
. You can see the full code here :What I want to do is record video in
onCameraFrame
metod of theCvCameraViewListener2
interface instead ofonPreviewFrame
metod of thePreviewCallback
.public Mat onCameraFrame(CvCameraViewFrame inputFrame) {
final Mat rgba = inputFrame.rgba();
Core.flip(rgba, rgba, 1);
// Overlay some text and record video here.
return rgba;
}JavaCV record code block from RecordAvtivity.java
public void onPreviewFrame(byte[] data, Camera camera) {
if (audioRecord == null || audioRecord.getRecordingState() != AudioRecord.RECORDSTATE_RECORDING) {
startTime = System.currentTimeMillis();
return;
}
int i = imagesIndex++ % images.length;
Frame yuvImage = images[i];
timestamps[i] = 1000 * (System.currentTimeMillis() - startTime);
/* get video data */
if (yuvImage != null && recording) {
((ByteBuffer) yuvImage.image[0].position(0)).put(data);
try {
Log.v(TAG, "Writing Frame");
long t = 1000 * (System.currentTimeMillis() - startTime);
if (t > recorder.getTimestamp()) {
recorder.setTimestamp(t);
}
recorder.record(yuvImage);
} catch (FFmpegFrameRecorder.Exception e) {
Log.v(TAG, e.getMessage());
e.printStackTrace();
}
}
}JavaCV
needs data asbyte[]
but I haveMat
object. I need to cenvert between them efficiently.How can I do that ?
UPDATE :
I have used following solution to solve my initial problem
public Mat onCameraFrame(CvCameraViewFrame inputFrame) {
final Mat rgba = inputFrame.rgba();
Core.flip(rgba, rgba, 1);
if (data == null) {
data = new byte[(int)rgba.total() * rgba.channels()];
}
rgba.get(0,0, data);
record(data);
return rgba;
}
public void record(byte[] data) {
if (audioRecord == null || audioRecord.getRecordingState() != AudioRecord.RECORDSTATE_RECORDING) {
startTime = System.currentTimeMillis();
return;
}
int i = imagesIndex++ % images.length;
Frame yuvImage = images[i];
timestamps[i] = 1000 * (System.currentTimeMillis() - startTime);
/* get video data */
if (yuvImage != null && recording) {
((ByteBuffer) yuvImage.image[0].position(0)).put(data);
try {
Log.v(TAG, "Writing Frame");
long t = 1000 * (System.currentTimeMillis() - startTime);
if (t > recorder.getTimestamp()) {
recorder.setTimestamp(t);
}
recorder.record(yuvImage);
} catch (FFmpegFrameRecorder.Exception e) {
Log.v(TAG, e.getMessage());
e.printStackTrace();
}
}
}but now I am getting following error :
FATAL EXCEPTION: main
E/AndroidRuntime: Process: com.yceo.anlatbana, PID: 17622
E/AndroidRuntime: java.lang.UnsatisfiedLinkError: org.bytedeco.javacpp.avutil
E/AndroidRuntime: at java.lang.Class.classForName(Native Method)
E/AndroidRuntime: at java.lang.Class.forName(Class.java:309)
E/AndroidRuntime: at org.bytedeco.javacpp.Loader.load(Loader.java:390)
E/AndroidRuntime: at org.bytedeco.javacpp.Loader.load(Loader.java:358)
E/AndroidRuntime: at org.bytedeco.javacpp.avcodec$AVPacket.<clinit>(avcodec.java:1407)
E/AndroidRuntime: at org.bytedeco.javacv.FFmpegFrameRecorder.<init>(FFmpegFrameRecorder.java:149)
E/AndroidRuntime: at com.yceo.anlatbana.GameFragment.initRecorder(GameFragment.java:267)
E/AndroidRuntime: at com.yceo.anlatbana.GameFragment.onCreate(GameFragment.java:98)
E/AndroidRuntime: at android.support.v4.app.Fragment.performCreate(Fragment.java:1939)
E/AndroidRuntime: at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:988)
E/AndroidRuntime: at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1207)
E/AndroidRuntime: at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:738)
E/AndroidRuntime: at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1572)
E/AndroidRuntime: at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:493)
E/AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:739)
E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:95)
E/AndroidRuntime: at android.os.Looper.loop(Looper.java:135)
E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5310)
E/AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime: at java.lang.reflect.Method.invoke(Method.java:372)
E/AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
E/AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:699)
</init></clinit>I have tried solution from below question but it didn’t work :
JavaCV configuration in Android Studio
I have also tried both manual and gradle install for JavaCV but none of them worked.
I am using :
- Android Studio 1.4
- OpenCV 3.0
- JavaCV 1.0
-
Android FFMpeg guardian project IOException : Permission Denied
30 décembre 2016, par sector11I have cloned compiled ffmpeg binary from here https://github.com/guardianproject/android-ffmpeg and using in android project reference from here https://github.com/guardianproject/android-ffmpeg-java
But i am not able to get -version command output as it is saying
Caused by: java.io.IOException: Permission denied
Error Logs as follow :
Permission changed now
12-30 02:30:20.083 3765-3765/in.ashish29agre.ffmpeg I/System.out: Permission changed now
12-30 02:30:20.083 3765-3765/in.ashish29agre.ffmpeg I/System.out: Binary path: /data/data/in.ashish29agre.ffmpeg/app_bin/ffmpeg
12-30 02:30:20.093 3765-3765/in.ashish29agre.ffmpeg I/TestActivity: Progress: -version
12-30 02:30:20.093 3765-3765/in.ashish29agre.ffmpeg W/System.err: java.io.IOException: Error running exec(). Command: [-version] Working Directory: /data/data/in.ashish29agre.ffmpeg/app_bin Environment: [ANDROID_ROOT=/system, LOOP_MOUNTPOINT=/mnt/obb, ANDROID_BOOTLOGO=1, LD_LIBRARY_PATH=/vendor/lib:/system/lib, EXTERNAL_STORAGE=/storage/sdcard, ANDROID_SOCKET_zygote=9, ANDROID_DATA=/data, PATH=/sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin, ANDROID_ASSETS=/system/app, ASEC_MOUNTPOINT=/mnt/asec, BOOTCLASSPATH=/system/framework/core.jar:/system/framework/conscrypt.jar:/system/framework/okhttp.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/framework2.jar:/system/framework/telephony-common.jar:/system/framework/voip-common.jar:/system/framework/mms-common.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar:/system/framework/webviewchromium.jar, ANDROID_PROPERTY_WORKSPACE=8,0, ANDROID_STORAGE=/storage]
12-30 02:30:20.093 3765-3765/in.ashish29agre.ffmpeg W/System.err: at java.lang.ProcessManager.exec(ProcessManager.java:211)
12-30 02:30:20.093 3765-3765/in.ashish29agre.ffmpeg W/System.err: at java.lang.ProcessBuilder.start(ProcessBuilder.java:195)
12-30 02:30:20.093 3765-3765/in.ashish29agre.ffmpeg W/System.err: at org.ffmpeg.android.FfmpegController.execProcess(FfmpegController.java:137)
12-30 02:30:20.093 3765-3765/in.ashish29agre.ffmpeg W/System.err: at org.ffmpeg.android.FfmpegController.execFFMPEG(FfmpegController.java:101)
12-30 02:30:20.093 3765-3765/in.ashish29agre.ffmpeg W/System.err: at org.ffmpeg.android.FfmpegController.execFFMPEG(FfmpegController.java:111)
12-30 02:30:20.093 3765-3765/in.ashish29agre.ffmpeg W/System.err: at in.ashish29agre.ffmpeg.TestActivity.onResume(TestActivity.java:37)
12-30 02:30:20.093 3765-3765/in.ashish29agre.ffmpeg W/System.err: at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1192)
12-30 02:30:20.093 3765-3765/in.ashish29agre.ffmpeg W/System.err: at android.app.Activity.performResume(Activity.java:5310)
12-30 02:30:20.093 3765-3765/in.ashish29agre.ffmpeg W/System.err: at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2778)
12-30 02:30:20.093 3765-3765/in.ashish29agre.ffmpeg W/System.err: at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2817)
12-30 02:30:20.093 3765-3765/in.ashish29agre.ffmpeg W/System.err: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2250)
12-30 02:30:20.093 3765-3765/in.ashish29agre.ffmpeg W/System.err: at android.app.ActivityThread.access$800(ActivityThread.java:135)
12-30 02:30:20.093 3765-3765/in.ashish29agre.ffmpeg W/System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
12-30 02:30:20.093 3765-3765/in.ashish29agre.ffmpeg W/System.err: at android.os.Handler.dispatchMessage(Handler.java:102)
12-30 02:30:20.093 3765-3765/in.ashish29agre.ffmpeg W/System.err: at android.os.Looper.loop(Looper.java:136)
12-30 02:30:20.093 3765-3765/in.ashish29agre.ffmpeg W/System.err: at android.app.ActivityThread.main(ActivityThread.java:5017)
12-30 02:30:20.093 3765-3765/in.ashish29agre.ffmpeg W/System.err: at java.lang.reflect.Method.invokeNative(Native Method)
12-30 02:30:20.093 3765-3765/in.ashish29agre.ffmpeg W/System.err: at java.lang.reflect.Method.invoke(Method.java:515)
12-30 02:30:20.093 3765-3765/in.ashish29agre.ffmpeg W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
12-30 02:30:20.093 3765-3765/in.ashish29agre.ffmpeg W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
12-30 02:30:20.093 3765-3765/in.ashish29agre.ffmpeg W/System.err: at dalvik.system.NativeStart.main(Native Method)
12-30 02:30:20.093 3765-3765/in.ashish29agre.ffmpeg W/System.err: Caused by: java.io.IOException: Permission denied
12-30 02:30:20.093 3765-3765/in.ashish29agre.ffmpeg W/System.err: at java.lang.ProcessManager.exec(Native Method)
12-30 02:30:20.093 3765-3765/in.ashish29agre.ffmpeg W/System.err: at java.lang.ProcessManager.exec(ProcessManager.java:209)
12-30 02:30:20.093 3765-3765/in.ashish29agre.ffmpeg W/System.err: ... 20 moreMy Activity code is as follows :
@Override
protected void onResume() {
super.onResume();
File fileTmp = getCacheDir();
File fileAppRoot = new File(getApplicationInfo().dataDir);
List<string> commands = new ArrayList<>();
commands.add("-version");
try {
FfmpegController ffmpegController = new FfmpegController(this, fileAppRoot);
ffmpegController.installBinaries(this, true);
System.out.println("Binary path: " + ffmpegController.getBinaryPath());
ffmpegController.execFFMPEG(commands, new ShellUtils.ShellCallback() {
@Override
public void shellOut(String shellLine) {
logger.info("Progress: " + shellLine);
}
@Override
public void processComplete(int exitValue) {
logger.info("Process complete");
}
});
} catch (IOException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
</string>Just to make sure that i added permission of reading and writing external storage in manifest here is AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest package="in.test.ffmpeg">
<application>
<activity>
<action></action>
<category></category>
</activity>
</application>
</manifest> -
UnsatisfiedLInkError Linking to FFMPEG with NDK
28 novembre 2011, par U AvalosI compiled FFMPEG for android using bambuser's files. The compile runs fine. No errors.
I also made sure to change the package name in build.sh. However, once I try to link to the files, the phone throws an UnsatisfiedLinkError. This is the Androkd.mk file :LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
MY_LIB_PATH := ffmpeg-android/build/ffmpeg/armeabi/lib
LOCAL_MODULE := bambuser-libavcore
LOCAL_SRC_FILES := $(MY_LIB_PATH)/libavcore.so
include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := bambuser-libavformat
LOCAL_SRC_FILES := $(MY_LIB_PATH)/libavformat.so
include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := bambuser-libavcodec
LOCAL_SRC_FILES := $(MY_LIB_PATH)/libavcodec.so
include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := bambuser-libavdevice
LOCAL_SRC_FILES := $(MY_LIB_PATH)/libavdevice.so
include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := bambuser-libavfilter
LOCAL_SRC_FILES := $(MY_LIB_PATH)/libavfilter.so
include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := bambuser-libavutil
LOCAL_SRC_FILES := $(MY_LIB_PATH)/libavutil.so
include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := bambuser-libswscale
LOCAL_SRC_FILES := $(MY_LIB_PATH)/libswscale.so
include $(PREBUILT_SHARED_LIBRARY)
#local_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := libtest_jni
LOCAL_SRC_FILES := libtest/video.c
LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/include \
$(LOCAL_PATH)/ffmpeg-android/ffmpeg
LOCAL_LDLIBS := -L$(NDK_PLATFORMS_ROOT)/$(TARGET_PLATFORM)/arch-arm/usr/lib -L$(LOCAL_PATH) -L$(LOCAL_PATH)/ffmpeg-android/build/ffmpeg/armeabi/lib/ -lavformat -lavcodec -lavdevice -lavfilter -lavutil -lswscale -llog -lz -lm
#dl -lgcc
include $(BUILD_SHARED_LIBRARY)Video.c is dead simple :
#include <libavcodec></libavcodec>avcodec.h>
#include <libavformat></libavformat>avformat.h>
#include <libswscale></libswscale>swscale.h>
#include
#include
#include
#include <android></android>log.h>
void Java_com_bukabros_videolivewallpaper_Opengl2Renderer_loadNthFrame3
(JNIEnv * env, jobject this, jstring fileName) {
jboolean isCopy;
const char * szLogThis = (*env)->GetStringUTFChars(env, fileName, &isCopy);
__android_log_print(ANDROID_LOG_DEBUG, "NDK: ", "NDK:LC: [%s]", szLogThis);
}Tne corresponding Java code is also simple :
private native void loadNthFrame3(String fileName);
static {
System.loadLibrary("libtest_jni");
}But I get this error :
E/AndroidRuntime(11489): FATAL EXCEPTION: main
E/AndroidRuntime(11489): java.lang.ExceptionInInitializerError
E/AndroidRuntime(11489): at com.bukabros.videolivewallpaper.VideoLiveWallpaper$CubeEngine.<init>(VideoLiveWallpaper.java:147)
E/AndroidRuntime(11489): at com.bukabros.videolivewallpaper.VideoLiveWallpaper.onCreateEngine(VideoLiveWallpaper.java:120)
E/AndroidRuntime(11489): at android.service.wallpaper.WallpaperService$IWallpaperEngineWrapper.executeMessage(WallpaperService.java:814)
E/AndroidRuntime(11489): at com.android.internal.os.HandlerCaller$MyHandler.handleMessage(HandlerCaller.java:61)
E/AndroidRuntime(11489): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(11489): at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime(11489): at android.app.ActivityThread.main(ActivityThread.java:4627)
E/AndroidRuntime(11489): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(11489): at java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime(11489): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:878)
E/AndroidRuntime(11489): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:636)
E/AndroidRuntime(11489): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime(11489): Caused by: java.lang.UnsatisfiedLinkError: Library libtest_jni not found
E/AndroidRuntime(11489): at java.lang.Runtime.loadLibrary(Runtime.java:461)
E/AndroidRuntime(11489): at java.lang.System.loadLibrary(System.java:557)
E/AndroidRuntime(11489): at com.bukabros.videolivewallpaper.Opengl2Renderer.<clinit>(Opengl2Renderer.java:389)
E/AndroidRuntime(11489): ... 12 more
</clinit></init>I tried manually loading the prebuilt shared libraries (the bambuser files) in Java (using System.loadLibrary) but then it tells me that the files are not found.
If it helps, here's the output of readelf :
0x00000001 (NEEDED) Shared library: [libc.so]
0x00000001 (NEEDED) Shared library: [libstdc++.so]
0x00000001 (NEEDED) Shared library: [libm.so]
0x00000001 (NEEDED) Shared library: [/data/data/com.bukabros.videolivewallpaper/lib/libavformat.so]
0x00000001 (NEEDED) Shared library: [/data/data/com.bukabros.videolivewallpaper/lib/libavcodec.so]
0x00000001 (NEEDED) Shared library: [/data/data/com.bukabros.videolivewallpaper/lib/libavdevice.so]
0x00000001 (NEEDED) Shared library: [/data/data/com.bukabros.videolivewallpaper/lib/libavfilter.so]
0x00000001 (NEEDED) Shared library: [/data/data/com.bukabros.videolivewallpaper/lib/libavutil.so]
0x00000001 (NEEDED) Shared library: [/data/data/com.bukabros.videolivewallpaper/lib/libswscale.so]
0x00000001 (NEEDED) Shared library: [liblog.so]
0x00000001 (NEEDED) Shared library: [libz.so]
0x00000001 (NEEDED) Shared library: [libdl.so]
0x0000000e (SONAME) Library soname: [libtest_jni.so]
0x00000010 (SYMBOLIC) 0x0
0x00000004 (HASH) 0xd4
0x00000005 (STRTAB) 0x250
0x00000006 (SYMTAB) 0x130
0x0000000a (STRSZ) 712 (bytes)
0x0000000b (SYMENT) 16 (bytes)
0x00000003 (PLTGOT) 0x174c
0x00000002 (PLTRELSZ) 32 (bytes)
0x00000014 (PLTREL) REL
0x00000017 (JMPREL) 0x55c
0x6ffffffe (VERNEED) 0x53c
0x6fffffff (VERNEEDNUM) 1
0x6ffffff0 (VERSYM) 0x518
0x00000000 (NULL) 0x0Oh yeah. I'm using ndk r5.