Recherche avancée

Médias (0)

Mot : - Tags -/médias

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

Autres articles (60)

  • Pas question de marché, de cloud etc...

    10 avril 2011

    Le vocabulaire utilisé sur ce site essaie d’éviter toute référence à la mode qui fleurit allègrement
    sur le web 2.0 et dans les entreprises qui en vivent.
    Vous êtes donc invité à bannir l’utilisation des termes "Brand", "Cloud", "Marché" etc...
    Notre motivation est avant tout de créer un outil simple, accessible à pour tout le monde, favorisant
    le partage de créations sur Internet et permettant aux auteurs de garder une autonomie optimale.
    Aucun "contrat Gold ou Premium" n’est donc prévu, aucun (...)

  • Contribute to documentation

    13 avril 2011

    Documentation is vital to the development of improved technical capabilities.
    MediaSPIP welcomes documentation by users as well as developers - including : critique of existing features and functions articles contributed by developers, administrators, content producers and editors screenshots to illustrate the above translations of existing documentation into other languages
    To contribute, register to the project users’ mailing (...)

  • Selection of projects using MediaSPIP

    2 mai 2011, par

    The examples below are representative elements of MediaSPIP specific uses for specific projects.
    MediaSPIP farm @ Infini
    The non profit organizationInfini develops hospitality activities, internet access point, training, realizing innovative projects in the field of information and communication technologies and Communication, and hosting of websites. It plays a unique and prominent role in the Brest (France) area, at the national level, among the half-dozen such association. Its members (...)

Sur d’autres sites (5784)

  • avcodec/mpegvideo : Don't overallocate buffer

    25 octobre 2022, par Andreas Rheinhardt
    avcodec/mpegvideo : Don't overallocate buffer
    

    Only encoders need two sets of int16_t [12][64]
    (one to save the current best state and one for the current
    working state) ; decoders need only one. This saves 1.5KiB
    per slice context for a decoder.

    Signed-off-by : Andreas Rheinhardt <andreas.rheinhardt@outlook.com>

    • [DH] libavcodec/mpegvideo.c
  • Assertion desc failed at src/libswscale/swscale_internal.h:764

    18 avril 2022, par harsh bhatnagar

    I am trying to implement the ffmpeg code written in C++ language .

    &#xA;

    Tutorial link : https://www.youtube.com/watch?v=W6Yx3injNZs

    &#xA;

    Github Reference : https://github.com/bartjoyce/video-app/tree/master/src

    &#xA;

    When pass the filename or Rtsp Link in the avformat_open_input funcion. It shows the strange bug not able understand the issue in the C++ code or camera setting issue .

    &#xA;

    // av_err2str returns a temporary array. This doesn&#x27;t work in gcc.&#xA;// This function can be used as a replacement for av_err2str.&#xA;#include "video_reader.hpp"&#xA;static const char* av_make_error(int errnum) {&#xA;    static char str[AV_ERROR_MAX_STRING_SIZE];&#xA;    memset(str, 0, sizeof(str));&#xA;    return av_make_error_string(str, AV_ERROR_MAX_STRING_SIZE, errnum);&#xA;}&#xA;&#xA;static AVPixelFormat correct_for_deprecated_pixel_format(AVPixelFormat pix_fmt) {&#xA;    // Fix swscaler deprecated pixel format warning&#xA;    // (YUVJ has been deprecated, change pixel format to regular YUV)&#xA;    switch (pix_fmt) {&#xA;        case AV_PIX_FMT_YUVJ420P: return AV_PIX_FMT_YUV420P;&#xA;        case AV_PIX_FMT_YUVJ422P: return AV_PIX_FMT_YUV422P;&#xA;        case AV_PIX_FMT_YUVJ444P: return AV_PIX_FMT_YUV444P;&#xA;        case AV_PIX_FMT_YUVJ440P: return AV_PIX_FMT_YUV440P;&#xA;        default:                  return pix_fmt;&#xA;    }&#xA;}&#xA;&#xA;bool video_reader_open(VideoReaderState* state, const char* filename) {&#xA;&#xA;    // Unpack members of state&#xA;    auto&amp; width = state->width;&#xA;    auto&amp; height = state->height;&#xA;    auto&amp; time_base = state->time_base;&#xA;    auto&amp; av_format_ctx = state->av_format_ctx;&#xA;    auto&amp; av_codec_ctx = state->av_codec_ctx;&#xA;    auto&amp; video_stream_index = state->video_stream_index;&#xA;    auto&amp; av_frame = state->av_frame;&#xA;    auto&amp; av_packet = state->av_packet;&#xA;&#xA;    // Open the file using libavformat&#xA;    av_format_ctx = avformat_alloc_context();&#xA;    if (!av_format_ctx) {&#xA;        printf("Couldn&#x27;t created AVFormatContext\n");&#xA;        return false;&#xA;    }&#xA;&#xA;    if (avformat_open_input(&amp;av_format_ctx, filename, NULL, NULL) != 0) {&#xA;        printf("Couldn&#x27;t open video file\n");&#xA;        return false;&#xA;    }&#xA;&#xA;    // Find the first valid video stream inside the file&#xA;    video_stream_index = -1;&#xA;    AVCodecParameters* av_codec_params;&#xA;    AVCodec* av_codec;&#xA;    for (int i = 0; i &lt; av_format_ctx->nb_streams; &#x2B;&#x2B;i) {&#xA;        av_codec_params = av_format_ctx->streams[i]->codecpar;&#xA;        av_codec = avcodec_find_decoder(av_codec_params->codec_id);&#xA;        if (!av_codec) {&#xA;            continue;&#xA;        }&#xA;        if (av_codec_params->codec_type == AVMEDIA_TYPE_VIDEO) {&#xA;            video_stream_index = i;&#xA;            width = av_codec_params->width;&#xA;            height = av_codec_params->height;&#xA;            time_base = av_format_ctx->streams[i]->time_base;&#xA;            break;&#xA;        }&#xA;    }&#xA;    if (video_stream_index == -1) {&#xA;        printf("Couldn&#x27;t find valid video stream inside file\n");&#xA;        return false;&#xA;    }&#xA;&#xA;    // Set up a codec context for the decoder&#xA;    av_codec_ctx = avcodec_alloc_context3(av_codec);&#xA;    if (!av_codec_ctx) {&#xA;        printf("Couldn&#x27;t create AVCodecContext\n");&#xA;        return false;&#xA;    }&#xA;    if (avcodec_parameters_to_context(av_codec_ctx, av_codec_params) &lt; 0) {&#xA;        printf("Couldn&#x27;t initialize AVCodecContext\n");&#xA;        return false;&#xA;    }&#xA;    if (avcodec_open2(av_codec_ctx, av_codec, NULL) &lt; 0) {&#xA;        printf("Couldn&#x27;t open codec\n");&#xA;        return false;&#xA;    }&#xA;&#xA;    av_frame = av_frame_alloc();&#xA;    if (!av_frame) {&#xA;        printf("Couldn&#x27;t allocate AVFrame\n");&#xA;        return false;&#xA;    }&#xA;    av_packet = av_packet_alloc();&#xA;    if (!av_packet) {&#xA;        printf("Couldn&#x27;t allocate AVPacket\n");&#xA;        return false;&#xA;    }&#xA;&#xA;    return true;&#xA;}&#xA;&#xA;bool video_reader_read_frame(VideoReaderState* state, uint8_t* frame_buffer, int64_t* pts) {&#xA;&#xA;    // Unpack members of state&#xA;    auto&amp; width = state->width;&#xA;    auto&amp; height = state->height;&#xA;    auto&amp; av_format_ctx = state->av_format_ctx;&#xA;    auto&amp; av_codec_ctx = state->av_codec_ctx;&#xA;    auto&amp; video_stream_index = state->video_stream_index;&#xA;    auto&amp; av_frame = state->av_frame;&#xA;    auto&amp; av_packet = state->av_packet;&#xA;    auto&amp; sws_scaler_ctx = state->sws_scaler_ctx;&#xA;&#xA;    // Decode one frame&#xA;    int response;&#xA;    while (av_read_frame(av_format_ctx, av_packet) >= 0) {&#xA;        if (av_packet->stream_index != video_stream_index) {&#xA;            av_packet_unref(av_packet);&#xA;            continue;&#xA;        }&#xA;&#xA;        response = avcodec_send_packet(av_codec_ctx, av_packet);&#xA;        if (response &lt; 0) {&#xA;            printf("Failed to decode packet: %s\n", av_make_error(response));&#xA;            return false;&#xA;        }&#xA;&#xA;        response = avcodec_receive_frame(av_codec_ctx, av_frame);&#xA;        if (response == AVERROR(EAGAIN) || response == AVERROR_EOF) {&#xA;            av_packet_unref(av_packet);&#xA;            continue;&#xA;        } else if (response &lt; 0) {&#xA;            printf("Failed to decode packet: %s\n", av_make_error(response));&#xA;            return false;&#xA;        }&#xA;&#xA;        av_packet_unref(av_packet);&#xA;        break;&#xA;    }&#xA;&#xA;    *pts = av_frame->pts;&#xA;    &#xA;    // Set up sws scaler&#xA;    if (!sws_scaler_ctx) {&#xA;        auto source_pix_fmt = correct_for_deprecated_pixel_format(av_codec_ctx->pix_fmt);&#xA;        sws_scaler_ctx = sws_getContext(width, height, source_pix_fmt,&#xA;                                        width, height, AV_PIX_FMT_RGB0,&#xA;                                        SWS_BILINEAR, NULL, NULL, NULL);&#xA;    }&#xA;    if (!sws_scaler_ctx) {&#xA;        printf("Couldn&#x27;t initialize sw scaler\n");&#xA;        return false;&#xA;    }&#xA;&#xA;    uint8_t* dest[4] = { frame_buffer, NULL, NULL, NULL };&#xA;    int dest_linesize[4] = { width * 4, 0, 0, 0 };&#xA;    sws_scale(sws_scaler_ctx, av_frame->data, av_frame->linesize, 0, av_frame->height, dest, dest_linesize);&#xA;&#xA;    return true;&#xA;}&#xA;&#xA;bool video_reader_seek_frame(VideoReaderState* state, int64_t ts) {&#xA;    &#xA;    // Unpack members of state&#xA;    auto&amp; av_format_ctx = state->av_format_ctx;&#xA;    auto&amp; av_codec_ctx = state->av_codec_ctx;&#xA;    auto&amp; video_stream_index = state->video_stream_index;&#xA;    auto&amp; av_packet = state->av_packet;&#xA;    auto&amp; av_frame = state->av_frame;&#xA;    &#xA;    av_seek_frame(av_format_ctx, video_stream_index, ts, AVSEEK_FLAG_BACKWARD);&#xA;&#xA;    // av_seek_frame takes effect after one frame, so I&#x27;m decoding one here&#xA;    // so that the next call to video_reader_read_frame() will give the correct&#xA;    // frame&#xA;    int response;&#xA;    while (av_read_frame(av_format_ctx, av_packet) >= 0) {&#xA;        if (av_packet->stream_index != video_stream_index) {&#xA;            av_packet_unref(av_packet);&#xA;            continue;&#xA;        }&#xA;&#xA;        response = avcodec_send_packet(av_codec_ctx, av_packet);&#xA;        if (response &lt; 0) {&#xA;            printf("Failed to decode packet: %s\n", av_make_error(response));&#xA;            return false;&#xA;        }&#xA;&#xA;        response = avcodec_receive_frame(av_codec_ctx, av_frame);&#xA;        if (response == AVERROR(EAGAIN) || response == AVERROR_EOF) {&#xA;            av_packet_unref(av_packet);&#xA;            continue;&#xA;        } else if (response &lt; 0) {&#xA;            printf("Failed to decode packet: %s\n", av_make_error(response));&#xA;            return false;&#xA;        }&#xA;&#xA;        av_packet_unref(av_packet);&#xA;        break;&#xA;    }&#xA;&#xA;    return true;&#xA;}&#xA;&#xA;void video_reader_close(VideoReaderState* state) {&#xA;    sws_freeContext(state->sws_scaler_ctx);&#xA;    avformat_close_input(&amp;state->av_format_ctx);&#xA;    avformat_free_context(state->av_format_ctx);&#xA;    av_frame_free(&amp;state->av_frame);&#xA;    av_packet_free(&amp;state->av_packet);&#xA;    avcodec_free_context(&amp;state->av_codec_ctx);&#xA;}&#xA;

    &#xA;

    Bug :

    &#xA;

    [rtsp @ 0x55def0b00ac0] getaddrinfo(): Name or service not known&#xA;[rtsp @ 0x55def0b00ac0] max delay reached. need to consume packet&#xA;[rtsp @ 0x55def0b00ac0] RTP: missed 10 packets&#xA;Assertion desc failed at src/libswscale/swscale_internal.h:764&#xA;Aborted (core dumped)&#xA;

    &#xA;

  • avcodec/adpcm : refactor init/flush code

    31 mars 2021, par Zane van Iperen
    avcodec/adpcm : refactor init/flush code
    

    Most of the codecs just need everything zeroed. Those that don't
    are either handled inline during decode, or pull state from
    extradata.

    Move state reset/init functionality into adpcm_flush(), and
    invoke it from adpcm_decode_init().

    Signed-off-by : Zane van Iperen <zane@zanevaniperen.com>

    • [DH] libavcodec/adpcm.c