Recherche avancée

Médias (91)

Autres articles (76)

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 est la première version de MediaSPIP stable.
    Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • XMP PHP

    13 mai 2011, par

    Dixit Wikipedia, XMP signifie :
    Extensible Metadata Platform ou XMP est un format de métadonnées basé sur XML utilisé dans les applications PDF, de photographie et de graphisme. Il a été lancé par Adobe Systems en avril 2001 en étant intégré à la version 5.0 d’Adobe Acrobat.
    Étant basé sur XML, il gère un ensemble de tags dynamiques pour l’utilisation dans le cadre du Web sémantique.
    XMP permet d’enregistrer sous forme d’un document XML des informations relatives à un fichier : titre, auteur, historique (...)

  • Use, discuss, criticize

    13 avril 2011, par

    Talk to people directly involved in MediaSPIP’s development, or to people around you who could use MediaSPIP to share, enhance or develop their creative projects.
    The bigger the community, the more MediaSPIP’s potential will be explored and the faster the software will evolve.
    A discussion list is available for all exchanges between users.

Sur d’autres sites (11554)

  • Android merging videos by frames

    6 janvier 2014, par amit

    I want to develop video merge application in android. I am able to merge two videos but if the video size is more the device gets hanged .So I want to get frames of input video2(around 15 sec.) and merge it to video1. Any one have an idea how to get the frames from video. Is there direct native method available for that to get frames ?.

  • Configure ffmpg for android under Windows system [on hold]

    7 janvier 2014, par Mrityunjoy Mukherjee

    How do I configure ffmpeg for android under Windows system. I have searched a lot . But I have not got the proper way to configure ffmpeg for android under Windows system. Please help on this topic.......

  • Android using JNI without static variables

    21 février 2013, par William Seemann

    I created my own version of Android's MediaMetadataRetriever using the source code for MediaMetadataRetriever.java as the basis. My version uses FFmpeg to retrieve the metadata. This approach works however it relies on static variables in the C code to retain state in between JNI calls. This means I can only use one instance of this class at a time or the state can get corrupted. The two Java functions are defined as follows :

    public class MediaMetadataRetriever
    {
       static {
           System.loadLibrary("metadata_retriever_jni");
       }

       public MediaMetadataRetriever() {

       }

       public native void setDataSource(String path) throws IllegalArgumentException;
       public native String extractMetadata(String key);

    }

    The corresponding C (JNI) code code is :

    const char *TAG = "Java_com_example_metadataexample_MediaMetadataRetriever";
    static AVFormatContext *pFormatCtx = NULL;

    JNIEXPORT void JNICALL
    Java_com_example_metadataexample_MediaMetadataRetriever_setDataSource(JNIEnv *env, jclass obj, jstring jpath) {

       if (pFormatCtx) {
           avformat_close_input(&pFormatCtx);
       }

       char duration[30] = "0";
       const char *uri;

       uri = (*env)->GetStringUTFChars(env, jpath, NULL);

       if (avformat_open_input(&pFormatCtx, uri, NULL, NULL) != 0) {
           __android_log_write(ANDROID_LOG_INFO, TAG, "Metadata could not be retrieved");
           (*env)->ReleaseStringUTFChars(env, jpath, uri);
           jniThrowException(env, "java/lang/IllegalArgumentException", NULL);
           return;
       }

       if (avformat_find_stream_info(pFormatCtx, NULL) < 0) {
           __android_log_write(ANDROID_LOG_INFO, TAG, "Metadata could not be retrieved");
           avformat_close_input(&pFormatCtx);
           (*env)->ReleaseStringUTFChars(env, jpath, uri);
           jniThrowException(env, "java/lang/IllegalArgumentException", NULL);
           return;
       }

       (*env)->ReleaseStringUTFChars(env, jpath, uri);
    }

    JNIEXPORT jstring JNICALL
    Java_com_example_metadataexample_MediaMetadataRetriever_extractMetadata(JNIEnv *env, jclass obj, jstring jkey) {

       const char *key;
       jstring value = NULL;

       key = (*env)->GetStringUTFChars(env, jkey, NULL) ;

       if (!pFormatCtx) {
           goto fail;
       }

       if (key) {
           if (av_dict_get(pFormatCtx->metadata, key, NULL, AV_DICT_IGNORE_SUFFIX)) {
               value = (*env)->NewStringUTF(env, av_dict_get(pFormatCtx->metadata, key, NULL, AV_DICT_IGNORE_SUFFIX)->value);
           }
       }

       fail:
       (*env)->ReleaseStringUTFChars(env, jkey, key);

       return value;
    }

    Sample usage that outlines my issue would be :

    MediaMetadataRetriever mmr = new MediaMetadataRetriever();
    mmr.setDataSource("one.mp3");

    MediaMetadataRetriever mmr2 = new MediaMetadataRetriever();
    // This line resets the data source to two.mp3
    mmr2.setDataSource("two.mp3");

    // should retrieve the artist from one.mp3 but retrieves it from two.mp3 due to the static
    // variable being reset in the previous statement      
    String artist = mmr.extractMetadata(MediaMetadataRetriever.ARTIST);

    Can someone explain how I would structure this code so I could use multiple instances of MediaMetadataRetriever without them interfering with one another ? I don't want to switch the code to C++ and I'm fairly certain I don't need to modify MediaMetadataRetriever.java since this code is taken line-for-line from the Android framework (which allows multiple instances, see example below). It appears I need to re-structure the C code but I'm unsure how to retain state across JNI calls without using a static variable. Thanks in advance.

    File file1 = new File(Environment.getExternalStorageDirectory(), "Music/one.mp3");
    File file2 = new File(Environment.getExternalStorageDirectory(), "Music/two.mp3");

    android.media.MediaMetadataRetriever mmr = new android.media.MediaMetadataRetriever();
    mmr.setDataSource(file1.toString());

    android.media.MediaMetadataRetriever mmr2 = new android.media.MediaMetadataRetriever();
    mmr2.setDataSource(file2.toString());

    // Returns the artist of one.mp3, not two.mp3, as expected. This is the expected behavior
    // and confirms that multiple instances of MediaMetadataRetriever can be used simultaneously
    mmr.extractMetadata(android.media.MediaMetadataRetriever.METADATA_KEY_ARTIST));