Recherche avancée

Médias (39)

Mot : - Tags -/audio

Autres articles (46)

  • La file d’attente de SPIPmotion

    28 novembre 2010, par

    Une file d’attente stockée dans la base de donnée
    Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
    Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

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

Sur d’autres sites (5990)

  • avcodec/evc_parser : Added parser implementation for EVC format

    15 juin 2023, par Dawid Kozinski
    avcodec/evc_parser : Added parser implementation for EVC format
    

    - Added constants definitions for EVC parser
    - Provided NAL units parsing following ISO_IEC_23094-1
    - EVC parser registration

    Signed-off-by : Dawid Kozinski <d.kozinski@samsung.com>

    • [DH] configure
    • [DH] libavcodec/Makefile
    • [DH] libavcodec/evc.h
    • [DH] libavcodec/evc_parse.c
    • [DH] libavcodec/evc_parse.h
    • [DH] libavcodec/evc_parser.c
    • [DH] libavcodec/parsers.c
  • FFmpeg avcodec C++ implementation producing distorted frames while converting YUV frame to jpg

    23 juin 2023, par CodeRhyno

    I have a YUV frame that I need to convert to jpg. For the frames with resolution 1920x1080 or 2560x1080 or 2560x880 or 640x360, I'm easily able to encode and create a jpg using the following code. The frames with a resolution of 1512x982 with 12 bit per pixel I am getting a distorted image using the same code. Using the following ffmpeg command, I am able to get perfect looking jpg image from the same 1512x982 resolution YUV file :

    &#xA;

    fmpeg -y -s:v 1512x982 -pix_fmt yuv420p -i 0.yuv 0.jpg&#xA;

    &#xA;

    Please help with the code part, as in what I may be missing here.

    &#xA;

    Distorted jpg

    &#xA;

    #include "ffmpeg-helper.h"&#xA;&#xA;AVFrame * FFmpegHelper::allocPicture(enum AVPixelFormat pix_fmt, int width, int height)&#xA;{&#xA;    // Allocate a frame&#xA;    AVFrame * frame = av_frame_alloc();&#xA;&#xA;    if (frame == NULL) {&#xA;        return NULL;&#xA;    }&#xA;&#xA;    frame -> width = width;&#xA;    frame -> height = height;&#xA;    frame -> format = pix_fmt;&#xA;    int ret = av_frame_get_buffer(frame, 0);&#xA;&#xA;    if (ret &lt; 0) {&#xA;        return NULL;&#xA;    }&#xA;    ret = av_frame_make_writable(frame);&#xA;    if (ret &lt; 0) {&#xA;        return NULL;&#xA;    }&#xA;    return frame;&#xA;}&#xA;&#xA;void FFmpegHelper::frameConversion(char * y, char * u, char * v,&#xA;    int srcWidth, int srcHeight, string filePath)&#xA;{&#xA;    avcodec_register_all();&#xA;    AVFrame * src = allocPicture(AVPixelFormat::AV_PIX_FMT_YUV420P, srcWidth, srcHeight);&#xA;    src -> data[0] = (uint8_t * ) y;&#xA;    src -> data[1] = (uint8_t * ) u;&#xA;    src -> data[2] = (uint8_t * ) v;&#xA;    src -> pts = 1;&#xA;&#xA;    auto encoderContext = getEncoderContext(AV_CODEC_ID_MJPEG, srcWidth, srcHeight);&#xA;    if (encoderContext == NULL) return;&#xA;&#xA;    FILE * frameFile = fopen(filePath.c_str(), "ab&#x2B;");&#xA;&#xA;    auto pkt = av_packet_alloc();&#xA;    encode(encoderContext, src, pkt, frameFile);&#xA;    encode(encoderContext, NULL, pkt, frameFile);&#xA;&#xA;    // memory cleanup&#xA;    avcodec_free_context( &amp; encoderContext);&#xA;    av_packet_unref(pkt);&#xA;    av_frame_free( &amp; src);&#xA;    fclose(frameFile);&#xA;}&#xA;&#xA;void FFmpegHelper::encode(AVCodecContext * enc_ctx, AVFrame * frame, AVPacket * pkt, FILE * outfile)&#xA;{&#xA;    /* send the frame to the encoder */&#xA;    if (frame == NULL) {&#xA;        return;&#xA;    }&#xA;    int ret = avcodec_send_frame(enc_ctx, frame);&#xA;    if (ret &lt; 0) {&#xA;        return;&#xA;    }&#xA;    ret = avcodec_receive_packet(enc_ctx, pkt);&#xA;    if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF) return;&#xA;    if (ret &lt; 0) return;&#xA;    fwrite(pkt -> data, pkt -> size, 1, outfile);&#xA;&#xA;}&#xA;&#xA;AVCodecContext * FFmpegHelper::getEncoderContext(AVCodecID extension, int width, int height)&#xA;{&#xA;    auto codec = avcodec_find_encoder(extension);&#xA;    if (!codec) {&#xA;        return NULL;&#xA;    }&#xA;    auto encoderContext = avcodec_alloc_context3(codec);&#xA;    encoderContext -> width = width;&#xA;    encoderContext -> height = height;&#xA;    encoderContext -> pix_fmt = AVPixelFormat::AV_PIX_FMT_YUVJ420P;&#xA;    AVRational frameRate = {&#xA;        1,&#xA;        1&#xA;    };&#xA;    encoderContext -> time_base = frameRate;&#xA;    if (avcodec_open2(encoderContext, codec, NULL) &lt; 0) {&#xA;        return;&#xA;    }&#xA;&#xA;    return encoderContext;&#xA;}&#xA;

    &#xA;

    The code starts from the function 'frameConversion' where I am providing data for Y, U, and V along with frame dimensions and file path to write.

    &#xA;

  • avcodec/cbs : add cbs implementation for H266/VVC

    21 mars 2023, par Nuo Mi
    avcodec/cbs : add cbs implementation for H266/VVC
    

    Add CodedBitstreamContext to parse VPS,SPS,PPS in VVC nal units.
    Implement parsing and writing of SPS,PPS,VPS,PH,AUD,SEI and slices.
    Add ff_cbs_type_h266 to cbs types tables and AV_CODEC_ID_H266
    to cbs codec ids.

    Co-authored-by : Thomas Siedel <thomas.ff@spin-digital.com>
    Signed-off-by : James Almer <jamrial@gmail.com>

    • [DH] configure
    • [DH] libavcodec/Makefile
    • [DH] libavcodec/cbs.c
    • [DH] libavcodec/cbs_h2645.c
    • [DH] libavcodec/cbs_h266.h
    • [DH] libavcodec/cbs_h266_syntax_template.c
    • [DH] libavcodec/cbs_internal.h
    • [DH] libavcodec/cbs_sei.c