Recherche avancée

Médias (1)

Mot : - Tags -/musée

Autres articles (34)

  • Gestion des droits de création et d’édition des objets

    8 février 2011, par

    Par 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 ;

  • Diogene : création de masques spécifiques de formulaires d’édition de contenus

    26 octobre 2010, par

    Diogene est un des plugins ? SPIP activé par défaut (extension) lors de l’initialisation de MediaSPIP.
    A quoi sert ce plugin
    Création de masques de formulaires
    Le plugin Diogène permet de créer des masques de formulaires spécifiques par secteur sur les trois objets spécifiques SPIP que sont : les articles ; les rubriques ; les sites
    Il permet ainsi de définir en fonction d’un secteur particulier, un masque de formulaire par objet, ajoutant ou enlevant ainsi des champs afin de rendre le formulaire (...)

  • Problèmes fréquents

    10 mars 2010, par

    PHP et safe_mode activé
    Une des principales sources de problèmes relève de la configuration de PHP et notamment de l’activation du safe_mode
    La solution consiterait à soit désactiver le safe_mode soit placer le script dans un répertoire accessible par apache pour le site

Sur d’autres sites (2629)

  • How to implement Java methods in Nativescript ?

    6 septembre 2017, par Mike Wazowski

    I’m having trouble calling some methods of an Android java library for ffmpeg. I think I successfuly loaded the library because I can console.log the library object :

    JS: BuildConfig -> function () { [native code] }
    JS: ExecuteBinaryResponseHandler -> function () { [native code] }
    JS: FFmpeg -> function () { [native code] }
    JS: FFmpegExecuteResponseHandler -> function () { [native code] }
    JS: FFmpegLoadBinaryResponseHandler -> function () { [native code] }
    JS: LoadBinaryResponseHandler -> function () { [native code] }

    This is the code I want to "translate" (under Usage)

    This is how far I got (using this nativescript guide) :

    // [...]

    var MyCustomLoadBinaryResponseHandler =
    com.github.hiteshsondhi88.libffmpeg
    .LoadBinaryResponseHandler.extend({
     onStart: function() {
       console.log('Started loading ffmpeg');
     },
     onFailure: function() {
       console.log('Failed loading ffmpeg');
     },
     onSuccess: function() {
       console.log('Successfully loaded ffmpeg');
     },
     onFinish: function() {
       console.log('Finished loading ffmpeg');
     }
    });

    console.dir(MyCustomLoadBinaryResponseHandler);
    //^ this logs the following
    //~ JS: === dump(): dumping members ===
    //~ JS: "()function () { [native code] }"
    //~ JS: === dump(): dumping function and properties names ===
    //~ JS: extend()
    //~ JS: null()
    //~ JS: === dump(): finished ===

    var context = app.android.context;

    var ffmpeg =
    com.github.hiteshsondhi88.libffmpeg.FFmpeg.getInstance(context);

    console.dir(ffmpeg);
    //^ this logs the following
    //~ JS: === dump(): dumping members ===
    //~ JS: {
    //~ JS:     "constructor": "constructor()function () { [native code]
    //}"
    //~ JS: }
    //~ JS: === dump(): dumping function and properties names ===
    //~ JS: constructor()
    //~ JS: concatenate()
    //~ JS: execute()
    //~ JS: getDeviceFFmpegVersion()
    //~ JS: getLibraryFFmpegVersion()
    //~ JS: isFFmpegCommandRunning()
    //~ JS: killRunningProcesses()
    //~ JS: loadBinary()
    //~ JS: setTimeout()
    //~ JS: <init>()
    //~ JS: clone()
    //~ JS: equals()
    //~ JS: finalize()
    //~ JS: getClass()
    //~ JS: hashCode()
    //~ JS: notify()
    //~ JS: notifyAll()
    //~ JS: toString()
    //~ JS: wait()
    //~ JS: === dump(): finished ===


    ffmpeg.loadBinary(
     new MyCustomLoadBinaryResponseHandler()
    );

    var MyCustomExecuteBinaryResponseHandler =
    com.github.hiteshsondhi88.libffmpeg
    .ExecuteBinaryResponseHandler.extend({
     onStart: function() {
       console.log('Started running ffmpeg');
     },
     onProgress: function(thisMessage) {
       console.log(' ffmpeg running');
       console.log(thisMessage);
     },
     onFailure: function(thisMessage) {
       console.log('Failed running ffmpeg');
       console.log(thisMessage);
     },
     onSuccess: function(thisMessage) {
       console.log('Successfully run ffmpeg');
       console.log(thisMessage);
     },
     onFinish: function() {
       console.log('Finished running ffmpeg');
     }
    });

    //this is where it crashes
    ffmpeg.execute('-version', new
    MyCustomExecuteBinaryResponseHandler());</init>

    Unfortunately, the whole app crashes with no error message the app and I can’t continue unless I have more information on what is going on. Am I implementing the methods in a wrong way ? How do you suggest I continue ?

    edit : these are the last logs on the console

    09-06 11:22:58.884 31522 31522 F art     : art/runtime/java_vm_ext.cc:470]     from java.lang.Object com.tns.Runtime.callJSMethodNative(int, int, java.lang.String, int, boolean, java.lang.Object[])
    09-06 11:22:58.884 31522 31522 F art     : art/runtime/java_vm_ext.cc:470]   at com.tns.Runtime.callJSMethodNative(Native method)
    09-06 11:22:58.884 31522 31522 F art     : art/runtime/java_vm_ext.cc:470]   at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1043)
    09-06 11:22:58.884 31522 31522 F art     : art/runtime/java_vm_ext.cc:470]   at com.tns.Runtime.callJSMethodImpl(Runtime.java:925)
    09-06 11:22:58.884 31522 31522 F art     : art/runtime/java_vm_ext.cc:470]   at com.tns.Runtime.callJSMethod(Runtime.java:912)
    09-06 11:22:58.884 31522 31522 F art     : art/runtime/java_vm_ext.cc:470]   at com.tns.Runtime.callJSMethod(Runtime.java:896)
    09-06 11:22:58.884 31522 31522 F art     : art/runtime/java_vm_ext.cc:470]   at com.tns.Runtime.callJSMethod(Runtime.java:888)
    09-06 11:22:59.021 31522 31522 F art     : art/runtime/runtime.cc:403]   at com.tns.Runtime.callJSMethodNative(Native method)
    09-06 11:22:59.021 31522 31522 F art     : art/runtime/runtime.cc:403]   at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1043)
    09-06 11:22:59.021 31522 31522 F art     : art/runtime/runtime.cc:403]   at com.tns.Runtime.callJSMethodImpl(Runtime.java:925)
    09-06 11:22:59.021 31522 31522 F art     : art/runtime/runtime.cc:403]   at com.tns.Runtime.callJSMethod(Runtime.java:912)
    09-06 11:22:59.021 31522 31522 F art     : art/runtime/runtime.cc:403]   at com.tns.Runtime.callJSMethod(Runtime.java:896)
    09-06 11:22:59.021 31522 31522 F art     : art/runtime/runtime.cc:403]   at com.tns.Runtime.callJSMethod(Runtime.java:888)
    09-06 11:22:59.022 31522 31522 F art     : art/runtime/runtime.cc:403]   at com.tns.Runtime.callJSMethodNative(Native method)
    09-06 11:22:59.022 31522 31522 F art     : art/runtime/runtime.cc:403]   at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1043)
    09-06 11:22:59.022 31522 31522 F art     : art/runtime/runtime.cc:403]   at com.tns.Runtime.callJSMethodImpl(Runtime.java:925)
    09-06 11:22:59.022 31522 31522 F art     : art/runtime/runtime.cc:403]   at com.tns.Runtime.callJSMethod(Runtime.java:912)
    09-06 11:22:59.022 31522 31522 F art     : art/runtime/runtime.cc:403]   at com.tns.Runtime.callJSMethod(Runtime.java:896)
    09-06 11:22:59.022 31522 31522 F art     : art/runtime/runtime.cc:403]   at com.tns.Runtime.callJSMethod(Runtime.java:888)
  • avcodec_find_encoder(AV_CODEC_ID_H264) returns null

    28 février 2017, par Monjura Rumi

    I am building an android application which will encode image captured from camera preview and later decode it. I am using ffmpeg library to encode and decode. To build static library with x264 I have used this tutorial. http://dl.dropbox.com/u/22605641/ffmpeg_android/main.html. As a source code of ffmpeg if I use the one downloaded from the link given in tutorial I can built it but can’t build library if i use source code downloaded from here git clone git ://source.ffmpeg.org/ffmpeg.git ffmpeg. I have built library in ubuntu and using it in windows 7 in Eclipse. As I need only h264 encoder and decoder I have used following code for ffmpeg, slightly modified from tutorial.

    #!/bin/bash

    NDK=~/Documents/android-ndk-r8e
    PLATFORM=$NDK/platforms/android-8/arch-arm
    PREBUILT=$NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86
    PREFIX=/home/android-ffmpeg

    function build_one
    {
       ./configure --target-os=linux --prefix=$PREFIX \
       --enable-cross-compile \
       --enable-runtime-cpudetect \
       --disable-asm \
       --arch=arm \
       --cc=$PREBUILT/bin/arm-linux-androideabi-gcc \
       --cross-prefix=$PREBUILT/bin/arm-linux-androideabi- \
       --disable-stripping \
       --nm=$PREBUILT/bin/arm-linux-androideabi-nm \
       --sysroot=$PLATFORM \
       --enable-nonfree \
       --enable-version3 \
       --disable-everything \
       --enable-gpl \
       --disable-doc \
       --enable-avresample \
       --disable-ffplay \
       --disable-ffserver \
       --enable-ffmpeg \
       --disable-ffprobe \
       --enable-avcodec \
       --enable-libx264 \
       --enable-encoder=libx264 \
       --enable-encoder=libx264rgb \
       --enable-decoder=h263 \
       --enable-decoder=h264 \
       --enable-decoder=svq3 \  
       --enable-zlib \
       --enable-gpl \
       --enable-pic \
       --disable-devices \
       --disable-avdevice \
       --extra-cflags="-I/home/android-ffmpeg/include -fPIC -DANDROID -D__thumb__ -mthumb -Wfatal-errors -Wno-deprecated -mfloat-abi=softfp -mfpu=vfpv3-d16 -marm -march=armv7-a" \
       --extra-ldflags="-L/home/android-ffmpeg/lib"
    make -j4 install
    $PREBUILT/bin/arm-linux-androideabi-ar d libavcodec/libavcodec.a inverse.o
    $PREBUILT/bin/arm-linux-androideabi-ld -rpath-link=$PLATFORM/usr/lib -L$PLATFORM/usr/lib -L$PREFIX/lib  -soname libffmpeg.so -shared -nostdlib  -z,noexecstack -Bsymbolic --whole-archive --no-undefined -o $PREFIX/libffmpeg.so libavcodec/libavcodec.a libavfilter/libavfilter.a libavresample/libavresample.a libavformat/libavformat.a libavutil/libavutil.a libswscale/libswscale.a -lc -lm -lz -ldl -llog -lx264 --warn-once --dynamic-linker=/system/bin/linker $PREBUILT/lib/gcc/arm-linux-androideabi/4.4.3/libgcc.a
    }

    build_one

    After building library I have been able to build android ndk. A little part of my JNI code is here.

    JNIEXPORT jint JNICALL Java_com_example_testjava_TestjniActivity_initencoder(JNIEnv* env,jobject obj){

       av_register_all();
       avcodec_register_all();
       codec = avcodec_find_encoder(AV_CODEC_ID_H264);
       if (!codec) {
         __android_log_write(ANDROID_LOG_INFO, "debug", "not found");                
          return -1;
       }
    .
    .
    .
    }

    When I run my java source code that calls initencoder() I get -1 as return value and logcat prints "not found". That means avcodec_find_encoder() returns null and if condition is being ok. I don’t know what’s wrong. Why this function is returning null ? I have searched a lot but did not find any solution that could guide me to right direction. some says to use avcodec_init(). But ndk-build command fails and shows error saying undefined reference to ’avcodec_init()’. I have started with library build because I thought may be I am doing wrong from the first stage. Did I make any mistake in library building like not enabling things that I should ? Please help me here. This is kind of urgent for me.

  • avcodec_find_encoder(AV_CODEC_ID_H264) returns null

    28 février 2017, par Monjura Rumi

    I am building an android application which will encode image captured from camera preview and later decode it. I am using ffmpeg library to encode and decode. To build static library with x264 I have used this tutorial. http://dl.dropbox.com/u/22605641/ffmpeg_android/main.html. As a source code of ffmpeg if I use the one downloaded from the link given in tutorial I can built it but can’t build library if i use source code downloaded from here git clone git ://source.ffmpeg.org/ffmpeg.git ffmpeg. I have built library in ubuntu and using it in windows 7 in Eclipse. As I need only h264 encoder and decoder I have used following code for ffmpeg, slightly modified from tutorial.

    #!/bin/bash

    NDK=~/Documents/android-ndk-r8e
    PLATFORM=$NDK/platforms/android-8/arch-arm
    PREBUILT=$NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86
    PREFIX=/home/android-ffmpeg

    function build_one
    {
       ./configure --target-os=linux --prefix=$PREFIX \
       --enable-cross-compile \
       --enable-runtime-cpudetect \
       --disable-asm \
       --arch=arm \
       --cc=$PREBUILT/bin/arm-linux-androideabi-gcc \
       --cross-prefix=$PREBUILT/bin/arm-linux-androideabi- \
       --disable-stripping \
       --nm=$PREBUILT/bin/arm-linux-androideabi-nm \
       --sysroot=$PLATFORM \
       --enable-nonfree \
       --enable-version3 \
       --disable-everything \
       --enable-gpl \
       --disable-doc \
       --enable-avresample \
       --disable-ffplay \
       --disable-ffserver \
       --enable-ffmpeg \
       --disable-ffprobe \
       --enable-avcodec \
       --enable-libx264 \
       --enable-encoder=libx264 \
       --enable-encoder=libx264rgb \
       --enable-decoder=h263 \
       --enable-decoder=h264 \
       --enable-decoder=svq3 \  
       --enable-zlib \
       --enable-gpl \
       --enable-pic \
       --disable-devices \
       --disable-avdevice \
       --extra-cflags="-I/home/android-ffmpeg/include -fPIC -DANDROID -D__thumb__ -mthumb -Wfatal-errors -Wno-deprecated -mfloat-abi=softfp -mfpu=vfpv3-d16 -marm -march=armv7-a" \
       --extra-ldflags="-L/home/android-ffmpeg/lib"
    make -j4 install
    $PREBUILT/bin/arm-linux-androideabi-ar d libavcodec/libavcodec.a inverse.o
    $PREBUILT/bin/arm-linux-androideabi-ld -rpath-link=$PLATFORM/usr/lib -L$PLATFORM/usr/lib -L$PREFIX/lib  -soname libffmpeg.so -shared -nostdlib  -z,noexecstack -Bsymbolic --whole-archive --no-undefined -o $PREFIX/libffmpeg.so libavcodec/libavcodec.a libavfilter/libavfilter.a libavresample/libavresample.a libavformat/libavformat.a libavutil/libavutil.a libswscale/libswscale.a -lc -lm -lz -ldl -llog -lx264 --warn-once --dynamic-linker=/system/bin/linker $PREBUILT/lib/gcc/arm-linux-androideabi/4.4.3/libgcc.a
    }

    build_one

    After building library I have been able to build android ndk. A little part of my JNI code is here.

    JNIEXPORT jint JNICALL Java_com_example_testjava_TestjniActivity_initencoder(JNIEnv* env,jobject obj){

       av_register_all();
       avcodec_register_all();
       codec = avcodec_find_encoder(AV_CODEC_ID_H264);
       if (!codec) {
         __android_log_write(ANDROID_LOG_INFO, "debug", "not found");                
          return -1;
       }
    .
    .
    .
    }

    When I run my java source code that calls initencoder() I get -1 as return value and logcat prints "not found". That means avcodec_find_encoder() returns null and if condition is being ok. I don’t know what’s wrong. Why this function is returning null ? I have searched a lot but did not find any solution that could guide me to right direction. some says to use avcodec_init(). But ndk-build command fails and shows error saying undefined reference to ’avcodec_init()’. I have started with library build because I thought may be I am doing wrong from the first stage. Did I make any mistake in library building like not enabling things that I should ? Please help me here. This is kind of urgent for me.