Recherche avancée

Médias (0)

Mot : - Tags -/configuration

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

Autres articles (31)

  • Modifier la date de publication

    21 juin 2013, par

    Comment changer la date de publication d’un média ?
    Il faut au préalable rajouter un champ "Date de publication" dans le masque de formulaire adéquat :
    Administrer > Configuration des masques de formulaires > Sélectionner "Un média"
    Dans la rubrique "Champs à ajouter, cocher "Date de publication "
    Cliquer en bas de la page sur Enregistrer

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

  • ffmpeg stream decoding - artefacts when not using ffplay

    18 décembre 2018, par Lucker10

    I stream a video capture via RTP using libx264. For now, I just stream to localhost.
    For watching the stream, I use the ffmpeg library. When I set the GOP size greater than 1 (only I frames), I get artefacts on the receiver side received image. The strange thing is, when I use ffplay, the image is perfect like original. What am I doing wrong ?

    Settings for encoding

    output_codec_ctx->bit_rate = 5000000;
    output_codec_ctx->width = 1920;
    output_codec_ctx->height = 1080;
    output_codec_ctx->time_base.den = 30; // frames per second
    output_codec_ctx->time_base.num = 1;
    output_codec_ctx->gop_size = 10; // gop size
    output_codec_ctx->max_b_frames = 0; // B frames
    output_codec_ctx->pix_fmt = AV_PIX_FMT_YUV420P; // output pixel format
    output_codec_ctx->codec_type = AVMEDIA_TYPE_VIDEO;

    av_opt_set(output_codec_ctx->priv_data, "preset", "ultrafast", 0);
    av_opt_set(output_codec_ctx->priv_data, "tune", "zerolatency", 0);

    Code for decoding

    AVFormatContext *pFormatCtx;
    AVCodecContext *input_codec_ctx;
    AVCode *pCodec;
    avdevice_register_all(); // for device
    avformat_network_init();
    pFormatCtx = avformat_alloc_context();
    input_codec_ctx = avcodec_alloc_context3(nullptr);
    AVDictionary *options = nullptr;
    av_dict_set(&options, "protocol_whitelist", "file,udp,rtp", 0);
    av_dict_set(&options, "fflags", "nobuffer",0);

    avformat_open_input(&pFormatCtx, "rtp://127.0.0.1:49990", nullptr, &options);

    avformat_find_stream_info(pFormatCtx, nullptr);
    for (uint i = 0; i < pFormatCtx->nb_streams; i++)
    {
      if (pFormatCtx->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO)
      {
        videoStream = static_cast<int>(i);
        break;
      }

    }

    av_read_play(pFormatCtx);    //play stream
    pCodec = avcodec_find_decoder(pFormatCtx->streams[videoStream]->codecpar->codec_id);
    AVCodecParameters *codec_param = pFormatCtx->streams[videoStream]->codecpar;
    avcodec_parameters_to_context(input_codec_ctx, codec_param);
    avcodec_open2(input_codec_ctx, pCodec, nullptr);

    AVPacket packet;
    AVPacket *pkt  = &amp;packet;
    AVFrame *frame;
    frame = av_frame_alloc();

    av_init_packet(pkt);
    pkt->data = nullptr;    // packet data will be allocated by the encoder
    pkt->size = 0;

    while(true){
       av_read_frame(pFormatCtx,pkt);
       avcodec_send_packet(input_codec_ctx,pkt);
       avcodec_receive_frame(input_codec_ctx,frame);
    }
    </int>

    Initialization and stuff omitted. Console output for custom decoding :

    NULL @ 0x1fb7b80] Opening 'stream.sdp' for reading
    [sdp @ 0x1fb7b80] Format sdp probed with size=2048 and score=50
    [sdp @ 0x1fb7b80] video codec set to: h264
    [sdp @ 0x1fb7b80] RTP Packetization Mode: 1
    [udp @ 0x1f34140] end receive buffer size reported is 131072
    [udp @ 0x1fb8e40] end receive buffer size reported is 131072
    [sdp @ 0x1fb7b80] setting jitter buffer size to 500

    Success !
    [sdp @ 0x1fb7b80] Before avformat_find_stream_info() pos: 181 bytes read:181 seeks:0 nb_streams:1
    [AVBSFContext @ 0x1fa5880] nal_unit_type: 7(SPS), nal_ref_idc: 3
    [AVBSFContext @ 0x1fa5880] nal_unit_type: 8(PPS), nal_ref_idc: 3
    [AVBSFContext @ 0x1fa5880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [AVBSFContext @ 0x1fa5880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [AVBSFContext @ 0x1fa5880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [AVBSFContext @ 0x1fa5880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [AVBSFContext @ 0x1fa5880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [AVBSFContext @ 0x1fa5880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [AVBSFContext @ 0x1fa5880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [AVBSFContext @ 0x1fa5880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 7(SPS), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 8(PPS), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] Format yuv420p chosen by get_format().
    [h264 @ 0x1fa51c0] Reinit context to 1920x1088, pix_fmt: yuv420p
    [sdp @ 0x1fb7b80] max delay reached. need to consume packet
    [sdp @ 0x1fb7b80] RTP: missed 57 packets
    [h264 @ 0x1fa51c0] nal_unit_type: 7(SPS), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 8(PPS), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] Invalid level prefix
    [h264 @ 0x1fa51c0] error while decoding MB 2 36
    [h264 @ 0x1fa51c0] concealing 3887 DC, 3887 AC, 3887 MV errors in I frame
    [h264 @ 0x1fa51c0] nal_unit_type: 7(SPS), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 8(PPS), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 7(SPS), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 8(PPS), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 7(SPS), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 8(PPS), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [sdp @ 0x1fb7b80] max delay reached. need to consume packet
    [sdp @ 0x1fb7b80] RTP: missed 155 packets
    [h264 @ 0x1fa51c0] nal_unit_type: 7(SPS), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 8(PPS), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] corrupted macroblock 32 41 (total_coeff=-1)
    [h264 @ 0x1fa51c0] error while decoding MB 32 41
    [h264 @ 0x1fa51c0] concealing 3257 DC, 3257 AC, 3257 MV errors in I frame
    [h264 @ 0x1fa51c0] nal_unit_type: 7(SPS), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 8(PPS), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [sdp @ 0x1fb7b80] max delay reached. need to consume packet
    [sdp @ 0x1fb7b80] RTP: missed 52 packets
    [sdp @ 0x1fb7b80] max delay reached. need to consume packet
    [sdp @ 0x1fb7b80] RTP: missed 51 packets
    [sdp @ 0x1fb7b80] max delay reached. need to consume packet
    [sdp @ 0x1fb7b80] RTP: missed 10 packets
    [sdp @ 0x1fb7b80] max delay reached. need to consume packet
    [sdp @ 0x1fb7b80] RTP: missed 50 packets
    [sdp @ 0x1fb7b80] max delay reached. need to consume packet
    [sdp @ 0x1fb7b80] RTP: missed 52 packets
    [sdp @ 0x1fb7b80] All info found
    [sdp @ 0x1fb7b80] After avformat_find_stream_info() pos: 181 bytes read:181 seeks:0 frames:28
    found video stream

    The number of elements in stream is  1

    [h264 @ 0x1ee3880] nal_unit_type: 7(SPS), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 8(PPS), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 7(SPS), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 8(PPS), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] Format yuv420p chosen by get_format().
    [h264 @ 0x1ee3880] Reinit context to 1920x1088, pix_fmt: yuv420p
    [h264 @ 0x1ee3880] nal_unit_type: 7(SPS), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 8(PPS), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [sdp @ 0x1fb7b80] max delay reached. need to consume packet
    [sdp @ 0x1fb7b80] RTP: missed 256 packets
    [h264 @ 0x1ee3880] nal_unit_type: 7(SPS), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 8(PPS), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] Invalid level prefix
    [h264 @ 0x1ee3880] error while decoding MB 119 41
    [h264 @ 0x1ee3880] concealing 3170 DC, 3170 AC, 3170 MV errors in I frame
    [h264 @ 0x1ee3880] nal_unit_type: 7(SPS), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 8(PPS), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 7(SPS), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 8(PPS), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [sdp @ 0x1fb7b80] max delay reached. need to consume packet
    [sdp @ 0x1fb7b80] RTP: missed 5 packets
    [sdp @ 0x1fb7b80] max delay reached. need to consume packet
    [sdp @ 0x1fb7b80] RTP: missed 4 packets
    [h264 @ 0x1ee3880] nal_unit_type: 7(SPS), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 8(PPS), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] out of range intra chroma pred mode
    [h264 @ 0x1ee3880] error while decoding MB 100 56
    [h264 @ 0x1ee3880] corrupted macroblock 84 65 (total_coeff=-1)
    [h264 @ 0x1ee3880] error while decoding MB 84 65
    [h264 @ 0x1ee3880] concealing 754 DC, 754 AC, 754 MV errors in I frame
    [sdp @ 0x1fb7b80] max delay reached. need to consume packet
    [sdp @ 0x1fb7b80] RTP: missed 160 packets
    [h264 @ 0x1ee3880] nal_unit_type: 7(SPS), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 8(PPS), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] corrupted macroblock 17 36 (total_coeff=-1)
    [h264 @ 0x1ee3880] error while decoding MB 17 36
    [h264 @ 0x1ee3880] concealing 3872 DC, 3872 AC, 3872 MV errors in I frame
    [h264 @ 0x1ee3880] nal_unit_type: 7(SPS), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 8(PPS), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 7(SPS), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 8(PPS), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [sdp @ 0x1fb7b80] max delay reached. need to consume packet
    [sdp @ 0x1fb7b80] RTP: missed 53 packets
    [h264 @ 0x1ee3880] nal_unit_type: 7(SPS), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 8(PPS), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] corrupted macroblock 62 39 (total_coeff=-1)
    [h264 @ 0x1ee3880] error while decoding MB 62 39
    [h264 @ 0x1ee3880] concealing 3467 DC, 3467 AC, 3467 MV errors in I frame
  • Mixed audio and video HLS

    26 décembre 2018, par Andrey Pogorelov

    There is video (without audio) and audio in a separate file. It is necessary to connect this video and audio to a stream and give it to the user in the form of an HLS stream or something else. Something like YouTube, there is video in 1080 quality - without audio mixed with audio track. Video and audio do not need to transcode, just mixed, so that the processor doesnt be used. Maybe you can do something like regular nginx tools ?

  • How can I read all the data from a pipe and prevent it from closing ?

    23 septembre 2014, par slhck

    I’m trying to read raw YUV data from a compressed file using ffmpeg and pipes with Python.
    The ffmpeg command correctly spits out frames as raw YUV data, and I’m reading it like this :

    def read_from_pipe(pipe, amount):
       raw = pipe.stdout.read(amount)
       pipe.stdout.flush()
       return raw

    pipe_ref = subprocess.Popen('ffmpeg -i "' + input + '" -r 30 -c:v rawvideo -pix_fmt yuv420p -an -f rawvideo -t 5 -',
     shell = True,
     stdout = subprocess.PIPE,
     bufsize=1920*1080*3*2)

    frame_num = 0
    while True:
       data = read_from_pipe(pipe_ref, width*height*3)

       # no more data
       if (len(data) != width*height*3))
           return results

       image = extract_image_data(data, width, height)
       # do something with image, put it into "results" and print frame / SSIM values to console
       frame_num += 1

    The problem is, as soon as ffmpeg is done converting all frames, my program stops. Since the program is a little slower than ffmpeg, it will stop receiving data and exit.

    Basically, for example, I can only work up to frame 30, then ffmpeg finishes at frame 60, and my program also exits. The command line output would say :

    Frame=25 SSIM=0.990472732391
    Frame=26 SSIM=0.98359411819
    Frame=27 SSIM=0.981074433586
    Frame=28 SSIM=0.97850843075
    frame=   60 fps= 27 q=0.0 Lsize=  182250kB time=00:00:02.00 bitrate=746496.0kbits/s dup=12 drop=0    
    video:182250kB audio:0kB subtitle:0 data:0 global headers:0kB muxing overhead 0.000000%
    Frame=29 SSIM=0.977698849804
    frame=   60 fps= 27 q=0.0 Lsize=  182250kB time=00:00:02.00 bitrate=746496.0kbits/s dup=12 drop=0    
    video:182250kB audio:0kB subtitle:0 data:0 global headers:0kB muxing overhead 0.000000%

    How can I get it to work on all frames that are output by ffmpeg ? Or is there any other easier way of obtaining the raw YUV data from any file if not through a pipe ? (I need it to work concurrently)