Recherche avancée

Médias (0)

Mot : - Tags -/logo

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

Autres articles (97)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

  • ANNEXE : Les plugins utilisés spécifiquement pour la ferme

    5 mars 2010, par

    Le site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)

Sur d’autres sites (9546)

  • What is the best gpu in the market for video encoding (H.264 and H.265) [closed]

    12 août 2020, par Hamza Ghizaoui

    So, I m using FFMPEG for video encoding.
I get a stream of BMP images, each with 4000x3000 resoltuion. 20 Image per second (image size circa 35 mbyte).
I must encode that and stream it in real time. a maximum of 100 ms is allowed between ghe moment of receiving the photo and the moment of displaying that on the browser.

    


    I m using FFMPEG with nvidia nvenc hardware accelration .

    


    maximum budget is 2000$ for the GPU.

    


  • avcodec/encode : restructure the core encoding code

    9 juin 2020, par James Almer
    avcodec/encode : restructure the core encoding code
    

    This commit follows the same logic as 061a0c14bb, but for the encode API : The
    new public encoding API will no longer be a wrapper around the old deprecated
    one, and the internal API used by the encoders now consists of a single
    receive_packet() callback that pulls frames as required.

    amf encoders adapted by James Almer
    librav1e encoder adapted by James Almer
    nvidia encoders adapted by James Almer
    MediaFoundation encoders adapted by James Almer
    vaapi encoders adapted by Linjie Fu
    v4l2_m2m encoders adapted by Andriy Gelman

    Signed-off-by : James Almer <jamrial@gmail.com>

    • [DH] libavcodec/amfenc.c
    • [DH] libavcodec/amfenc.h
    • [DH] libavcodec/amfenc_h264.c
    • [DH] libavcodec/amfenc_hevc.c
    • [DH] libavcodec/codec.h
    • [DH] libavcodec/encode.c
    • [DH] libavcodec/encode.h
    • [DH] libavcodec/internal.h
    • [DH] libavcodec/librav1e.c
    • [DH] libavcodec/mfenc.c
    • [DH] libavcodec/nvenc.c
    • [DH] libavcodec/nvenc.h
    • [DH] libavcodec/nvenc_h264.c
    • [DH] libavcodec/nvenc_hevc.c
    • [DH] libavcodec/utils.c
    • [DH] libavcodec/v4l2_m2m.c
    • [DH] libavcodec/v4l2_m2m.h
    • [DH] libavcodec/v4l2_m2m_enc.c
    • [DH] libavcodec/vaapi_encode.c
    • [DH] libavcodec/vaapi_encode.h
    • [DH] libavcodec/vaapi_encode_h264.c
    • [DH] libavcodec/vaapi_encode_h265.c
    • [DH] libavcodec/vaapi_encode_mjpeg.c
    • [DH] libavcodec/vaapi_encode_mpeg2.c
    • [DH] libavcodec/vaapi_encode_vp8.c
    • [DH] libavcodec/vaapi_encode_vp9.c
    • [DH] libavcodec/version.h
  • avcodec_encode_video2 the memory usage is very high

    9 juin 2020, par 陆骁剑

    code :&#xA; ```&#xA; #include "pch.h"&#xA; #include

    &#xA;&#xA;

    extern "C"&#xA;{&#xA;#ifndef __STDC_CONSTANT_MACROS&#xA;#define __STDC_CONSTANT_MACROS&#xA;#endif&#xA;#include <libavcodec></libavcodec>avcodec.h>&#xA;#include "libavformat/avformat.h"&#xA;#include "libswscale/swscale.h"&#xA;#include "libavutil/avutil.h"&#xA;#include "libavutil/imgutils.h"&#xA;#include "libavutil/opt.h"&#xA;#include <libavutil></libavutil>rational.h>&#xA;//#include "libavutil/avassert.h"&#xA;&#xA;&#xA;//#include "libavutil/attributes.h"&#xA;//#include "libavutil/avassert.h"&#xA;//#include "libavutil/frame.h"&#xA;//#include "libavutil/imgutils.h"&#xA;//#include "internal1.h"&#xA;//#include "libavutil/samplefmt.h"&#xA;}&#xA;#include &#xA;//#include "avcodec.h"&#xA;//#include "frame_thread_encoder.h"&#xA;//#include "internal.h"&#xA;&#xA;// Globals&#xA;AVCodec* m_pCodec = NULL;&#xA;AVStream *m_pStream = NULL;&#xA;AVOutputFormat* m_pFormat = NULL;&#xA;AVFormatContext* m_pFormatContext = NULL;&#xA;AVCodecContext* m_pCodecContext = NULL;&#xA;AVFrame* m_pFrame = NULL;&#xA;int m_frameIndex;&#xA;&#xA;// Output format&#xA;AVPixelFormat m_pixType = AV_PIX_FMT_NV12;&#xA;// Use for mpeg4&#xA;//AVPixelFormat m_pixType = AV_PIX_FMT_YUV420P;&#xA;&#xA;// Output frame rate&#xA;int m_frameRate = 30;&#xA;// Output image dimensions&#xA;int m_imageWidth = 256;&#xA;int m_imageHeight = 1537;&#xA;// Number of frames to export&#xA;int m_frameCount = 20000;&#xA;// Output file name&#xA;const char* m_fileName = "test.h264";&#xA;// Output file type&#xA;const char* m_fileType = "H264";&#xA;// Codec name used to encode&#xA;const char* m_encoderName = "h264_qsv";&#xA;// use for mpeg4&#xA;//const char* m_encoderName = "mpeg4";&#xA;// Target bit rate&#xA;int m_targetBitRate = 400000;&#xA;&#xA;void addVideoStream()&#xA;{&#xA;    m_pStream = avformat_new_stream(m_pFormatContext, m_pCodec);&#xA;    m_pStream->id = m_pFormatContext->nb_streams - 1;&#xA;    m_pStream->time_base = m_pCodecContext->time_base;&#xA;    m_pStream->codec->pix_fmt = m_pixType;&#xA;    m_pStream->codec->flags = m_pCodecContext->flags;&#xA;    m_pStream->codec->width = m_pCodecContext->width;&#xA;    m_pStream->codec->height = m_pCodecContext->height;&#xA;    m_pStream->codec->time_base = m_pCodecContext->time_base;&#xA;    m_pStream->codec->bit_rate = m_pCodecContext->bit_rate;&#xA;}&#xA;&#xA;AVFrame* allocatePicture(enum AVPixelFormat pix_fmt, int width, int height)&#xA;{&#xA;    AVFrame *frame;&#xA;&#xA;    frame = av_frame_alloc();&#xA;&#xA;    if (!frame)&#xA;    {&#xA;        return NULL;&#xA;    }&#xA;&#xA;    frame->format = pix_fmt;&#xA;    frame->width = width;&#xA;    frame->height = height;&#xA;&#xA;    int checkImage = av_image_alloc(frame->data, frame->linesize, width, height, pix_fmt, 32);&#xA;&#xA;    if (checkImage &lt; 0)&#xA;    {&#xA;        return NULL;&#xA;    }&#xA;&#xA;    return frame;&#xA;}&#xA;&#xA;bool initialize()&#xA;{&#xA;    AVRational frameRate;&#xA;    frameRate.den = m_frameRate;&#xA;    frameRate.num = 1;&#xA;&#xA;    av_register_all();&#xA;&#xA;    m_pCodec = avcodec_find_encoder_by_name(m_encoderName);&#xA;&#xA;    if (!m_pCodec)&#xA;    {&#xA;        return false;&#xA;    }&#xA;&#xA;    m_pCodecContext = avcodec_alloc_context3(m_pCodec);&#xA;    m_pCodecContext->width = m_imageWidth;&#xA;    m_pCodecContext->height = m_imageHeight;&#xA;    m_pCodecContext->time_base = frameRate;&#xA;    m_pCodecContext->gop_size = 0;&#xA;    m_pCodecContext->pix_fmt = m_pixType;&#xA;    m_pCodecContext->codec_id = m_pCodec->id;&#xA;    m_pCodecContext->bit_rate = m_targetBitRate;&#xA;&#xA;    av_opt_set(m_pCodecContext->priv_data, "&#x2B;CBR", "", 0);&#xA;&#xA;    return true;&#xA;}&#xA;&#xA;bool startExport()&#xA;{&#xA;    m_frameIndex = 0;&#xA;    char fakeFileName[512];&#xA;    int checkAllocContext = avformat_alloc_output_context2(&amp;m_pFormatContext, NULL, m_fileType, fakeFileName);&#xA;&#xA;    if (checkAllocContext &lt; 0)&#xA;    {&#xA;        return false;&#xA;    }&#xA;&#xA;    if (!m_pFormatContext)&#xA;    {&#xA;        return false;&#xA;    }&#xA;&#xA;    m_pFormat = m_pFormatContext->oformat;&#xA;&#xA;    if (m_pFormat->video_codec != AV_CODEC_ID_NONE)&#xA;    {&#xA;        addVideoStream();&#xA;&#xA;        int checkOpen = avcodec_open2(m_pCodecContext, m_pCodec, NULL);&#xA;&#xA;        if (checkOpen &lt; 0)&#xA;        {&#xA;            return false;&#xA;        }&#xA;&#xA;        m_pFrame = allocatePicture(m_pCodecContext->pix_fmt, m_pCodecContext->width, m_pCodecContext->height);&#xA;        if (!m_pFrame)&#xA;        {&#xA;            return false;&#xA;        }&#xA;        m_pFrame->pts = 0;&#xA;    }&#xA;&#xA;    int checkOpen = avio_open(&amp;m_pFormatContext->pb, m_fileName, AVIO_FLAG_WRITE);&#xA;    if (checkOpen &lt; 0)&#xA;    {&#xA;        return false;&#xA;    }&#xA;&#xA;    av_dict_set(&amp;(m_pFormatContext->metadata), "title", "QS Test", 0);&#xA;&#xA;    int checkHeader = avformat_write_header(m_pFormatContext, NULL);&#xA;    if (checkHeader &lt; 0)&#xA;    {&#xA;        return false;&#xA;    }&#xA;&#xA;    return true;&#xA;}&#xA;&#xA;int processFrame(AVPacket&amp; avPacket)&#xA;{&#xA;    avPacket.stream_index = 0;&#xA;    avPacket.pts = av_rescale_q(m_pFrame->pts, m_pStream->codec->time_base, m_pStream->time_base);&#xA;    avPacket.dts = av_rescale_q(m_pFrame->pts, m_pStream->codec->time_base, m_pStream->time_base);&#xA;    m_pFrame->pts&#x2B;&#x2B;;&#xA;&#xA;    int retVal = av_interleaved_write_frame(m_pFormatContext, &amp;avPacket);&#xA;    return retVal;&#xA;}&#xA;&#xA;bool exportFrame()&#xA;{&#xA;    int success = 1;&#xA;    int result = 0;&#xA;&#xA;    AVPacket avPacket;&#xA;&#xA;    av_init_packet(&amp;avPacket);&#xA;    avPacket.data = NULL;&#xA;    avPacket.size = 0;&#xA;&#xA;    AVPacket* avPacket1 = new AVPacket();&#xA;&#xA;    av_init_packet(avPacket1);&#xA;    avPacket1->data = NULL;&#xA;    avPacket1->size = 0;&#xA;&#xA;    fflush(stdout);&#xA;&#xA;    std::cout &lt;&lt; "Before avcodec_encode_video2 for frame: " &lt;&lt; m_frameIndex &lt;&lt; std::endl;&#xA;    success = avcodec_encode_video2(m_pCodecContext, &amp;avPacket, m_pFrame, &amp;result);&#xA;    std::cout &lt;&lt; "After avcodec_encode_video2 for frame: " &lt;&lt; m_frameIndex &lt;&lt; std::endl;&#xA;&#xA;    if (result)&#xA;    {&#xA;        success = processFrame(avPacket);&#xA;    }&#xA;&#xA;    av_packet_unref(&amp;avPacket);&#xA;&#xA;    av_free_packet(&amp;avPacket);&#xA;    //av_frame_free(&amp;m_pFrame);&#xA;&#xA;    m_frameIndex&#x2B;&#x2B;;&#xA;    return (success == 0);&#xA;}&#xA;&#xA;void endExport()&#xA;{&#xA;    int result = 0;&#xA;    int success = 0;&#xA;&#xA;    if (m_pFrame)&#xA;    {&#xA;        while (success == 0)&#xA;        {&#xA;            AVPacket avPacket;&#xA;            av_init_packet(&amp;avPacket);&#xA;            avPacket.data = NULL;&#xA;            avPacket.size = 0;&#xA;&#xA;            fflush(stdout);&#xA;            success = avcodec_encode_video2(m_pCodecContext, &amp;avPacket, NULL, &amp;result);&#xA;&#xA;            if (result)&#xA;            {&#xA;                success = processFrame(avPacket);&#xA;            }&#xA;            av_packet_unref(&amp;avPacket);&#xA;&#xA;            if (!result)&#xA;            {&#xA;                break;&#xA;            }&#xA;        }&#xA;    }&#xA;&#xA;    if (m_pFormatContext)&#xA;    {&#xA;        av_write_trailer(m_pFormatContext);&#xA;&#xA;        if (m_pFrame)&#xA;        {&#xA;            av_frame_free(&amp;m_pFrame);&#xA;        }&#xA;&#xA;        avio_closep(&amp;m_pFormatContext->pb);&#xA;        avformat_free_context(m_pFormatContext);&#xA;        m_pFormatContext = NULL;&#xA;    }&#xA;}&#xA;&#xA;void cleanup()&#xA;{&#xA;    if (m_pFrame || m_pCodecContext)&#xA;    {&#xA;        if (m_pFrame)&#xA;        {&#xA;            av_frame_free(&amp;m_pFrame);&#xA;        }&#xA;&#xA;        if (m_pCodecContext)&#xA;        {&#xA;            avcodec_close(m_pCodecContext);&#xA;            av_free(m_pCodecContext);&#xA;        }&#xA;    }&#xA;}&#xA;&#xA;int main()&#xA;{&#xA;    bool success = true;&#xA;    if (initialize())&#xA;    {&#xA;        if (startExport())&#xA;        {&#xA;            for (int loop = 0; loop &lt; m_frameCount; loop&#x2B;&#x2B;)&#xA;            {&#xA;                if (!exportFrame())&#xA;                {&#xA;                    std::cout &lt;&lt; "Failed to export frame\n";&#xA;                    success = false;&#xA;                    break;&#xA;                }&#xA;            }&#xA;            endExport();&#xA;        }&#xA;        else&#xA;        {&#xA;            std::cout &lt;&lt; "Failed to start export\n";&#xA;            success = false;&#xA;        }&#xA;&#xA;        cleanup();&#xA;    }&#xA;    else&#xA;    {&#xA;        std::cout &lt;&lt; "Failed to initialize export\n";&#xA;        success = false;&#xA;    }&#xA;&#xA;    if (success)&#xA;    {&#xA;        std::cout &lt;&lt; "Successfully exported file\n";&#xA;    }&#xA;    return 1;&#xA;}&#xA;&#xA;&#xA;    ```&#xA;

    &#xA;&#xA;

    When I set the m_imageHeight to 1536, the memory usage is very high. But when set to 1535 or 1537 or other values, the memory usage is normal, can you tell me why ?&#xA;I have navigated to avcodec_encode_video2&#xA;enter link description here&#xA;I am using the code from the link&#xA;I have updated to the latest Intel® Graphics Driver

    &#xA;