Recherche avancée

Médias (17)

Mot : - Tags -/wired

Autres articles (89)

  • D’autres logiciels intéressants

    12 avril 2011, par

    On ne revendique pas d’être les seuls à faire ce que l’on fait ... et on ne revendique surtout pas d’être les meilleurs non plus ... Ce que l’on fait, on essaie juste de le faire bien, et de mieux en mieux...
    La liste suivante correspond à des logiciels qui tendent peu ou prou à faire comme MediaSPIP ou que MediaSPIP tente peu ou prou à faire pareil, peu importe ...
    On ne les connais pas, on ne les a pas essayé, mais vous pouvez peut être y jeter un coup d’oeil.
    Videopress
    Site Internet : (...)

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

  • Librairies et binaires spécifiques au traitement vidéo et sonore

    31 janvier 2010, par

    Les logiciels et librairies suivantes sont utilisées par SPIPmotion d’une manière ou d’une autre.
    Binaires obligatoires FFMpeg : encodeur principal, permet de transcoder presque tous les types de fichiers vidéo et sonores dans les formats lisibles sur Internet. CF ce tutoriel pour son installation ; Oggz-tools : outils d’inspection de fichiers ogg ; Mediainfo : récupération d’informations depuis la plupart des formats vidéos et sonores ;
    Binaires complémentaires et facultatifs flvtool2 : (...)

Sur d’autres sites (10813)

  • aarch64/opusdsp : implement NEON accelerated postfilter and deemphasis

    15 mars 2019, par Lynne
    aarch64/opusdsp : implement NEON accelerated postfilter and deemphasis
    

    153372 UNITS in postfilter_c, 65536 runs, 0 skips
    73164 UNITS in postfilter_neon, 65536 runs, 0 skips -> 2.1x speedup

    80591 UNITS in deemphasis_c, 131072 runs, 0 skips
    43969 UNITS in deemphasis_neon, 131072 runs, 0 skips -> 1.83x speedup

    Total decoder speedup : 15% on a Raspberry Pi 3 (from 28.1x to 33.5x realtime)

    Deemphasis SIMD based on the following unrolling :
    const float c1 = CELT_EMPH_COEFF, c2 = c1*c1, c3 = c2*c1, c4 = c3*c1 ;
    float state = coeff ;

    for (int i = 0 ; i < len ; i += 4)
    y[0] = x[0] + c1*state ;
    y[1] = x[1] + c2*state + c1*x[0] ;
    y[2] = x[2] + c3*state + c1*x[1] + c2*x[0] ;
    y[3] = x[3] + c4*state + c1*x[2] + c2*x[1] + c3*x[0] ;

    state = y[3] ;
    y += 4 ;
    x += 4 ;

    Unlike the x86 version, duplication is used instead of pslldq so
    the structure and tables are different.

    • [DH] libavcodec/aarch64/Makefile
    • [DH] libavcodec/aarch64/opusdsp_init.c
    • [DH] libavcodec/aarch64/opusdsp_neon.S
    • [DH] libavcodec/opusdsp.c
    • [DH] libavcodec/opusdsp.h
  • Why do I get a EXC_BAD_ACCESS error while running a simple sws_scale function ? [closed]

    3 décembre 2022, par Vish

    All I'm trying to do is decode a video using ffmpeg, and change format from YUV to RGBA using sws_scale. The code is as follows :

    &#xA;

    `

    &#xA;

    #include "video_reader.hpp"&#xA;#include &#xA;#include <iostream>&#xA;&#xA;using namespace std;&#xA;&#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;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;        if (!avcodec_find_decoder(av_codec_params->codec_id)) {&#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(avcodec_find_decoder(av_codec_params->codec_id));&#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, avcodec_find_decoder(av_codec_params->codec_id), 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;&#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, AV_PIX_FMT_YUV420P,&#xA;                                        width, height, AV_PIX_FMT_RGB0,&#xA;                                        SWS_FAST_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;    cout &lt;&lt; av_codec_ctx->pix_fmt &lt;&lt; endl;&#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;</iostream>

    &#xA;

    `&#xA;This gives me the following error at the sws_scale step, during debugging. Could you please let me know what it is I could be doing wrong ?

    &#xA;

    EXC_BAD_ACCESS (code=1, address=0x910043e491224463)

    &#xA;

    I was expecting to get the RGBA array as shown in various tutorials.

    &#xA;

  • Media Source Extensions - Identifying when there is no more data

    8 octobre 2015, par galbarm

    I’m creating a fragmented MP4 of a real-time live content with constant 10FPS but occasionally a frame gets dropped before being feed to the MP4 creation process.
    The MP4 is transmitted to the web through a web socket.

    Due to the occasional frames drop, the playback speed of the file is effectively slightly greater than 1x, because the player plays at 10FPS.
    Since this is a live content, after some duration, the player reaches the present time and has no data to play.

    Now, to the MSE issue :
    What seems to happen in Chrome, when the player doesn’t have enough data to continue playing, is that it pauses for 1-2 secs, then plays it very fast, and vice versa. So at this point the user experience becomes very bad.
    The issue was discussed here :
    https://www.w3.org/Bugs/Public/show_bug.cgi?id=28379

    My idea to workaround this, is to identify the state (having no more data), change playback rate to 0.9 for a few seconds to allow some buffering, and then switch back to 1.0.
    The problem is that I couldn’t find a way to identify the state.
    The readystate of the media element seems to always have the value of "HAVE_ENOUGH_DATA" even when the issue starts.

    Does the MSE API exposes a way identify the state that I have described ?