Recherche avancée

Médias (91)

Autres articles (75)

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

  • Emballe médias : à quoi cela sert ?

    4 février 2011, par

    Ce plugin vise à gérer des sites de mise en ligne de documents de tous types.
    Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ;

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 est la première version de MediaSPIP stable.
    Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

Sur d’autres sites (7683)

  • lavc/vaapi_encode : Query surface alignment

    22 octobre 2024, par David Rosca
    lavc/vaapi_encode : Query surface alignment
    

    It needs to create temporary config to query surface attribute.

    Signed-off-by : Timo Rothenpieler <timo@rothenpieler.org>

    • [DH] libavcodec/vaapi_encode.c
    • [DH] libavcodec/vaapi_encode.h
  • lavu/hwcontext_qsv : Derive bind flag from frame type if no valid surface

    23 juillet 2024, par Fei Wang
    lavu/hwcontext_qsv : Derive bind flag from frame type if no valid surface
    

    Fix cmd :
    ffmpeg.exe -init_hw_device d3d11va=d3d -init_hw_device qsv=qsv@d3d \
    - filter_hw_device d3d -hwaccel qsv -hwaccel_output_format qsv \
    - i in.h264 -vf "hwmap,format=d3d11,hwdownload,format=nv12" -y out.yuv

    Signed-off-by : Fei Wang <fei.w.wang@intel.com>
    Tested-by : Tong Wu <wutong1208@outlook.com>

    • [DH] libavutil/hwcontext_qsv.c
  • FFMpeg (libav) hls demux with mediacodec surface rendering is playing too fast

    17 octobre 2023, par forlayo

    I am demuxing a m3u8 with libav and getting packets to decode them + play, the decoder is mediacodec with a surface set for direct rendering. This works so far but the video plays too fast, extremely fast ; tried to play with pts/dts I sent to decoder without succes at the minute.

    &#xA;

    I saw other implementations that are doing this but they aren't using direct rendering with mediacodec then they're maintaing like a queue of already decoded images to paint. As my implementation is intended to run on a android without too much resources I would need to save as much processing as I can then direct rendering is a must.

    &#xA;

    Here I put a sample code of what I did :

    &#xA;

    int MediaParserFFmpeg::init(const std::string &amp;filePath)&#xA;{&#xA;    m_formatCtx = avformat_alloc_context();&#xA;    int ret = 0;&#xA;    &#xA;    ret = avformat_open_input(&amp;m_formatCtx, m_mediaPath.c_str(), iFormat, nullptr);&#xA;    if (ret &lt; 0)&#xA;    {&#xA;        return MEDIA_ERROR_INIT_FAILED;&#xA;    }&#xA;&#xA;    ret = avformat_find_stream_info(m_formatCtx, nullptr);&#xA;    if (ret &lt; 0)&#xA;    {&#xA;        return MEDIA_ERROR_INIT_FAILED;&#xA;    }&#xA;&#xA;    m_duration = m_formatCtx->duration;&#xA;    const AVCodec *vcodec = nullptr;&#xA;    m_vStreamIdx = av_find_best_stream(m_formatCtx,&#xA;                                        AVMEDIA_TYPE_VIDEO,&#xA;                                        -1,&#xA;                                        -1,&#xA;                                        &amp;vcodec,&#xA;                                        0);&#xA;&#xA;&#xA;    AVCodecParameters *codecParam = m_formatCtx->streams[m_vStreamIdx]->codecpar;&#xA;    m_width = codecParam->width;&#xA;    m_height = codecParam->height;&#xA;    m_vCodec = codecParam->codec_id;&#xA;    AVRational fpsRatio = m_formatCtx->streams[m_vStreamIdx]->avg_frame_rate;&#xA;    m_frameRate = fpsRatio.num / (float)fpsRatio.den;&#xA;&#xA;    if (codecParam->codec_id == AV_CODEC_ID_H264)&#xA;    {&#xA;        // if stored in ANNEXB type convert to NALU&#xA;        m_isNal = codecParam->extradata_size > 0 &amp;&amp; *(codecParam->extradata) == 1;&#xA;        if (m_isNal)&#xA;        {&#xA;            const AVBitStreamFilter *bsfFilter = av_bsf_get_by_name("h264_mp4toannexb");&#xA;            if (!bsfFilter)&#xA;            {&#xA;                return MEDIA_ERROR_INIT_FAILED;&#xA;            }&#xA;            av_bsf_alloc(bsfFilter, &amp;m_bsfcContext);&#xA;            m_bsfcContext->par_in = codecParam;&#xA;            av_bsf_init(m_bsfcContext);&#xA;&#xA;            m_bsfPacket = av_packet_alloc();&#xA;        }&#xA;    }&#xA;&#xA;    m_packet = av_packet_alloc();&#xA;}&#xA;&#xA;int MediaParserFFmpeg::getNextFrame(MediaType *mediaType, AVEncodedFrame **outFrame)&#xA;{&#xA;    int ret = 0;&#xA;    ret = av_read_frame(m_formatCtx, m_packet);&#xA;&#xA;    if (ret &lt; 0 &amp;&amp; ret != AVERROR_EOF)&#xA;    {&#xA;        av_packet_unref(m_packet);&#xA;        return MEDIA_ERROR_PARSER_PARSE_FAILED;&#xA;    }&#xA;&#xA;    if (ret == AVERROR_EOF)&#xA;    {&#xA;        av_packet_unref(m_packet);&#xA;        return MEDIA_INFO_PARSER_END_OF_STREAM;&#xA;    }&#xA;&#xA;    if (m_packet->data &amp;&amp; m_packet->size)&#xA;    {&#xA;        if (m_vCodec == VIDEOCODEC_H264 &amp;&amp; m_isNal)&#xA;        {&#xA;            int res = av_bsf_send_packet(m_bsfcContext, m_packet);&#xA;            if (res != 0)&#xA;            {&#xA;                MEDIA_LOG() &lt;&lt; "ZError:" &lt;&lt; "Error adding NAL to H264 stream";&#xA;            }&#xA;&#xA;            if (res == 0)&#xA;            {&#xA;                *outFrame = new EncodedVideoFrame(m_bsfPacket->data,&#xA;                                                    m_bsfPacket->size,&#xA;                                                    getTimeStamp(m_bsfPacket, m_formatCtx->streams[m_vStreamIdx]),&#xA;                                                    m_width,&#xA;                                                    m_height,&#xA;                                                    true);&#xA;                *mediaType = MEDIA_TYPE_VIDEO;&#xA;            }&#xA;            av_packet_unref(m_bsfPacket);&#xA;&#xA;            res = av_bsf_receive_packet(m_bsfcContext, m_bsfPacket);&#xA;        }&#xA;    }&#xA;    av_packet_unref(m_packet);&#xA;    return MEDIA_SUCCESS;&#xA;}&#xA;&#xA;int64_t MediaParserFFmpeg::getTimeStamp(AVPacket *packet, AVStream *stream)&#xA;{&#xA;    if (packet->pts != (qint64)AV_NOPTS_VALUE)&#xA;    {&#xA;        return (1000000 * (packet->pts * ((float)stream->time_base.num / stream->time_base.den)));&#xA;    }&#xA;    else if (packet->dts != (qint64)AV_NOPTS_VALUE)&#xA;    {&#xA;        return (1000000 * (packet->dts * ((float)stream->time_base.num / stream->time_base.den)));&#xA;    }&#xA;    else&#xA;    {&#xA;        return 0;&#xA;    }&#xA;}&#xA;

    &#xA;

    Then I have a thread that's calling getNextFrame() getting a new EncodedVideoFrame and pushing it to MediaCodec decoder in this way :

    &#xA;

    AMediaCodec_queueInputBuffer(m_mediaCodec, index, 0, encodedFrame->m_frameSize, encodedFrame->m_timeStamp, 0);&#xA;

    &#xA;

    As I said, it works but produces a video that got played extremely fast ; already tried to play with pts and dts without luck ( not sure if I was doing something wrong there anyway ).

    &#xA;

    Any thoughs on how to solve this ?

    &#xA;