Recherche avancée

Médias (1)

Mot : - Tags -/iphone

Autres articles (86)

  • Les tâches Cron régulières de la ferme

    1er décembre 2010, par

    La gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
    Le super Cron (gestion_mutu_super_cron)
    Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)

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

  • Submit bugs and patches

    13 avril 2011

    Unfortunately a software is never perfect.
    If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
    If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
    You may also (...)

Sur d’autres sites (8869)

  • doc/resampler, swresample/options : use proper capitalization

    10 octobre 2015, par Ganesh Ajjanagadde
    doc/resampler, swresample/options : use proper capitalization
    

    Proper names should be capitalized in all user facing API as far as
    possible. The option names themselves have not been changed since :
    1. We consistently keep option names in lower case.
    2. Changing them would break existing scripts.
    3. I suspect that we want to be similar to Sox and its relevant options.

    The converse is also true : improper names should not be capitalized
    generally.

    Signed-off-by : Ganesh Ajjanagadde <gajjanagadde@gmail.com>
    Signed-off-by : Michael Niedermayer <michael@niedermayer.cc>

    • [DH] doc/resampler.texi
    • [DH] libswresample/options.c
    • [DH] libswresample/swresample.h
  • avutil/dict : Improve documentation

    24 septembre 2022, par Marvin Scholz
    avutil/dict : Improve documentation
    

    Mostly consistent formatting and consistently ordering of
    warnings/notes to be next to the description.

    Additionally group the AV_DICT_* macros.

    Signed-off-by : Anton Khirnov <anton@khirnov.net>

    • [DH] libavutil/dict.h
  • ffmpeg decoding through C-API leads to artefacts when input resolution is 1200x1600. Am I doing something wrong ?

    26 février 2023, par Antonio

    Using the C-API and FFmpeg 5.1 I have been able to encode h264 videos with libx264 on Android.&#xA;Now I wanted to replay them on Linux inside my C++ application. These videos can be played correctly on a browser, or on other players that I tried like mplayer or ffplay from ffmpeg. Also, I can unroll the frames with ffmpeg -i recording.mp4 -start_number 0 -qscale:v 5 %06d.jpg and the images look alright.

    &#xA;

    However in my C++ application every now and then, but in a very repeatable way, I get artifacts (like the bright pixels showing up above the monitor). They do not accumulate, even though they are not related to keyframes. So whatever error is going on, it doesn't seem to have an impact on subsequent frames. I use OpenCV to visualize the output, and I am pretty sure the problem is not the conversion to BGR because the artifact is already there if I simply show the y channel (luminance, grayscale).

    &#xA;

    These artifacts show up in videos that I have recorded with a 1200x1600 resolution. It is to be noted that 1200 is not divisible by 32 so ffmpeg does add some padding, but I am dealing with it and it's not an issue. Videos recorded at 1920x1440 are replayed with no artifacts. Two sample videos can be found here for download.

    &#xA;

    Here follows the code I am using, on the bottom you can see a picture of my decoded image with the artifact and the same as unrolled by ffmpeg command line. It should be noted that I am working with a custom built version of ffmpeg, out of conan packages, while the unrolling is done with ffmpeg from command line that comes with Ubuntu.

    &#xA;

    extern "C" {&#xA;#include <libavcodec></libavcodec>avcodec.h>&#xA;#include <libavformat></libavformat>avformat.h>&#xA;}&#xA;&#xA;#include &#xA;#include &#xA;#include &#xA;&#xA;#include <iostream>&#xA;int main(int argc, char** argv) {&#xA;&#xA;    int ret;&#xA;&#xA;    auto pkt = av_packet_alloc();&#xA;    if (!pkt) {&#xA;        std::cerr &lt;&lt; "Failed av_packet_alloc()" &lt;&lt; std::endl;&#xA;        exit(1);&#xA;    }&#xA;&#xA;    AVFormatContext* av_format = avformat_alloc_context();&#xA;    ret = avformat_open_input(&amp;av_format, FILE_NAME, nullptr, nullptr);&#xA;    if (ret &lt; 0) {&#xA;        std::cerr &lt;&lt; "Failed avformat_open_input, Error: " &lt;&lt; ret &lt;&lt; std::endl;&#xA;        ///Error codes https://stackoverflow.com/questions/12780931/ffmpeg-exit-status-1094995529&#xA;        exit(1);&#xA;    }&#xA;    av_dump_format(av_format, 0, FILE_NAME, 0);&#xA;    auto video_st_number = av_find_best_stream(av_format, AVMEDIA_TYPE_VIDEO, -1, -1, nullptr, 0);&#xA;    if (video_st_number &lt; 0) {&#xA;        std::cerr &lt;&lt; "av_find_best_stream couldn&#x27;t find video stream" &lt;&lt; std::endl;&#xA;        exit(1);&#xA;    }&#xA;    auto video_st = av_format->streams[video_st_number];&#xA;    auto codec_id = video_st->codecpar->codec_id;&#xA;    std::cout &lt;&lt; "Duration " &lt;&lt; video_st->duration &lt;&lt; std::endl;&#xA;    std::cout &lt;&lt; "n_frames " &lt;&lt; video_st->nb_frames &lt;&lt; std::endl;&#xA;&#xA;    auto frame = av_frame_alloc();&#xA;    if (!frame) {&#xA;        fprintf(stderr, "Could not allocate video frame\n");&#xA;        exit(1);&#xA;    }&#xA;&#xA;    auto codec = avcodec_find_decoder(codec_id);&#xA;    if (!codec) {&#xA;        fprintf(stderr, "Codec not found\n");&#xA;        exit(1);&#xA;    }&#xA;&#xA;    auto c = avcodec_alloc_context3(codec);&#xA;    if (!c) {&#xA;        fprintf(stderr, "Could not allocate video codec context\n");&#xA;        exit(1);&#xA;    }&#xA;&#xA;&#xA;    if ((ret = avcodec_parameters_to_context(c, video_st->codecpar))) {&#xA;        fprintf(stderr, "Failed avcodec_parameters_to_context\n");&#xA;        exit(1);&#xA;    }&#xA;&#xA;    c->pix_fmt = AV_PIX_FMT_YUV420P;///Not really necessary&#xA;    c->thread_count = 1;///No impact&#xA;&#xA;    /* open it */&#xA;    if (avcodec_open2(c, codec, NULL) &lt; 0) {&#xA;        fprintf(stderr, "Could not open codec\n ");&#xA;        exit(1);&#xA;    }&#xA;&#xA;    std::size_t counter = 0;&#xA;    std::size_t n_keyframes = 0;&#xA;&#xA;    while (ret >= 0) {&#xA;        ret = av_read_frame(av_format, pkt);&#xA;        if (pkt->size == 0) {&#xA;            std::cout &lt;&lt; "Skipping packet of size zero" &lt;&lt; std::endl;&#xA;            av_packet_unref(pkt);&#xA;            continue;&#xA;        }&#xA;        while (avcodec_send_packet(c, pkt) != 0) {&#xA;            if (avcodec_receive_frame(c, frame) != 0) {&#xA;                std::cerr &lt;&lt; "Error receiving frame" &lt;&lt; std::endl;&#xA;                exit(1);&#xA;            } else {&#xA;                n_keyframes &#x2B;= frame->key_frame;&#xA;                std::cout &lt;&lt; "Decoded " &lt;&lt; &#x2B;&#x2B;counter &lt;&lt; " frames. Frame No. " &lt;&lt; frame->pts / pkt->duration &lt;&lt; " "&#xA;                          &lt;&lt; frame->decode_error_flags &lt;&lt; " " &lt;&lt; frame->key_frame &lt;&lt; " " &lt;&lt; n_keyframes &lt;&lt; " "&#xA;                          &lt;&lt; frame->pkt_dts &lt;&lt; std::endl;&#xA;            }&#xA;            display(frame);&#xA;        }&#xA;        av_packet_unref(pkt);&#xA;    }&#xA;&#xA;    avcodec_send_packet(c, nullptr);&#xA;    std::cout &lt;&lt; "Flushing decoder" &lt;&lt; std::endl;&#xA;&#xA;    while (avcodec_receive_frame(c, frame) == 0) {&#xA;        n_keyframes &#x2B;= frame->key_frame;&#xA;        std::cout &lt;&lt; "Decoded " &lt;&lt; &#x2B;&#x2B;counter &lt;&lt; " frames. Frame No. " &lt;&lt; frame->pts &lt;&lt; " " &lt;&lt; frame->decode_error_flags&#xA;                  &lt;&lt; " " &lt;&lt; frame->key_frame &lt;&lt; " " &lt;&lt; n_keyframes &lt;&lt; " " &lt;&lt; frame->pkt_dts &lt;&lt; std::endl;&#xA;&#xA;        display(frame);&#xA;    }&#xA;&#xA;    avcodec_free_context(&amp;c);&#xA;    avformat_free_context(av_format);&#xA;    av_frame_free(&amp;frame);&#xA;    av_packet_free(&amp;pkt);&#xA;&#xA;    return 0;&#xA;}&#xA;</iostream>

    &#xA;

    Picture as from my encoder&#xA;Picture from ffmpeg command line unrolling

    &#xA;

    For completeness, this is the display function, using openCV

    &#xA;

    void display(const AVFrame* frame) {&#xA;    static std::vector yuv_buffer;&#xA;    yuv_buffer.resize(frame->linesize[0] * 3 / 2 * frame->width);&#xA;    cv::Mat mYUV(frame->height * 3 / 2, frame->width, CV_8UC1, yuv_buffer.data(), frame->linesize[0]);&#xA;    memcpy(mYUV.ptr(), frame->data[0], frame->linesize[0] * frame->height);&#xA;    //cv::imshow("grayscale", mYUV.rowRange(0, frame->height));&#xA;    //cv::imshow("u", cv::Mat(frame->height / 2, frame->width / 2, CV_8UC1, frame->data[1], frame->linesize[1]));&#xA;    //cv::imshow("v", cv::Mat(frame->height / 2, frame->width / 2, CV_8UC1, frame->data[2], frame->linesize[2]));&#xA;&#xA;    int dest_row = frame->height;&#xA;    for (int j = 0; j &lt; frame->height / 2; j&#x2B;&#x2B;) {&#xA;        memcpy(mYUV.ptr(dest_row), frame->data[1] &#x2B; frame->linesize[1] * j, frame->width);&#xA;        j&#x2B;&#x2B;;&#xA;        memcpy(mYUV.ptr(dest_row) &#x2B; frame->width / 2, frame->data[1] &#x2B; frame->linesize[1] * j, frame->width);&#xA;        dest_row&#x2B;&#x2B;;&#xA;    }&#xA;    for (int j = 0; j &lt; frame->height / 2; j&#x2B;&#x2B;) {&#xA;        memcpy(mYUV.ptr(dest_row), frame->data[2] &#x2B; frame->linesize[2] * j, frame->width);&#xA;        j&#x2B;&#x2B;;&#xA;        memcpy(mYUV.ptr(dest_row) &#x2B; frame->width / 2, frame->data[2] &#x2B; frame->linesize[2] * j, frame->width);&#xA;        dest_row&#x2B;&#x2B;;&#xA;    }&#xA;    cv::Mat mRGB(frame->height, frame->width, CV_8UC3);&#xA;    cvtColor(mYUV, mRGB, cv::COLOR_YUV2BGR_I420, 3);&#xA;    cv::imshow("Video", mRGB);&#xA;    cv::waitKey(0);&#xA;}&#xA;

    &#xA;


    &#xA;

    Note : The AVFrame -> cv::Mat converter is now available in corrected version as answer here.

    &#xA;