Recherche avancée

Médias (0)

Mot : - Tags -/organisation

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

Autres articles (112)

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

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, 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 (...)

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

Sur d’autres sites (11486)

  • Transcoding to a dnxhd .mxf files will change resolution to 1088p, any chance of geting a 1080p file instead ?

    27 février 2023, par willjonesvfx

    Exporting to a .mov file will give me a 1920x1080p file as required
However the exact same code exporting to a .mxf will actually export a 1920x1088p file which breaks our pipeline.

    


    ffmpeg - start_number 1000 -i -inputfile%4d.tiff -c:v dnxhd -r 24 -b:v115M -pix_fmt yuv422p outputfile.mxf


    


    Any help would be appreciated !

    


    Thanks
Will

    


    I have tried to set the scale etc and it doesn't change anything. Has anyone ever seen this before and if so is there a fix ? At this point i may report this as a bug !

    


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

    


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

    


    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.

    


    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.

    


    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;

  • Variable resolution in video file containers like mp4, mkv

    15 novembre 2022, par Artem Suprunov

    I need to make an application that gets media data from some proprietary system and save to files mkv and mp4, on user's choice. In that system resolution of video frames may vary (for instance, 1920x1080, 1280x720 etc.). My question is whether it's possible to have in that containers a video track with variable resolution ?

    &#xA;

    I'm going to use ffmpeg libs C api, but if it has design limitations that don't allow to change resolution on fly, then I'll have to implement own muxers, but firstly need to find out if it's possible n terms of the containers format, at least one of them.

    &#xA;