Recherche avancée

Médias (1)

Mot : - Tags -/epub

Autres articles (111)

  • 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

  • Soumettre bugs et patchs

    10 avril 2011

    Un logiciel n’est malheureusement jamais parfait...
    Si vous pensez avoir mis la main sur un bug, reportez le dans notre système de tickets en prenant bien soin de nous remonter certaines informations pertinentes : le type de navigateur et sa version exacte avec lequel vous avez l’anomalie ; une explication la plus précise possible du problème rencontré ; si possibles les étapes pour reproduire le problème ; un lien vers le site / la page en question ;
    Si vous pensez avoir résolu vous même le bug (...)

  • Possibilité de déploiement en ferme

    12 avril 2011, par

    MediaSPIP peut être installé comme une ferme, avec un seul "noyau" hébergé sur un serveur dédié et utilisé par une multitude de sites différents.
    Cela permet, par exemple : de pouvoir partager les frais de mise en œuvre entre plusieurs projets / individus ; de pouvoir déployer rapidement une multitude de sites uniques ; d’éviter d’avoir à mettre l’ensemble des créations dans un fourre-tout numérique comme c’est le cas pour les grandes plate-formes tout public disséminées sur le (...)

Sur d’autres sites (10269)

  • Video processing / playback with alpha channel in C# or C++ [closed]

    2 avril 2013, par Corylulu

    WHAT I'M AFTER

    I've been exploring the best ways to do this, but seem to keep running into hiccups when trying to playback video and then grab the frame with an alpha channel (ARGB) to then be further manipulated.

    I've gotten everything to work with AForge to then find out that the Alpha gets stripped out during the process. I considered OpenCV, but the Emgu CV has a different license that I can't use and I can't verify that OpenCV can read Alpha channels as well.

    I looked into FFMPEG .NET wrappers, but haven't found any that are out of their alpha phase or have a license I can use them with (since this could be used for commercial purposes and can't be open sourced)

    So I'm looking for a library that is preferably C# or C++ that can play a .MOV or .AVI while preserving it's alpha channel when I make it into a Bitmap.

    SUMMARY [TL ;DR]

    I'm looking for library / sample code

    • Written preferably in C#, C++ as a fallback. Hopefully easy enough to use.
    • Can playback AVI and MOV files
    • Will preserve the alpha channel
    • Will allow me to access each frame's ARGB values directly
    • Preferably something that uses the FFMPEG library since it's able to read most formats I need
  • Decode audio using libavcodec and play using libAO ?

    21 mars 2012, par Ashika Umanga Umagiliya

    I use following code snippet to decode audio files (tested with MP3,WAV,WMV).

    But when it plays the audio , it just gives static sounds and crashes time to time.
    Any hints on what i am doing wrong here ?

    #include
    #include
    #include
    #include


    extern "C" {
    #include "libavutil/mathematics.h"
    #include "libavformat/avformat.h"
    #include "libswscale/swscale.h"
    #include <ao></ao>ao.h>

    }

    void die(const char *msg)
    {
       fprintf(stderr,"%s\n",msg);
       exit(1);
    }

    int main(int argc, char **argv)
    {

       const char* input_filename=argv[1];

       //avcodec_register_all();
       av_register_all();
       //av_ini

       AVFormatContext* container=avformat_alloc_context();
       if(avformat_open_input(&amp;container,input_filename,NULL,NULL)&lt;0){
           die("Could not open file");
       }

       if(av_find_stream_info(container)&lt;0){
           die("Could not find file info");
       }
       av_dump_format(container,0,input_filename,false);

       int stream_id=-1;
       int i;
       for(i=0;inb_streams;i++){
           if(container->streams[i]->codec->codec_type==AVMEDIA_TYPE_AUDIO){
               stream_id=i;
               break;
           }
       }
       if(stream_id==-1){
           die("Could not find Audio Stream");
       }

       AVDictionary *metadata=container->metadata;

       AVCodecContext *ctx=container->streams[stream_id]->codec;
       AVCodec *codec=avcodec_find_decoder(ctx->codec_id);

       if(codec==NULL){
           die("cannot find codec!");
       }

       if(avcodec_open(ctx,codec)&lt;0){
           die("Codec cannot be found");
       }

       //ctx=avcodec_alloc_context3(codec);

       //initialize AO lib
       ao_initialize();

       int driver=ao_default_driver_id();

       ao_sample_format sformat;
       sformat.bits=16;
       sformat.channels=2;
       sformat.rate=44100;
       sformat.byte_format=AO_FMT_NATIVE;
       sformat.matrix=0;

       ao_device *adevice=ao_open_live(driver,&amp;sformat,NULL);
       //end of init AO LIB

       AVPacket packet;
       av_init_packet(&amp;packet);

       AVFrame *frame=avcodec_alloc_frame();

       int buffer_size=AVCODEC_MAX_AUDIO_FRAME_SIZE;
       uint8_t buffer[buffer_size];
       packet.data=buffer;
       packet.size =buffer_size;



       int len;
       int frameFinished=0;
       while(av_read_frame(container,&amp;packet)>=0)
       {

           if(packet.stream_index==stream_id){
               //printf("Audio Frame read  \n");
               int len=avcodec_decode_audio4(ctx,frame,&amp;frameFinished,&amp;packet);
               //frame->
               if(frameFinished){
                   //printf("Finished reading Frame %d %d\n",packet.size,len);
                   ao_play(adevice, (char*)frame->data, len);
               }

           }


       }

       av_close_input_file(container);
       ao_shutdown();
       return 0;
    }
  • Decode audio using libavcodec and play using libAO ?

    26 avril 2018, par Ashika Umanga Umagiliya

    I use following code snippet to decode audio files (tested with MP3,WAV,WMV).

    But when it plays the audio , it just gives static sounds and crashes time to time.
    Any hints on what i am doing wrong here ?

    #include
    #include
    #include
    #include


    extern "C" {
    #include "libavutil/mathematics.h"
    #include "libavformat/avformat.h"
    #include "libswscale/swscale.h"
    #include <ao></ao>ao.h>

    }

    void die(const char *msg)
    {
       fprintf(stderr,"%s\n",msg);
       exit(1);
    }

    int main(int argc, char **argv)
    {

       const char* input_filename=argv[1];

       //avcodec_register_all();
       av_register_all();
       //av_ini

       AVFormatContext* container=avformat_alloc_context();
       if(avformat_open_input(&amp;container,input_filename,NULL,NULL)&lt;0){
           die("Could not open file");
       }

       if(av_find_stream_info(container)&lt;0){
           die("Could not find file info");
       }
       av_dump_format(container,0,input_filename,false);

       int stream_id=-1;
       int i;
       for(i=0;inb_streams;i++){
           if(container->streams[i]->codec->codec_type==AVMEDIA_TYPE_AUDIO){
               stream_id=i;
               break;
           }
       }
       if(stream_id==-1){
           die("Could not find Audio Stream");
       }

       AVDictionary *metadata=container->metadata;

       AVCodecContext *ctx=container->streams[stream_id]->codec;
       AVCodec *codec=avcodec_find_decoder(ctx->codec_id);

       if(codec==NULL){
           die("cannot find codec!");
       }

       if(avcodec_open(ctx,codec)&lt;0){
           die("Codec cannot be found");
       }

       //ctx=avcodec_alloc_context3(codec);

       //initialize AO lib
       ao_initialize();

       int driver=ao_default_driver_id();

       ao_sample_format sformat;
       sformat.bits=16;
       sformat.channels=2;
       sformat.rate=44100;
       sformat.byte_format=AO_FMT_NATIVE;
       sformat.matrix=0;

       ao_device *adevice=ao_open_live(driver,&amp;sformat,NULL);
       //end of init AO LIB

       AVPacket packet;
       av_init_packet(&amp;packet);

       AVFrame *frame=avcodec_alloc_frame();

       int buffer_size=AVCODEC_MAX_AUDIO_FRAME_SIZE;
       uint8_t buffer[buffer_size];
       packet.data=buffer;
       packet.size =buffer_size;



       int len;
       int frameFinished=0;
       while(av_read_frame(container,&amp;packet)>=0)
       {

           if(packet.stream_index==stream_id){
               //printf("Audio Frame read  \n");
               int len=avcodec_decode_audio4(ctx,frame,&amp;frameFinished,&amp;packet);
               //frame->
               if(frameFinished){
                   //printf("Finished reading Frame %d %d\n",packet.size,len);
                   ao_play(adevice, (char*)frame->data, len);
               }

           }


       }

       av_close_input_file(container);
       ao_shutdown();
       return 0;
    }