Recherche avancée

Médias (91)

Autres articles (51)

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

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, 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 (...)

  • Support audio et vidéo HTML5

    10 avril 2011

    MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
    Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
    Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
    Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)

Sur d’autres sites (4877)

  • Optical Drive Value Proposition

    28 août 2010, par Multimedia Mike — General

    I have the absolute worst luck in the optical drive department. Ever since I started building my own computers in 1995 — close to the beginning of the CD-ROM epoch — I have burned through a staggering number of optical drives. Seriously, especially in the time period between about 1995-1998, I was going through a new drive every 4-6 months or so. This was also during that CD-ROM speed race where the the drive packages kept advertising loftier ‘X’ speed ratings. I didn’t play a lot of CD-ROM games during that timeframe, though I did listen to quite a few audio CDs through the computer.



    I use “optical drive” as a general term to describe CD-ROM drives, CD-R/RW drives, DVD-ROM drives, DVD-R/RW drives, and drives capable of doing any combination of reading and writing CDs and DVDs. In my observation, optical media seems to be falling out of favor somewhat, giving way to online digital distribution for things like games and software, as well as flash drives and external hard drives vs. recordable or rewritable media for backup and sneakernet duty. Somewhere along the line, I started to buy computers that didn’t even have optical drives. That’s why I have purchased at least 2 external USB drives (seen in the picture above). I don’t have much confidence that either works correctly. My main desktop until recently, a Mac Mini, has an internal optical drive that grew flaky and unreliable a few months after the unit was purchased.

    I just have really rotten luck with optical drives. The most reliable drive in my house is the one on the headless machine that, until recently, was the main workhorse on the FATE farm. The eject switch didn’t work correctly so I have to log in remotely, 'sudo eject', walk to the other room, pop in the disc, walk back to the other room, and work with the disc.

    Maybe optical media is on its way out, but I still have many hundreds of CD-ROMs. Perhaps I should move forward on this brainstorm to archive all of my optical discs on hard drives (and then think of some data mining experiments, just for the academic appeal), before it’s too late ; optical discs don’t last forever.

    So if I needed a good optical drive, what should I consider ? I’ve always been the type to go cheap, I admit. Many of my optical drives were on the lower end of the cost spectrum, which might have played some role in their rapid replacement. However, I’m not sold on the idea that I’m getting quality just because I’m paying a higher price. That LG unit at the top of the pile up there was relatively pricey and still didn’t fare well in the long (or even medium) term.

    Come to think of it, I used to have a ridiculous stockpile of castoff (but somehow still functional) optical drives. So many, in fact, that in 2004 I had a full size PC tower that I filled with 4 working drives, just because I could. Okay, I admit that there was a period where I had some reliable drives.

    That might be an idea, actually– throw together such a computer for heavy duty archival purposes. I visited Weird Stuff Warehouse today (needed some PC100 RAM for an old machine and they came through) and I think I could put together such a box rather cheaply.

    It’s a dirty job, but… well, you know the rest.

  • Evolution #2347 : Sélectionner tous les forums d’un coup

    26 septembre 2011, par cedric -

    oui je crois que il faudrait que le bloc de gauche reste fixe dans la page, pour continuer à l’avoir sous la main quand on défile la page. Je pense que ce serait mieux que de le mettre en pied de page où on ne l’y trouverait pas. (et oui j’ai été un peu (...)

  • Decoding audio via Android using FFMpeg

    31 octobre 2013, par Rob Haupt

    I can play Wav files using the below code without issues. When trying to play the exact same media in Mp3 format I only get garbled junk. I believe I am fundamentally misunderstanding how the avcodec_decode_audio3 function works.

    Since the Wav file contains PCM data when it is decoded it can go straight to the AudioTrack.write function. There must be some additional step to get Mp3s to work like this. I don't know what I'm missing, but I've been pulling my hair out for a week now.

    Java Code

    package com.rohaupt.RRD2;

    import java.io.FileNotFoundException;
    import java.io.FileOutputStream;
    import java.io.IOException;

    import android.app.Activity;
    import android.media.AudioFormat;
    import android.media.AudioManager;
    import android.media.AudioTrack;
    import android.media.MediaPlayer;
    import android.os.Bundle;
    import android.os.SystemClock;

    public class player extends Activity
    {
       private AudioTrack track;
       private FileOutputStream os;
       /** Called when the activity is first created. */
       @Override
       public void onCreate(Bundle savedInstanceState)
       {
           super.onCreate(savedInstanceState);
           setContentView(R.layout.main);
           createEngine();

           MediaPlayer mp = new MediaPlayer();
           mp.start();

           int bufSize = AudioTrack.getMinBufferSize(32000,
                                                     AudioFormat.CHANNEL_CONFIGURATION_STEREO,
                                                     AudioFormat.ENCODING_PCM_16BIT);


           track = new AudioTrack(AudioManager.STREAM_MUSIC,
                                  32000,
                                  AudioFormat.CHANNEL_CONFIGURATION_STEREO,
                                  AudioFormat.ENCODING_PCM_16BIT,
                                  bufSize,
                                  AudioTrack.MODE_STREAM);

           byte[] bytes = new byte[bufSize];

           try {
               os = new FileOutputStream("/sdcard/a.out",false);
           } catch (FileNotFoundException e) {
               // TODO Auto-generated catch block
               e.printStackTrace();
           }

           String result = loadFile("/sdcard/a.mp3",bytes);

           try {
               os.close();
           } catch (IOException e) {
               // TODO Auto-generated catch block
               e.printStackTrace();
           }
       }

       void playSound(byte[] buf, int size) {  
           //android.util.Log.v("ROHAUPT", "RAH Playing");
           if(track.getPlayState()!=AudioTrack.PLAYSTATE_PLAYING)
               track.play();
           track.write(buf, 0, size);

           try {
               os.write(buf,0,size);
           } catch (IOException e) {
               // TODO Auto-generated catch block
               e.printStackTrace();
           }
       }


       private native void createEngine();
       private native String loadFile(String file, byte[] array);

       /** Load jni .so on initialization*/
       static {
            System.loadLibrary("avutil");
            System.loadLibrary("avcore");
            System.loadLibrary("avcodec");
            System.loadLibrary("avformat");
            System.loadLibrary("avdevice");
            System.loadLibrary("swscale");
            System.loadLibrary("avfilter");
            System.loadLibrary("ffmpeg");
       }
    }

    C Code

    #include
    #include
    #include
    #include <android></android>log.h>

    #include "libavcodec/avcodec.h"
    #include "libavformat/avformat.h"

    #define DEBUG_TAG "ROHAUPT"  

    void Java_com_rohaupt_RRD2_player_createEngine(JNIEnv* env, jclass clazz)
       {
           avcodec_init();

           av_register_all();


       }

       jstring Java_com_rohaupt_RRD2_player_loadFile(JNIEnv* env, jobject obj,jstring file,jbyteArray array)
       {  
           jboolean            isCopy;  
           int                 i;
           int                 audioStream=-1;
           int                 res;
           int                 decoded = 0;
           int                 out_size;
           AVFormatContext     *pFormatCtx;
           AVCodecContext      *aCodecCtx;
           AVCodecContext      *c= NULL;
           AVCodec             *aCodec;
           AVPacket            packet;
           jclass              cls = (*env)->GetObjectClass(env, obj);
           jmethodID           play = (*env)->GetMethodID(env, cls, "playSound", "([BI)V");//At the begining of your main function
           const char *        szfile = (*env)->GetStringUTFChars(env, file, &amp;isCopy);
           int16_t *           pAudioBuffer = (int16_t *) av_malloc (AVCODEC_MAX_AUDIO_FRAME_SIZE*2+FF_INPUT_BUFFER_PADDING_SIZE);
           int16_t *           outBuffer = (int16_t *) av_malloc (AVCODEC_MAX_AUDIO_FRAME_SIZE*2+FF_INPUT_BUFFER_PADDING_SIZE);


           __android_log_print(ANDROID_LOG_INFO, DEBUG_TAG, "RAH28 Starting");
           res = av_open_input_file(&amp;pFormatCtx, szfile, NULL, 0, NULL);
           if(res!=0)
           {
               __android_log_print(ANDROID_LOG_DEBUG, DEBUG_TAG, "RAH opening input failed with result: [%d]", res);
               return file;
           }

           __android_log_print(ANDROID_LOG_DEBUG, DEBUG_TAG, "RAH getting stream info");
           res = av_find_stream_info(pFormatCtx);
           if(res&lt;0)
           {
               __android_log_print(ANDROID_LOG_DEBUG, DEBUG_TAG, "RAH getting stream info failed with result: [%d]", res);
               return file;
           }

           __android_log_print(ANDROID_LOG_DEBUG, DEBUG_TAG, "RAH getting audio stream");
           for(i=0; i &lt; pFormatCtx->nb_streams; i++) {
             if(pFormatCtx->streams[i]->codec->codec_type==AVMEDIA_TYPE_AUDIO &amp;&amp;
                audioStream &lt; 0) {
               audioStream=i;
             }
           }


           if(audioStream==-1)
           {
               __android_log_print(ANDROID_LOG_DEBUG, DEBUG_TAG, "RAH couldn&#39;t find audio stream");
               return file;
           }
           __android_log_print(ANDROID_LOG_DEBUG, DEBUG_TAG, "RAH audio stream found with result: [%d]", res);


           aCodecCtx=pFormatCtx->streams[audioStream]->codec;
           __android_log_print(ANDROID_LOG_DEBUG, DEBUG_TAG, "RAH audio codec info loaded");

           __android_log_print(ANDROID_LOG_DEBUG, DEBUG_TAG, "RAH audio codec info [%d]", aCodecCtx->codec_id);

           aCodec = avcodec_find_decoder(aCodecCtx->codec_id);
           if(!aCodec) {
              __android_log_print(ANDROID_LOG_DEBUG, DEBUG_TAG, "RAH audio codec unsupported");
              return file;
           }
           __android_log_print(ANDROID_LOG_DEBUG, DEBUG_TAG, "RAH audio codec info found");


           res = avcodec_open(aCodecCtx, aCodec);
           __android_log_print(ANDROID_LOG_DEBUG, DEBUG_TAG, "RAH audio codec loaded [%d] [%d]",aCodecCtx->sample_fmt,res);

           //c=avcodec_alloc_context();
           av_init_packet(&amp;packet);


           __android_log_print(ANDROID_LOG_DEBUG, DEBUG_TAG, "RAH channels [%d] sample rate [%d] sample format [%d]",aCodecCtx->channels,aCodecCtx->sample_rate,aCodecCtx->sample_fmt);


           int x,y;
           x=0;y=0;
           while (av_read_frame(pFormatCtx, &amp;packet)>= 0) {
               __android_log_print(ANDROID_LOG_DEBUG, DEBUG_TAG, "RAH frame read: [%d] [%d]",x++,y);

               if (aCodecCtx->codec_type == AVMEDIA_TYPE_AUDIO) {
                           __android_log_print(ANDROID_LOG_DEBUG, DEBUG_TAG, "RAH audio ready");
                           int data_size = AVCODEC_MAX_AUDIO_FRAME_SIZE*2+FF_INPUT_BUFFER_PADDING_SIZE;
                           int size=packet.size;
                           y=0;
                           decoded = 0;
                           __android_log_print(ANDROID_LOG_DEBUG, DEBUG_TAG, "RAH packet size: [%d]", size);
                           while(size > 0) {

                                   __android_log_print(ANDROID_LOG_DEBUG, DEBUG_TAG, "RAH decoding: [%d] [%d]",x,y++);
                                   int len = avcodec_decode_audio3(aCodecCtx, pAudioBuffer, &amp;data_size, &amp;packet);



                                   __android_log_print(ANDROID_LOG_DEBUG, DEBUG_TAG, "RAH 1 size [%d] len [%d] data_size [%d] out_size [%d]",size,len,data_size,out_size);
                                   jbyte *bytes = (*env)->GetByteArrayElements(env, array, NULL);

                                   memcpy(bytes + decoded, pAudioBuffer, len); //


                                   __android_log_print(ANDROID_LOG_DEBUG, DEBUG_TAG, "RAH 2");

                                   (*env)->ReleaseByteArrayElements(env, array, bytes, 0);
                                   __android_log_print(ANDROID_LOG_DEBUG, DEBUG_TAG, "RAH 3");

                                   (*env)->CallVoidMethod(env, obj, play, array, len);

                                   __android_log_print(ANDROID_LOG_DEBUG, DEBUG_TAG, "RAH 4");


                                   size -= len;
                                   decoded += len;

                          }
                          av_free_packet(&amp;packet);
               }

        }

             // Close the video file
           av_close_input_file(pFormatCtx);

           //__android_log_print(ANDROID_LOG_DEBUG, DEBUG_TAG, "RAH Finished Running result: [%d]", res);
           (*env)->ReleaseStringUTFChars(env, file, szfile);  
           return file;  
       }

    To add some detail. When Calling this function with a Wav File I get the following Log Data

    I/ROHAUPT (  227): RAH28 Starting
    D/ROHAUPT (  227): RAH getting stream info
    D/ROHAUPT (  227): RAH getting audio stream
    D/ROHAUPT (  227): RAH audio stream found with result: [0]
    D/ROHAUPT (  227): RAH audio codec info loaded
    D/ROHAUPT (  227): RAH audio codec info [65536]
    D/ROHAUPT (  227): RAH audio codec info found
    D/ROHAUPT (  227): RAH audio codec loaded [1] [0]
    D/ROHAUPT (  227): RAH channels [2] sample rate [32000] sample format [1]
    D/ROHAUPT (  227): RAH frame read: [0] [0]
    D/ROHAUPT (  227): RAH audio ready
    D/ROHAUPT (  227): RAH packet size: [4096]
    D/ROHAUPT (  227): RAH decoding: [1] [0]
    D/ROHAUPT (  227): RAH 1 size [4096] len [4096] data_size [4096] out_size [0]
    D/ROHAUPT (  227): RAH 2
    D/ROHAUPT (  227): RAH 3
    D/ROHAUPT (  227): RAH 4
    D/ROHAUPT (  227): RAH frame read: [1] [1]
    D/ROHAUPT (  227): RAH audio ready
    ...
    D/ROHAUPT (  227): RAH frame read: [924] [1]
    D/ROHAUPT (  227): RAH audio ready
    D/ROHAUPT (  227): RAH packet size: [4096]
    D/ROHAUPT (  227): RAH decoding: [925] [0]
    D/ROHAUPT (  227): RAH 1 size [4096] len [4096] data_size [4096] out_size [0]
    D/ROHAUPT (  227): RAH 2
    D/ROHAUPT (  227): RAH 3
    D/ROHAUPT (  227): RAH 4
    D/ROHAUPT (  227): RAH frame read: [925] [1]
    D/ROHAUPT (  227): RAH audio ready
    D/ROHAUPT (  227): RAH packet size: [3584]
    D/ROHAUPT (  227): RAH decoding: [926] [0]
    D/ROHAUPT (  227): RAH 1 size [3584] len [3584] data_size [3584] out_size [0]
    D/ROHAUPT (  227): RAH 2
    D/ROHAUPT (  227): RAH 3
    D/ROHAUPT (  227): RAH 4

    When calling with an Mp3 file I get the following

    I/ROHAUPT (  280): RAH28 Starting
    D/ROHAUPT (  280): RAH getting stream info
    D/ROHAUPT (  280): RAH getting audio stream
    D/ROHAUPT (  280): RAH audio stream found with result: [0]
    D/ROHAUPT (  280): RAH audio codec info loaded
    D/ROHAUPT (  280): RAH audio codec info [86017]
    D/ROHAUPT (  280): RAH audio codec info found
    D/ROHAUPT (  280): RAH audio codec loaded [1] [0]
    D/ROHAUPT (  280): RAH channels [2] sample rate [32000] sample format [1]
    D/ROHAUPT (  280): RAH frame read: [0] [0]
    D/ROHAUPT (  280): RAH audio ready
    D/ROHAUPT (  280): RAH packet size: [432]
    D/ROHAUPT (  280): RAH decoding: [1] [0]
    D/ROHAUPT (  280): RAH 1 size [432] len [432] data_size [4608] out_size [0]
    D/ROHAUPT (  280): RAH 2
    ...
    D/ROHAUPT (  280): RAH frame read: [822] [1]
    D/ROHAUPT (  280): RAH audio ready
    D/ROHAUPT (  280): RAH packet size: [432]
    D/ROHAUPT (  280): RAH decoding: [823] [0]
    D/ROHAUPT (  280): RAH 1 size [432] len [432] data_size [4608] out_size [0]
    D/ROHAUPT (  280): RAH 2
    D/ROHAUPT (  280): RAH 3
    D/ROHAUPT (  280): RAH 4
    D/ROHAUPT (  280): RAH frame read: [823] [1]
    D/ROHAUPT (  280): RAH audio ready
    D/ROHAUPT (  280): RAH packet size: [432]
    D/ROHAUPT (  280): RAH decoding: [824] [0]
    D/ROHAUPT (  280): RAH 1 size [432] len [432] data_size [4608] out_size [0]
    D/ROHAUPT (  280): RAH 2
    D/ROHAUPT (  280): RAH 3
    D/ROHAUPT (  280): RAH 4