Recherche avancée

Médias (2)

Mot : - Tags -/documentation

Autres articles (23)

  • 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

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

  • Ajouter notes et légendes aux images

    7 février 2011, par

    Pour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
    Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
    Modification lors de l’ajout d’un média
    Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)

Sur d’autres sites (6425)

  • What is the correct way to stream custom packets using ffmpeg ?

    9 janvier 2019, par Lucker10

    I want to encode frames from camera using NvPipe and stream them via RTP using FFmpeg. My code produces the following error when I want to decode the stream :

    [h264 @ 0x7f3c6c007e80] decode_slice_header error
    [h264 @ 0x7f3c6c007e80] non-existing PPS 0 referenced
    [h264 @ 0x7f3c6c007e80] decode_slice_header error
    [h264 @ 0x7f3c6c007e80] non-existing PPS 0 referenced
    [h264 @ 0x7f3c6c007e80] decode_slice_header error
    [h264 @ 0x7f3c6c007e80] non-existing PPS 0 referenced
    [h264 @ 0x7f3c6c007e80] decode_slice_header error
    [h264 @ 0x7f3c6c007e80] no frame!
    [h264 @ 0x7f3c6c007e80] non-existing PPS 0 referenced    0B f=0/0  
       Last message repeated 1 times

    On another PC, it is even not able to stream, and fails with an segmentation fault on av_interleaved_write_frame(..). How to initialize the AVPacket and its timebase correctly to successfully send and receive the stream using ffplay/VLC/ other software ?

    My code :

    avformat_network_init();
    // init encoder
    AVPacket *pkt = new AVPacket();
    int targetBitrate = 1000000;
    int targetFPS = 30;
    const uint32_t width = 640;
    const uint32_t height = 480;

    NvPipe* encoder = NvPipe_CreateEncoder(NVPIPE_BGRA32, NVPIPE_H264, NVPIPE_LOSSY, targetBitrate, targetFPS);

    // init stream output
    std::string str = "rtp://127.0.0.1:49990";
    AVStream* stream = nullptr;
    AVOutputFormat *output_format = av_guess_format("rtp", nullptr, nullptr);;
    AVFormatContext *output_format_ctx = avformat_alloc_context();

    avformat_alloc_output_context2(&output_format_ctx, output_format,   output_format->name, str.c_str());

    // open output url
    if (!(output_format->flags & AVFMT_NOFILE)){
        ret = avio_open(&output_format_ctx->pb, str.c_str(), AVIO_FLAG_WRITE);
    }

    output_format_ctx->oformat = output_format;
    output_format->video_codec = AV_CODEC_ID_H264;

    stream  = avformat_new_stream(output_format_ctx,nullptr);
    stream->id = 0;
    stream->codecpar->codec_id = AV_CODEC_ID_H264;
    stream->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;
    stream->codecpar->width = width;
    stream->codecpar->height = height;
    stream->time_base.den = 1;
    stream->time_base.num = targetFPS; // 30fps

    /* Write the header */
    avformat_write_header(output_format_ctx, nullptr); // this seems to destroy the timebase of the stream

    std::vector rgba(width * height * 4);
    std::vector compressed(rgba.size());
    int frameCnt = 0;

    // encoding and streaming
    while (true)
    {
    frameCnt++;
    // Encoding
    // Construct dummy frame
    for (uint32_t y = 0; y < height; ++y)
       for (uint32_t x = 0; x < width; ++x)
           rgba[4 * (y * width + x) + 1] = (255.0f * x* y) / (width * height) * (y % 100 < 50);

    uint64_t size = NvPipe_Encode(encoder, rgba.data(), width * 4, compressed.data(), compressed.size(), width, height, false); // last parameter needs to be true for keyframes

    av_init_packet(pkt);
    pkt->data = compressed.data();
    pkt->size = size;
    pkt->pts = frameCnt;

    if(!memcmp(compressed.data(), "\x00\x00\x00\x01\x67", 5)) {
       pkt->flags |= AV_PKT_FLAG_KEY;
    }

    //stream

    fflush(stdout);

    // Write the compressed frame into the output
    pkt->pts = av_rescale_q(frameCnt, AVRational {1, targetFPS}, stream->time_base);
    pkt->dts = pkt->pts;
    pkt->stream_index = stream->index;

    /* Write the data on the packet to the output format  */
    av_interleaved_write_frame(output_format_ctx, pkt);

    /* Reset the packet */
    av_packet_unref(pkt);
    }

    The .sdp file to open the stream with ffplay looks like this :

    v=0
    o=- 0 0 IN IP4 127.0.0.1
    s=No Name
    c=IN IP4 127.0.0.1
    t=0 0
    a=tool:libavformat 58.18.101
    m=video 49990 RTP/AVP 96
    a=rtpmap:96 H264/90000
    a=fmtp:96 packetization-mode=1
  • RTMP live stream directly from NVENC encoder

    16 novembre 2018, par rnd

    I am trying to create a live RTMP stream containing the animation generated with NVIDIA OptiX. The stream is to be received by nginx + rtmp module and broadcasted in MPEG-DASH format. Full chain up to dash.js player is working if the video is first saved to .flv file and then I send it with ffmpeg without any reformatting using command :

    



    ffmpeg -re -i my_video.flv -c:v copy -f flv rtmp://x.x.x.x:1935/dash/test


    



    But I want to stream directly from the code. And with this I am failng... Nginx logs an error "dash : invalid avcc received (2 : No such file or directory)". Then it seems to receive the stream correctly (segments are rolling, dash manifest is there), however the stream is not possible to play in the browser.

    



    I can see only one difference in the manifest between direct stream and stream from file. Codecs attribute of the representation in the direct stream is missed : codecs="avcc1.000000" instead of "avc1.640028" which I get when streaming from file.

    



    My code opens the stream :

    



    av_register_all();
AVOutputFormat* fmt = av_guess_format("flv",
file_name, nullptr);
fmt->video_codec = AV_CODEC_ID_H264;

AVFormatContext* _oc;
avformat_alloc_output_context2(&_oc, fmt, nullptr, "rtmp://x.x.x.x:1935/dash/test");

AVStream* _vs = avformat_new_stream(_oc, nullptr);
_vs->id = 0;
_vs->time_base = AVRational { 1, 25 };
_vs->avg_frame_rate = AVRational{ 25, 1 };

AVCodecParameters *vpar = _vs->codecpar;
vpar->codec_id = fmt->video_codec;
vpar->codec_type = AVMEDIA_TYPE_VIDEO;
vpar->format = AV_PIX_FMT_YUV420P;
vpar->profile = FF_PROFILE_H264_HIGH;
vpar->level = _level;
vpar->width = _width;
vpar->height = _height;
vpar->bit_rate = _avg_bitrate;

avio_open(&_oc->pb, _oc->filename, AVIO_FLAG_WRITE);
avformat_write_header(_oc, nullptr);


    



    Width, height, bitrate, level and profile I get from NVENC encoder settings. I also do the error checking, ommited here. Then I have a loop writing each encoded packets, with IDR frames etc all prepared on the fly with NVENC. The loop body is :

    



    auto & pkt_data = _packets[i];
AVPacket pkt = { 0 };
av_init_packet(&pkt);
pkt.pts = av_rescale_q(_n_frames++, AVRational{ 1, 25 }, _vs->time_base);
pkt.duration = av_rescale_q(1, AVRational{ 1, 25 }, _vs->time_base);
pkt.dts = pkt.pts;
pkt.stream_index = _vs->index;
pkt.data = pkt_data.data();
pkt.size = (int)pkt_data.size();

if (!memcmp(pkt_data.data(), "\x00\x00\x00\x01\x67", 5))
{
    pkt.flags |= AV_PKT_FLAG_KEY;
}

av_write_frame(_oc, &pkt);


    



    Obviously ffmpeg is writing avcc code somewhere... I have no clue where to add this code so the RTMP server can recognize it. Or I am missing something else ?

    



    Any hint greatly appreciated, folks !

    


  • avfilter/vf_yadif_cuda : CUDA accelerated yadif deinterlacer

    21 octobre 2018, par Philip Langdale
    avfilter/vf_yadif_cuda : CUDA accelerated yadif deinterlacer
    

    This is a cuda implementation of yadif, which gives us a way to
    do deinterlacing when using the nvdec hwaccel. In that scenario
    we don't have access to the nvidia deinterlacer.

    • [DH] Changelog
    • [DH] configure
    • [DH] doc/filters.texi
    • [DH] libavfilter/Makefile
    • [DH] libavfilter/allfilters.c
    • [DH] libavfilter/version.h
    • [DH] libavfilter/vf_yadif_cuda.c
    • [DH] libavfilter/vf_yadif_cuda.cu