Recherche avancée

Médias (0)

Mot : - Tags -/clipboard

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (67)

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-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 (8866)

  • Android FFMPEG Images to video quality is not good .

    18 juillet 2012, par RAJESH

    I am developing an android which used to control the images to video . For that after the lot of search i have found following sample. From this i have created a .so files .
    Github Sample . But it doesnt provided the video quality video format.
    I have attached the my video file. Initially i have tried with one image to video . But not getting any good results , so please advice me . My Vido

    Thanks in advance .

  • Video alignment error with ffmpeg in android system

    18 juillet 2012, par hyy

    I am using ffmeg to encode yuv pics to MPEG4 video file.The yuv420sp pics were got from camera preview(my android 2.3 phone). And I secondly use sws_scale change them to yuv420p.
    After the encoding the MPEG4 video has not the same image position. A
    percent of the right vertical part of the video has moved to the left side
    of the video. Does anyone know why is this happening ?

  • Android : How to play MP3 files with ID3 tags using FFMPEG

    16 juillet 2012, par Vipul Purohit

    I am trying to play various sound files using FFMPEG lib in android. I have managed to play most files but some file Example : MP3 files with ID3 tag are not playing. I tried playing files by taking reference of various example but didn't get any success.

    Here is my native side code :

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

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

    #define LOG_TAG "mylib"
    #define LOGI(...)  __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)
    #define LOGE(...)  __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)

    #define AUDIO_INBUF_SIZE 20480
    #define AUDIO_REFILL_THRESH 4096

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

           av_register_all();


       }

       jstring Java_ru_dzakhov_ffmpeg_test_MainActivity_loadFile(JNIEnv* env, jobject obj,jstring file,jbyteArray array)
       {
           {
                   jboolean            isfilenameCopy;
                   const char *        filename = (*env)->GetStringUTFChars(env, file, &amp;isfilenameCopy);
                   int audioStreamIndex;
                   AVCodec *codec;
                   AVCodecContext *c= NULL;
                   AVFormatContext * pFormatCtx;
                   AVCodecContext * aCodecCtx;
                   int out_size, len, audioStream=-1, i, err;
                   FILE *f, *outfile;
                   uint8_t *outbuf;
                   uint8_t inbuf[AUDIO_INBUF_SIZE + FF_INPUT_BUFFER_PADDING_SIZE];
                   AVPacket avpkt;
                   jclass              cls = (*env)->GetObjectClass(env, obj);
                   jmethodID           play = (*env)->GetMethodID(env, cls, "playSound", "([BI)V");//At the begining of your main function

                   LOGE("source file name is %s", filename);

                      avcodec_init();

                      av_register_all();

                      LOGE("Stage 1");
                      /* get format somthing of source file to AVFormatContext */
                      int lError;
                      if ((lError = av_open_input_file(&amp;pFormatCtx, filename, NULL, 0, NULL)) !=0 ) {
                          LOGE("Error open source file: %d", lError);
                          exit(1);
                      }
                      if ((lError = av_find_stream_info(pFormatCtx)) &lt; 0) {
                          LOGE("Error find stream information: %d", lError);
                          exit(1);
                      }
                      LOGE("Stage 1.5");
                      LOGE("audio format: %s", pFormatCtx->iformat->name);
                      LOGE("audio bitrate: %d", pFormatCtx->bit_rate);



                      audioStreamIndex = av_find_best_stream(pFormatCtx, AVMEDIA_TYPE_AUDIO, -1, -1, &amp;codec, 0);

    //                 audioStreamIndex=-1;
    //                 LOGE("nb_stream %d", pFormatCtx->nb_streams);
    //                     for(i=0; inb_streams; i++)
    //                     {
    //                         LOGE("nb_stream %d", pFormatCtx->nb_streams);
    //                         if(pFormatCtx->streams[i]->codec->codec_type==AVMEDIA_TYPE_AUDIO)
    //                         {
    //                             audioStream=i;
    //                             break;
    //                         }
    //                     }
    //
    //                     if(audioStream==-1)
    //                     {
    //                         LOGE("Cannot find audio");
    //                     }

                         LOGE("audioStreamIndex %d", audioStreamIndex);
    //                    if (audioStreamIndex == AVERROR_STREAM_NOT_FOUND) {
    //                        LOGE(1, "cannot find a audio stream");
    //                        exit(1);
    //                    } else if (audioStreamIndex == AVERROR_DECODER_NOT_FOUND) {
    //                        LOGE(1, "audio stream found, but no decoder is found!");
    //                        exit(1);
    //                    }
                         LOGE("audio codec: %s", codec->name);

                         /* get codec somthing of audio stream to AVCodecContext */
                         aCodecCtx = pFormatCtx->streams[audioStreamIndex]->codec;
                         if (avcodec_open(aCodecCtx, codec) &lt; 0) {
                         LOGE("cannot open the audio codec!");
                             exit(1);
                         }

                   printf("Audio decoding\n");
                   LOGE("Stage 1.7");
                   LOGE("S");
                   codec = avcodec_find_decoder(aCodecCtx->codec_id);
                   LOGE("Stage 1.8");
                   if (!codec) {
                       LOGE("codec not found\n");
                       exit(1);
                   }
                   LOGE("Stage 2");
    //              c= avcodec_alloc_context();
                   LOGE("Stage 3");
                   /* open it */
                   if (avcodec_open(aCodecCtx, codec) &lt; 0) {
                       LOGE("could upper");
                       fprintf(stderr, "could not open codec\n");
                       LOGE("could not open codec");

                   }
                   LOGE("Stage 4");
                   outbuf = malloc(AVCODEC_MAX_AUDIO_FRAME_SIZE);

                   f = fopen(filename, "rb");
                   if (!f) {
                       fprintf(stderr, "could not open %s\n", filename);
                       LOGE("could not open");
                       exit(1);
                   }

                   /* decode until eof */
                   avpkt.data = inbuf;
                   avpkt.size = fread(inbuf, 1, AUDIO_INBUF_SIZE, f);
                   LOGE("Stage 5");


                   while (avpkt.size > 0) {
    //                  LOGE("Stage 6");
                       out_size = (AVCODEC_MAX_AUDIO_FRAME_SIZE/3)*2;
                       len = avcodec_decode_audio3(aCodecCtx, (int16_t *)outbuf, &amp;out_size, &amp;avpkt);
                       LOGE("data_size %d len %d", out_size, len);
                       if (len &lt; 0) {
                           fprintf(stderr, "Error while decoding\n");
                           LOGE("DECODING ERROR");
                           LOGE("DECODING ERROR %d", len);
                           exit(1);
                       }
    //                  LOGE("Stage 7");
                       if (out_size > 0) {
                           /* if a frame has been decoded, output it */
    //                      LOGE("Stage 8");
                           jbyte *bytes = (*env)->GetByteArrayElements(env, array, NULL);
                           memcpy(bytes, outbuf, out_size); //
                           (*env)->ReleaseByteArrayElements(env, array, bytes, 0);
                           (*env)->CallVoidMethod(env, obj, play, array, out_size);
    //                      LOGE("DECODING ERROR5");
                       }
                       LOGE("Stage 9");
                       avpkt.size -= len;
                       avpkt.data += len;
                       if (avpkt.size &lt; AUDIO_REFILL_THRESH) {
                           /* Refill the input buffer, to avoid trying to decode
                            * incomplete frames. Instead of this, one could also use
                            * a parser, or use a proper container format through
                            * libavformat. */
                           memmove(inbuf, avpkt.data, avpkt.size);
                           avpkt.data = inbuf;
                           len = fread(avpkt.data + avpkt.size, 1,
                                       AUDIO_INBUF_SIZE - avpkt.size, f);
                           if (len > 0)
                               avpkt.size += len;
                       }
                   }
                   LOGE("Stage 12");
                   fclose(f);
                   free(outbuf);

                   avcodec_close(c);
                   av_free(c);

           }
       }

    Sorry for a rough code but I am testing on this code.

    I found the reason that the mp3 file has ID3 info, but I don't handle this, all the ID3 info data is decode as frame data, so the right frame header sign 0xFFE00000 can't be found and the method "avcodec_decode_audio3" return -1.

    I found this in question mp3 decoding using ffmpeg API (Header missing)

    If anyone can help me handle and play file with ID3 tags in MP3 and similar for other formats.