Recherche avancée

Médias (91)

Autres articles (62)

  • La file d’attente de SPIPmotion

    28 novembre 2010, par

    Une file d’attente stockée dans la base de donnée
    Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
    Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...)

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

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

  • Revision 96418 : Le plug est pour spip 3.0.1 mini, donc j’ajoute la borne mini à médias ...

    3 avril 2016, par spip.franck@… — Log

    Le plug est pour spip 3.0.1 mini, donc j’ajoute la borne mini à médias en mettant 2.7.27 (version native à spip 3.0.1) http://zone.spip.org/trac/spip-zone/browser/_core_/tags/spip-3.0.1/plugins/medias/paquet.xml
    L’unique intérêt de ce commit est de faire en sorte que les gens qui consultent le xml sur plugin.spip est une info fiable

  • Qt WinRT App cannot access file permission denied

    23 février 2016, par Haris

    I need to develop WinRT App using Qt and FFMPEG, I build the ffmpeg for WinRT based on the instruction here and I am able to link the library with my project. Now I need to open a video file using avformat_open_input but it always giving me the output

    video decode error "Permission denied"

    Below is the relevant part of the code,

    int ret = avformat_open_input(&pFormatCtx, hls, NULL, NULL);
       if(ret != 0)
       {
           char errbuf[128];
           av_strerror(ret, errbuf, 128);
           qDebug()<<"video decode error"<code>

    From the above error it seems some permission issue, do I need to add any additional permission on AppxManifest.xml currently I am using default manifest which is created by Qt creator.

  • libavcodec/ffmpeg reports two channels when decoding, but segfaults when trying to access the second

    1er décembre 2017, par Astrognome

    I am attempting to decode an audio file into raw pcm data using FFMpeg’s libavcodec. I have the following code so far, but it segfaults when trying to access the second audio channel for some reason.

    #include
    #include
    #include <ao></ao>ao.h>
    #include

    #include <libavutil></libavutil>opt.h>
    #include <libavcodec></libavcodec>avcodec.h>
    #include <libavformat></libavformat>avformat.h>
    #include <libswresample></libswresample>swresample.h>

    #define BUF_SIZE 4096


    #define AUDIO_INBUF_SIZE 20480
    #define AUDIO_REFILL_THRESH 4096

    int decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, uint8_t* out_data, int* index) {

       int i, ch;
       int ret, data_size;

       ret = avcodec_send_packet(dec_ctx, pkt);
       if (ret &lt; 0) {
           fprintf(stderr, "Error submitting packet to decoder\n");
           exit(1);
       }

       while (ret >= 0) {
           ret = avcodec_receive_frame(dec_ctx, frame);
           if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF) {
               return 0;
           }
           else if (ret &lt; 0) {
               fprintf(stderr, "Error during decoding\n");
               exit(1);
           }

           data_size = av_get_bytes_per_sample(dec_ctx->sample_fmt);
           if (data_size &lt; 0) {
               fprintf(stderr, "Failed to calculate data size\n");
               exit(1);
           }
           for (i = 0; i &lt; frame->nb_samples; ++i)
               for (ch = 0; ch &lt; dec_ctx->channels; ++ch) {

                   //Things go wrong here...
                   memcpy(out_data + *index, frame->data[ch] + (data_size*i), data_size);
                   *index += data_size;
               }
       }

       return 0;
    }

    int decode_audio_file(const char* path, uint8_t* out_data, int size) {
       const AVCodec *codec;
       AVCodecContext *c = NULL;
       AVCodecParserContext *parser = NULL;
       int len, ret;
       FILE *f;
       uint8_t inbuf[AUDIO_INBUF_SIZE + AV_INPUT_BUFFER_PADDING_SIZE];
       uint8_t *data;
       size_t data_size;
       AVPacket *pkt;
       AVFrame *decoded_frame = NULL;


       avcodec_register_all();
       pkt = av_packet_alloc();
       codec = avcodec_find_decoder(AV_CODEC_ID_FLAC);
       if (!codec) {
           fprintf(stderr, "Codec not found!\n");
           return -1;
       }

       parser = av_parser_init(codec->id);
       if (!parser) {
           fprintf(stderr, "Parser not found!\n");
           return -1;
       }

       c = avcodec_alloc_context3(codec);
       if (!c) {
           fprintf(stderr, "Could not allocate audio context!\n");
           return -1;
       }

       if(avcodec_open2(c, codec, NULL) &lt; 0) {
           fprintf(stderr, "Could not open codec\n");
           exit(1);
       }

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

       data = inbuf;
       data_size = fread(inbuf, 1, AUDIO_INBUF_SIZE, f);

       int index = 0;  
       while (data_size > 0) {
           if (!decoded_frame) {
               if (!(decoded_frame = av_frame_alloc())) {
                   fprintf(stderr, "Could not allocate audio frame\n");
                   exit(1);
               }
           }

           ret = av_parser_parse2(parser, c, &amp;pkt->data, &amp;pkt->size, data, data_size, AV_NOPTS_VALUE, AV_NOPTS_VALUE, 0);
           if (ret &lt; 0) {
               fprintf(stderr, "Error while parsing\n");
               exit(1);
           }
           data += ret;
           data_size -= ret;

           if (pkt->size)
               decode(c, pkt, decoded_frame, out_data, &amp;index);
           if (data_size &lt; AUDIO_REFILL_THRESH) {
               memmove(inbuf, data, data_size);
               data = inbuf;
               len = fread(data + data_size, 1, AUDIO_INBUF_SIZE - data_size, f);
               if (len > 0)
                   data_size += len;
           }
       }
       avcodec_free_context(&amp;c);
       av_parser_close(parser);
       av_frame_free(&amp;decoded_frame);
       av_packet_free(&amp;pkt);

       return 0;
    }


    int main(int argc, char **argv)
    {
       int bsize = 1024*1024*60;
       uint8_t* audio_buffer = calloc(bsize, sizeof(uint8_t));
       decode_audio_file("testsong.flac", audio_buffer, bsize);
    }

    Here is the offending line :

    memcpy(out_data + *index, frame->data[ch] + (data_size*i), data_size);

    If you access frame->data[0] it’s fine, but if you attempt to access frame->data[1] it segfaults. The context reports two channels and the file contains two channels (tried with several different tracks).
    But it gets even weirder. If I switch the offending line to

    memcpy(out_data + *index, frame->data[0] + (data_size*i*2 + ch), data_size);

    it will have the left channel with correct data and the right channel is white noise. This tells me (and I could be wrong) that the first channel actually contains 2 channels of audio interleaved, the actual left channel, plus a junk channel of white noise.
    I was wrong, I forgot to multiple ch by data_size. If the line is memcpy(out_data + *index, frame->data[0] + (data_size*i*2 + ch*data_size), data_size); things seem to work as expected. This all still seems very sketchy though so if anyone can thoroughly explain what’s happening here, that would be nice.

    I have been working off the decode_audio example available in the ffmpeg documentation here although modified slightly.

    This ALSO happens if I use the vanilla example with the only change being setting the codec to FLAC, so I assume it’s a bug in the library. In that case, how can I work around it.