Recherche avancée

Médias (1)

Mot : - Tags -/biographie

Autres articles (64)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
    This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)

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

  • avcodec_encode_video memory leaks

    13 juillet 2012, par user1522503

    I got some ffmpeg memory problems.
    I think they happen to avcodec_encode_video() ;

    When I used it to encode less than 6 YUV420 files(the size is different, 704x576 1600x1200 540x480),the memory was normal, but if more than 6, the system memories increased 100M/S, the program will crash soon.

    please advice, thanks.

    iOutSie = 0;
       ptPicture = (AVFrame *)malloc(sizeof(AVFrame));

       if (!ptPicture)
       {
           gbiLastErrorNumber = NPC_D_SMP_CODEC_ERROR_MALLOC_ERR;
           goto _NPC_CLEAR;
       }

       pYuvBuff = (NPC_BYTE *)malloc(1024*1024*8);

    if (!pYuvBuff)
     {

           goto _NPC_CLEAR;

       }

       avpicture_fill((AVPicture*)ptPicture, pYuvBuff, PIX_FMT_YUV420P, hEncode->tEncodeVideoParam.iWidth,
           hEncode->tEncodeVideoParam.iHeight);    


           scxt = sws_getContext(
               in_pOriBPS->iWith, //source width
               in_pOriBPS->iHeight, //source height
               PIX_FMT_YUV420P,    //source pix format
               hEncode->tEncodeVideoParam.iWidth, //destination width, height, and pix format
               hEncode->tEncodeVideoParam.iHeight,
               PIX_FMT_YUV420P,
               SWS_SINC,
               NULL,NULL,NULL
           );



       if(!scxt)
       {
           gbiLastErrorNumber = NPC_D_SMP_CODEC_ERROR_sws_getContext_ERR;
           goto _NPC_CLEAR;
       }

       sws_scale(
           scxt,
           hEncode->picture->data, hEncode->picture->linesize,
           0, in_pOriBPS->iHeight,
           ptPicture->data, ptPicture->linesize);

       if (in_pDestDataBufSize < (hEncode->tEncodeVideoParam.iWidth * hEncode->tEncodeVideoParam.iHeight * 3 / 2) )
       {
           gbiLastErrorNumber = NPC_D_SMP_CODEC_ERROR_PARAM_ERR;
           goto _NPC_CLEAR;
       }

       iOutSize = avcodec_encode_video(hEncode->c, out_pDestDataBuf, in_pDestDataBufSize, ptPicture);  

    _NPC_CLEAR:
    if(pYuvBuff) free(pYuvBuff);
    return iOutSize;
  • ffmpeg memory usage, or memory leaks

    26 janvier, par happycoding-boy

    I'v write a simple program to get audio waveform data, which using ffmpeg version 6.1. And program works fine. But I get a problem : when program running at begin, system report using about 6MB memory, but when I call the function and cleanup the resouce alloced, system report about 9MB memory used. In my theory, after cleanup, it should be 6MB again. [I'm sure, I freed the AVPacket when read stream, and AVFrame for decoding.] My question is : Is this normal or not ?

    


    int main(int argc, char *argv[])
{
    // breakpoint here: ~= 6MB
    get_audio_waveform();
    // breakpoint here: ~= 9MB
}


    


    The ffmpeg struct I used :

    


    AVFormatContext*    p_input_fmt_ctx = nullptr;
AVCodecContext*     p_input_cdc_ctx = nullptr;
SwrContext*         p_resampler_ctx = nullptr;
AVAudioFifo*        p_audio_fifo    = nullptr;
uint8_t**           p_converted_input = nullptr;
uint8_t**           p_converted_output = nullptr;


    


    The cleanup func :

    


    void _cleanup()
{
    avformat_close_input(&p_input_fmt_ctx);
    avcodec_free_context(&p_input_cdc_ctx);
    swr_free(&p_resampler_ctx);
    
    if (p_audio_fifo)
    {
        av_audio_fifo_reset(p_audio_fifo);
        av_audio_fifo_free(p_audio_fifo);
        p_audio_fifo = nullptr;
    }
    
    if (p_converted_input)
    {
        av_freep(&p_converted_input[0]);
        free(p_converted_input);
        p_converted_input = nullptr;
    }
    
    if (p_converted_output)
    {
        av_freep(&p_converted_output[0]);
        free(p_converted_output);
        p_converted_output = nullptr;
    }
}


    


    In my opinion,If this function have about 3MB memory leaks6MB. when I run this function 5-times, it should be about 15MB memory leaks.6MB. But when I run this function 5-times. After that, system just reports about 10-11 memory used. I doubt wheather program uses runtime library (i.e. libc or equivalent) and the library allocates some memory for own needs? I do not known which step is wrong! :(

    


  • Combining Audio and Video file in python [duplicate]

    8 juin 2020, par yso

    I'm trying to understand how to us ffmpeg to combine video and audio files in python. I want to combine a .avi file and a .wav file to create a final .avi file. Is this the right approach ? I'm confused by the ffmpeg syntax.
Any help would be great.

    



    I was looking through this for help :
https://wiki.libav.org/Snippets/avconv#Combine_audio_and_video_file

    



    import ffmpeg
import subprocess

cmd = 'ffmpeg -i inputvideo.avi -i inputaudio.wav -c:v copy -c:a aac output_video_and audio.avi'
subprocess.call(cmd, shell=True)                                     # "Muxing Done
print('Muxing Done')