Recherche avancée

Médias (5)

Mot : - Tags -/open film making

Autres articles (59)

  • Submit bugs and patches

    13 avril 2011

    Unfortunately a software is never perfect.
    If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
    If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
    You may also (...)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

  • Personnaliser les catégories

    21 juin 2013, par

    Formulaire de création d’une catégorie
    Pour ceux qui connaissent bien SPIP, une catégorie peut être assimilée à une rubrique.
    Dans le cas d’un document de type catégorie, les champs proposés par défaut sont : Texte
    On peut modifier ce formulaire dans la partie :
    Administration > Configuration des masques de formulaire.
    Dans le cas d’un document de type média, les champs non affichés par défaut sont : Descriptif rapide
    Par ailleurs, c’est dans cette partie configuration qu’on peut indiquer le (...)

Sur d’autres sites (11394)

  • Memory leak when using av_frame_get_buffer()

    19 juillet 2018, par Alec Matthews

    I am making a simple video player with ffmpeg. I have noticed that there is a memory leak originating in libavutil. Because ffmpeg is a mature library I assume that I am allocating a new frame incorrectly. The documentation is also vague about freeing the buffer that is created when you call av_frame_get_buffer(). Below is the code I am using to decode the video and queue it up for display on the UI thread.

    DWORD WINAPI DecoderThread(LPVOID lpParam)
    {
       AVFrame *frame = NULL;
       AVPacket pkt;

       SwsContext *swsCtx = NULL;
       UINT8 *buffer = NULL;
       INT iNumBytes = 0;

       INT result = 0;

       frame = av_frame_alloc();

       av_init_packet(&pkt);
       pkt.data = NULL;
       pkt.size = 0;

       // Create scaling context
       swsCtx = sws_getContext(codecCtx->width, codecCtx->height, codecCtx->pix_fmt, codecCtx->width, codecCtx->height, AV_PIX_FMT_BGR24, SWS_BICUBIC, NULL, NULL, NULL);

      while (av_read_frame(fmtCtx, &pkt) >= 0) {
           if (pkt.stream_index == videoStream) {
               result = avcodec_send_packet(codecCtx, &pkt);

               while (result >= 0) {
                   result = avcodec_receive_frame(codecCtx, frame);
                   if (result == AVERROR(EAGAIN) || result == AVERROR_EOF) {
                       break;
                   } else if (result < 0) {
                       // another error.
                   }
                   // Create a new frame to store the RGB24 data.
                   AVFrame *pFrameRGB = av_frame_alloc();
                   // Allocate space for the new RGB image.
                   //av_image_alloc(pFrameRGB->data, pFrameRGB->linesize, codecCtx->width, codecCtx->height, AV_PIX_FMT_BGR24, 1);
                   // Copy all of the properties from the YUV420P frame.
                   av_frame_copy_props(pFrameRGB, frame);
                   pFrameRGB->width = frame->width;
                   pFrameRGB->height = frame->height;
                   pFrameRGB->format = AV_PIX_FMT_BGR24;
                   av_frame_get_buffer(pFrameRGB, 0);

                   // Convert fram from YUV420P to BGR24 for display.
                   sws_scale(swsCtx, (const UINT8* const *) frame->data, frame->linesize, 0, codecCtx->height, pFrameRGB->data, pFrameRGB->linesize);

                   // Queue thr BGR frame for drawing by the main thread.
                   AddItemToFrameQueue(pFrameRGB);

                   av_frame_unref(frame);
               }
           }
          while (GetQueueSize() > 100) {
               Sleep(10);
          }
      }

       CloseFrameQueue();

       av_frame_free(&frame);
      avcodec_close(codecCtx);
      avformat_close_input(&fmtCtx);

       return 0;
    }

    Is there a better way to allocate a new frame for holding the post sws_scale() transformation ?

    There is a similar stackoverflow question that uses mostly depreciated function calls. I can’t seem to find any answers that conform to the new version of ffmpeg in the documentation. Any help would be appreciated.

  • Compress video like whatsapp

    12 février 2016, par Copernic

    I’m not an expert in Video Editing but what I want to understand the logic of Whatsapp video processing.

    First of all I have noticed that whatever the file is, Whatsapp sets the limit of Uploaded videos to 16MO, after which whatsapp crops the video to not exceed the limit. is this a convention or it’s a personal choice ?

    Secondly, When a video is recorded using the Camera it’s not compressed by default, so whatsapp compresses it using FFMPEG I guess, and it takes no time. (tried for a video of 1min 1920x1080 with 125MO of size, becomes 640x360 with 5MO of size in no time, and the upload starts automatically).. how may they do this ? and why the choice of 640x360, It seems to me very fast for 2 asynchronous tasks : Compression + Upload.

    When I run the compression command ffmpeg -y -i in.mp4 -codec:v libx264 -crf 23 -preset medium -codec:a libfdk_aac -vbr 4 -vf scale=-1:640,format=yuv420p out.mp4 it takes approximatively 1 min and the video is being rotated !! :D

    Finally, when we download a video from Youtube it’s already compressed (I guess) and whatsapp doesn’t even try to compress it. So I think that it automatically detects thats the video is compressed. How can we detect this ?

    Thank you.

  • Compress video like whatsapp

    10 juillet 2021, par user1079425

    I'm not an expert in Video Editing but what I want to understand the logic of Whatsapp video processing.

    



    First of all I have noticed that whatever the file is, Whatsapp sets the limit of Uploaded videos to 16MB, after which whatsapp crops the video to not exceed the limit. is this a convention or it's a personal choice ?

    



    Secondly, When a video is recorded using the Camera it's not compressed by default, so whatsapp compresses it using FFMPEG I guess, and it takes no time. (tried for a video of 1min 1920x1080 with 125MB of size, becomes 640x360 with 5MB of size in no time, and the upload starts automatically).. how may they do this ? and why the choice of 640x360, It seems to me very fast for 2 asynchronous tasks : Compression + Upload.

    



    When I run the compression command ffmpeg -y -i in.mp4 -codec:v libx264 -crf 23 -preset medium -codec:a libfdk_aac -vbr 4 -vf scale=-1:640,format=yuv420p out.mp4 it takes approximatively 1 min and the video is being rotated !! :D

    



    Finally, when we download a video from Youtube it's already compressed (I guess) and whatsapp doesn't even try to compress it. So I think that it automatically detects thats the video is compressed. How can we detect this ?

    



    Thank you.