Recherche avancée

Médias (0)

Mot : - Tags -/optimisation

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

Autres articles (76)

  • Ajouter notes et légendes aux images

    7 février 2011, par

    Pour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
    Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
    Modification lors de l’ajout d’un média
    Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)

  • Support de tous types de médias

    10 avril 2011

    Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)

  • Participer à sa documentation

    10 avril 2011

    La documentation est un des travaux les plus importants et les plus contraignants lors de la réalisation d’un outil technique.
    Tout apport extérieur à ce sujet est primordial : la critique de l’existant ; la participation à la rédaction d’articles orientés : utilisateur (administrateur de MediaSPIP ou simplement producteur de contenu) ; développeur ; la création de screencasts d’explication ; la traduction de la documentation dans une nouvelle langue ;
    Pour ce faire, vous pouvez vous inscrire sur (...)

Sur d’autres sites (6288)

  • Revision 2f6fce3e5a : Write only visible area (for better comparison with rec.yuv). Change-Id : I32bf4

    30 janvier 2013, par Ronald S. Bultje

    Changed Paths : Modify /vp9/decoder/vp9_onyxd_if.c Write only visible area (for better comparison with rec.yuv). Change-Id : I32bf4ee532a15af78619cbcd8a193224029fab50

  • Revision 51bae955e6 : experiment a wider loop filter for MB border when larger transforms are used C

    20 décembre 2012, par Yaowu Xu

    Changed Paths : Modify /configure Modify /vp9/common/vp9_loopfilter.c Modify /vp9/common/vp9_loopfilter.h Modify /vp9/common/vp9_loopfilter_filters.c experiment a wider loop filter for MB border when larger transforms are used Change-Id : (...)

  • av_write_frame fails when encoding a larger audio file to .mpg

    27 novembre 2012, par TheSHEEEP

    I am encoding live rendered video data and an existing .wav file into an mpg-file.

    To do that I first write all audio frames, and then the video frames as they come in from the render engine. For smaller .wav files (< 25 seconds), everything works perfectly fine. But as soon as I use a longer .wav file, av_write_frame (when writing the audio frame) just returns -1 after having written some 100 frames. It is never the same frame at which it fails, also it is never the last frame.
    All test files can be played perfectly with any player I tested.

    I am following the muxing example (more or less).

    Here is my function that writes an audio frame :

    void write_audio_frame( Cffmpeg_dll * ptr, AVFormatContext *oc, AVStream *st, int16_t sample_val )
    {
    AVCodecContext *c;
    AVPacket pkt = { 0 }; // data and size must be 0;
    AVFrame *frame = avcodec_alloc_frame();
    int got_packet;

    av_init_packet(&amp;pkt);
    c = st->codec;

    get_audio_frame(ptr, ptr->samples, ptr->audio_input_frame_size, c->channels);
    frame->nb_samples =  ptr->audio_input_frame_size;
    int result = avcodec_fill_audio_frame(frame, c->channels, c->sample_fmt,
                           (uint8_t *) ptr->samples,
                            ptr->audio_input_frame_size *
                           av_get_bytes_per_sample(c->sample_fmt) *
                           c->channels, 0);
    if (result != 0)
    {
       av_log(c, AV_LOG_ERROR, "Error filling audio frame. Code: %i\n", result);
       exit(1);
    }

    result = avcodec_encode_audio2(c, &amp;pkt, frame, &amp;got_packet);
    if (result != 0)
    {
       av_log(c, AV_LOG_ERROR, "Error encoding audio. Code: %i\n", result);
       exit(1);
    }


    if (c->coded_frame &amp;&amp; c->coded_frame->pts != AV_NOPTS_VALUE)
       pkt.pts= av_rescale_q(c->coded_frame->pts, c->time_base, st->time_base);
    pkt.flags |= AV_PKT_FLAG_KEY;

    pkt.stream_index= st->index;
    av_log(c, AV_LOG_ERROR, "Got? %i Pts: %i Dts: %i Flags: %i Side Elems: %i Size: %i\n",
           got_packet, pkt.pts, pkt.dts, pkt.flags, pkt.side_data_elems, pkt.size);

    /* write the compressed frame in the media file */
    result = av_write_frame(oc, &amp;pkt);
    if (result != 0)
    {
       av_log(c, AV_LOG_ERROR, "Error while writing audio frame. Result: %i\n", result);
       exit(1);
    }
    }

    So "Error while writing audio frame. Result : -1" is what I always get after some frames.

    And here is my get_audio_frame function :

    void get_audio_frame( Cffmpeg_dll* ptr, int16_t* samples, int frame_size, int nb_channels, int16_t sample_val )
    {
       fread( samples, sizeof( int16_t ), frame_size * nb_channels, ptr->fp_sound_input );
    };

    And finally, this is the loop in which I write all audio frames (don't worry about the .wav header, I skipped it before that loop) :

    while (!feof(ptr->fp_sound_input))
       {
           write_audio_frame( ptr, ptr->oc, ptr->audio_st, -1 );
       }

    As you can see, I'm outputting almost everything in the packet and check for any possible error. Other than av_write_frame failing after some time when I am encoding a longer audio file, everything seems perfectly fine. All the packet values I am tracking are 100% the same for all frames (except the data pointer, obviously). Also, as stated, the same procedure works flawlessly for shorter fp_sound_input files. avcodec_encode_audio2() and avcodec_fill_audio_frame() also never fail.

    The codecs I use for encoding are CODEC_ID_MPEG2VIDEO (video) and CODEC_ID_MP2 (audio). The .wav files are saved in PCM 16 LE (all use the exact same encoding).

    What could be wrong here ?