Recherche avancée

Médias (9)

Mot : - Tags -/soundtrack

Autres articles (60)

  • List of compatible distributions

    26 avril 2011, par

    The table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
    If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...)

  • Changer son thème graphique

    22 février 2011, par

    Le thème graphique ne touche pas à la disposition à proprement dite des éléments dans la page. Il ne fait que modifier l’apparence des éléments.
    Le placement peut être modifié effectivement, mais cette modification n’est que visuelle et non pas au niveau de la représentation sémantique de la page.
    Modifier le thème graphique utilisé
    Pour modifier le thème graphique utilisé, il est nécessaire que le plugin zen-garden soit activé sur le site.
    Il suffit ensuite de se rendre dans l’espace de configuration du (...)

  • Demande de création d’un canal

    12 mars 2010, par

    En fonction de la configuration de la plateforme, l’utilisateur peu avoir à sa disposition deux méthodes différentes de demande de création de canal. La première est au moment de son inscription, la seconde, après son inscription en remplissant un formulaire de demande.
    Les deux manières demandent les mêmes choses fonctionnent à peu près de la même manière, le futur utilisateur doit remplir une série de champ de formulaire permettant tout d’abord aux administrateurs d’avoir des informations quant à (...)

Sur d’autres sites (8216)

  • Revision 5938 : pour swfupload ce n’est pas data.result.message mais data.message

    29 septembre 2011, par kent1 — Log

    pour swfupload ce n’est pas data.result.message mais data.message

  • FFProbe generated data don't seem to agree with calculated data using ffmpeg libraries

    18 janvier 2020, par ark1974

    Using ffmpeg library avformat I am trying to check if the ffprobe generated data agrees with the data generated by the library. The code objective is to try to seek to the nearest key frame. When trying to seek at 100 frame or less, the codes returns 0 all the time.
    When trying to seek at 200 frame, the codes returns 4 all the time. But the result ie 4th frame don’t seem to be right. Where am I wrong ? Is my time_base conversion to actual frame faulty ?

    The test result using ffprobe

    Filename = test.mp4  
    Duration = 00:00:10.56
    Fps = 25
    Total frames = 256  
    The key frames pkt_pts_time are at 2.120000  and 0.000000 (using -skip_frame nokey )
    Corresponding pkt_duration_time: 0.040000 and 0.040000 (  same, why?)

    Abstract of the code :

    // Objective: seek to the nearest key frame
    frameIndex = 200;
    int64_t timeBase = (int64_t(pCodecCtx->time_base.num) * AV_TIME_BASE) / int64_t(pCodecCtx->time_base.den);  
    int64_t seekTarget = int64_t(frameIndex) * timeBase;

    if (av_seek_frame(pFormatCtx, -1, seekTarget, AVSEEK_FLAG_FRAME | AVSEEK_FLAG_BACKWARD) < 0) return -1;

    //convert the time_base to actual frame
    auto time2frame = [&](int64_t tb) {
       return tb * int64_t(pCodecCtx->time_base.den) / (int64_t(pCodecCtx->time_base.num) * AV_TIME_BASE);
    };

    AVPacket avPacket;
    int result = av_read_frame(pFormatCtx, &avPacket);
    if (result == 0) {

       auto dts = avPacket.dts;
       auto pts = avPacket.pts;
       auto idx = avPacket.stream_index;
       auto f = time2frame(pts); // expecting the actual frame here
       std::cout << dts << pts << idx << f;
    }
  • How to save the video stream as h264

    16 mars 2023, par aaadddzxc

    I pull the stream through ffmpeg, and then save the video of this stream as an h264 file, but the saved file cannot be played. Why is this ?

    


    The h264 saved by the following code cannot be played,i dont know why...

    


    i try to vlc play, but cant play the h264 file.

    


    can be save to h264 without avformat_alloc_output_context2 function ?

    


    #include <thread>&#xA;#include <iostream>&#xA;#include <fstream>&#xA;extern "C"&#xA;{&#xA;#include <libavcodec></libavcodec>avcodec.h>&#xA;#include <libavcodec></libavcodec>bsf.h>&#xA;#include <libavformat></libavformat>avformat.h>&#xA;}&#xA;&#xA;#pragma comment(lib,"avcodec.lib")&#xA;#pragma comment(lib,"avdevice.lib")&#xA;#pragma comment(lib,"avfilter.lib")&#xA;#pragma comment(lib,"avformat.lib")&#xA;#pragma comment(lib,"avutil.lib")&#xA;#pragma comment(lib,"swresample.lib")&#xA;#pragma comment(lib,"swscale.lib")&#xA;&#xA;int mp4toannexb(AVBSFContext* bsf_ctx, AVPacket* pkt, std::ofstream&amp; out)&#xA;{&#xA;    int ret;&#xA;&#xA;    ret = av_bsf_send_packet(bsf_ctx, pkt);&#xA;    if (ret &lt; 0) {&#xA;        std::cout &lt;&lt; "bsf send packet failed, errno:" &lt;&lt; ret &lt;&lt; std::endl;&#xA;        return -1;&#xA;    }&#xA;&#xA;    for (;;) {&#xA;        ret = av_bsf_receive_packet(bsf_ctx, pkt);&#xA;        if (AVERROR_EOF == ret || AVERROR(EAGAIN) == ret) {&#xA;            return 0;&#xA;        }&#xA;        if (ret &lt; 0) {&#xA;            std::cout &lt;&lt; "Could not receive packet, errno:" &lt;&lt; ret &lt;&lt; std::endl;&#xA;            return -1;&#xA;        }&#xA;        out.write((const char*)pkt->data, pkt->size);&#xA;    }&#xA;    return 0;&#xA;}&#xA;&#xA;&#xA;int main()&#xA;{&#xA;    AVOutputFormat* ofmt = NULL;&#xA;    AVFormatContext* ifmt_ctx = NULL;&#xA;    AVBSFContext* bsf_ctx = NULL;&#xA;    AVPacket* pkt = NULL;&#xA;    const char* in_filename = "http://192.168.1.12:8088/live/123.flv";&#xA;    int ret = -1;&#xA;    int video_index = -1;&#xA;    std::ofstream outh264("D:\\ConsoleApplication1\\Debug\\out.h264", std::ios::binary | std::ios::trunc);&#xA;&#xA;    avformat_network_init();&#xA;&#xA;    if ((ifmt_ctx = avformat_alloc_context()) == NULL) {&#xA;        std::cout &lt;&lt; "avformat_alloc_context failed." &lt;&lt; std::endl;&#xA;        exit(1);&#xA;    }&#xA;&#xA;    if ((ret = avformat_open_input(&amp;ifmt_ctx, in_filename, 0, 0)) &lt; 0) {&#xA;        std::cout &lt;&lt; "Could not open input file." &lt;&lt; std::endl;&#xA;        exit(1);&#xA;    }&#xA;&#xA;    if ((ret = avformat_find_stream_info(ifmt_ctx, 0)) &lt; 0) {&#xA;        std::cout &lt;&lt; "Failed to retrieve input stream information" &lt;&lt; std::endl;&#xA;        return -1;&#xA;    }&#xA;&#xA;    if (!(pkt = av_packet_alloc())) {&#xA;        std::cout &lt;&lt; "Could not allocate packet" &lt;&lt; std::endl;&#xA;        return -1;&#xA;    }&#xA;&#xA;    video_index = av_find_best_stream(ifmt_ctx, AVMEDIA_TYPE_VIDEO, -1, -1, NULL, 0);&#xA;    if (video_index &lt; 0) {&#xA;        std::cout &lt;&lt; "Could not find stream " &lt;&lt; std::string(av_get_media_type_string(AVMEDIA_TYPE_VIDEO)) &lt;&lt; std::endl;&#xA;        return -1;&#xA;    }&#xA;&#xA;    av_dump_format(ifmt_ctx, 0, in_filename, 0);&#xA;&#xA;    const AVBitStreamFilter* filter = av_bsf_get_by_name("h264_mp4toannexb");&#xA;    if (NULL == filter) {&#xA;        std::cout &lt;&lt; "Could not create filter" &lt;&lt; std::endl;&#xA;        return -1;&#xA;    }&#xA;&#xA;    ret = av_bsf_alloc(filter, &amp;bsf_ctx);&#xA;    if (ret &lt; 0) {&#xA;        printf("Could not alloc bitstream filter \n");&#xA;        return -1;&#xA;    }&#xA;&#xA;    // avcodec_parameters_from_context&#xA;    ret = avcodec_parameters_copy(bsf_ctx->par_in, ifmt_ctx->streams[video_index]->codecpar);&#xA;    if (ret &lt; 0) {&#xA;        printf("Parameter copy filed, errno: %d \n", ret);&#xA;        return -1;&#xA;    }&#xA;&#xA;    ret = av_bsf_init(bsf_ctx);&#xA;    if (ret &lt; 0) {&#xA;        printf("BSF init failed, errno: %d \n", ret);&#xA;        return -1;&#xA;    }&#xA;&#xA;    while (av_read_frame(ifmt_ctx, pkt) >= 0) {&#xA;        if (pkt->stream_index == video_index)&#xA;        {&#xA;            mp4toannexb(bsf_ctx, pkt, outh264);&#xA;        }&#xA;        av_packet_unref(pkt);&#xA;    }&#xA;    outh264.close();&#xA;    avformat_close_input(&amp;ifmt_ctx);&#xA;    av_packet_free(&amp;pkt);&#xA;    av_bsf_free(&amp;bsf_ctx);&#xA;&#xA;    return 0;&#xA;}&#xA;</fstream></iostream></thread>

    &#xA;