Recherche avancée

Médias (1)

Mot : - Tags -/école

Autres articles (67)

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

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

  • Création définitive du canal

    12 mars 2010, par

    Lorsque votre demande est validée, vous pouvez alors procéder à la création proprement dite du canal. Chaque canal est un site à part entière placé sous votre responsabilité. Les administrateurs de la plateforme n’y ont aucun accès.
    A la validation, vous recevez un email vous invitant donc à créer votre canal.
    Pour ce faire il vous suffit de vous rendre à son adresse, dans notre exemple "http://votre_sous_domaine.mediaspip.net".
    A ce moment là un mot de passe vous est demandé, il vous suffit d’y (...)

Sur d’autres sites (7653)

  • Decode video with CUDA nccuvid and ffmpeg [closed]

    25 avril 2013, par Oleksandr Kyrpa

    *strong text*I starting to implement custum video decoder that utilize cuda HW decoder to generate YUV frame for next to encode it.

    How can I fill "CUVIDPICPARAMS" struc ???
    Is it possible ?

    My algorithm are :

    For get video stream packet I'm use ffmpeg-dev libs avcodec, avformat...

    My steps :

    1) Open input file :

    avformat_open_input(&ff_formatContext,in_filename,nullptr,nullptr);

    2) Get video stream property's :

    avformat_find_stream_info(ff_formatContext,nullptr);

    3) Get video stream :

    ff_video_stream=ff_formatContext->streams[i];

    4) Get CUDA device and init it :

    cuDeviceGet(&cu_device,0);
    CUcontext cu_vid_ctx;

    5) Init video CUDA decoder and set create params :

    CUVIDDECODECREATEINFO *cu_decoder_info=new CUVIDDECODECREATEINFO;
    memset(cu_decoder_info,0,sizeof(CUVIDDECODECREATEINFO));
    ...
    cuvidCreateDecoder(cu_video_decoder,cu_decoder_info);

    6)Read frame data to AVpacket

    av_read_frame(ff_formatContext,ff_packet);

    AND NOW I NEED decode frame packet on CUDA video decoder, in theoretical are :

    cuvidDecodePicture(pDecoder,&picParams);

    BUT before I need fill CUVIDPICPARAMS

    CUVIDPICPARAMS picParams ;//=new CUVIDPICPARAMS ;
    memset(&picParams, 0, sizeof(CUVIDPICPARAMS)) ;

    HOW CAN I FILL "CUVIDPICPARAMS" struc ???

    typedef struct _CUVIDPICPARAMS
    {
       int PicWidthInMbs;      // Coded Frame Size
       int FrameHeightInMbs;   // Coded Frame Height
       int CurrPicIdx;         // Output index of the current picture
       int field_pic_flag;     // 0=frame picture, 1=field picture
       int bottom_field_flag;  // 0=top field, 1=bottom field (ignored if field_pic_flag=0)
       int second_field;       // Second field of a complementary field pair
       // Bitstream data
       unsigned int nBitstreamDataLen;        // Number of bytes in bitstream data buffer
       const unsigned char *pBitstreamData;   // Ptr to bitstream data for this picture (slice-layer)
       unsigned int nNumSlices;               // Number of slices in this picture
       const unsigned int *pSliceDataOffsets; // nNumSlices entries, contains offset of each slice within the bitstream data buffer
       int ref_pic_flag;       // This picture is a reference picture
       int intra_pic_flag;     // This picture is entirely intra coded
       unsigned int Reserved[30];             // Reserved for future use
       // Codec-specific data
       union {
           CUVIDMPEG2PICPARAMS mpeg2;          // Also used for MPEG-1
           CUVIDH264PICPARAMS h264;
           CUVIDVC1PICPARAMS vc1;
           CUVIDMPEG4PICPARAMS mpeg4;
           CUVIDJPEGPICPARAMS jpeg;
           unsigned int CodecReserved[1024];
       } CodecSpecific;
    } CUVIDPICPARAMS;

    typedef struct _CUVIDH264PICPARAMS
    {
       // SPS
       int log2_max_frame_num_minus4;
       int pic_order_cnt_type;
       int log2_max_pic_order_cnt_lsb_minus4;
       int delta_pic_order_always_zero_flag;
       int frame_mbs_only_flag;
       int direct_8x8_inference_flag;
       int num_ref_frames;             // NOTE: shall meet level 4.1 restrictions
       unsigned char residual_colour_transform_flag;
       unsigned char bit_depth_luma_minus8;    // Must be 0 (only 8-bit supported)
       unsigned char bit_depth_chroma_minus8;  // Must be 0 (only 8-bit supported)
       unsigned char qpprime_y_zero_transform_bypass_flag;
       // PPS
       int entropy_coding_mode_flag;
       int pic_order_present_flag;
       int num_ref_idx_l0_active_minus1;
       int num_ref_idx_l1_active_minus1;
       int weighted_pred_flag;
       int weighted_bipred_idc;
       int pic_init_qp_minus26;
       int deblocking_filter_control_present_flag;
       int redundant_pic_cnt_present_flag;
       int transform_8x8_mode_flag;
       int MbaffFrameFlag;
       int constrained_intra_pred_flag;
       int chroma_qp_index_offset;
       int second_chroma_qp_index_offset;
       int ref_pic_flag;
       int frame_num;
       int CurrFieldOrderCnt[2];
       // DPB
       CUVIDH264DPBENTRY dpb[16];          // List of reference frames within the DPB
       // Quantization Matrices (raster-order)
       unsigned char WeightScale4x4[6][16];
       unsigned char WeightScale8x8[2][64];
       // FMO/ASO
       unsigned char fmo_aso_enable;
       unsigned char num_slice_groups_minus1;
       unsigned char slice_group_map_type;
       signed char pic_init_qs_minus26;
       unsigned int slice_group_change_rate_minus1;
       union
       {
           unsigned long long slice_group_map_addr;
           const unsigned char *pMb2SliceGroupMap;
       } fmo;
       unsigned int  Reserved[12];
       // SVC/MVC
       union
       {
           CUVIDH264MVCEXT mvcext;
           CUVIDH264SVCEXT svcext;
       };
    } CUVIDH264PICPARAMS;

    How can I fill "CUVIDPICPARAMS" struc ???
    Is it possible ?

  • ffmpeg : transmission problems / artifacts in rtsp screen grab - might be a WiFi problem

    1er décembre 2022, par Jo Kerner

    In short : Is there a way to "force" ffmpeg to not save a grabbed frame if there are transmission problems ? Or any other software that does the same and I just don't know of ?

    


    Long story :

    


    Updating my house surveillance from almost 10 years old DCS-932L cameras to Tapo C100 Cameras, I changed the image delivery method from ftp push to rtsp grab via ffmpeg.

    


    I had written a program in C++ to check for "bad" pictures from the old cameras, where parts of the picture tended to be simply black once every minute or so (I'm grabbing a pic every 2 seconds). The Tapo C100 doesn't feature ftp-push, thus I tried (after a few days trying)

    


    ffmpeg.exe -y -i rtsp://user:pass@10.0.0.%ld:554/stream1 -vframes 1 %scamera\rtsp.jpg -loglevel quiet


    


    This works absolutely perfect in my main house, which features a Fritz !Box 7590 and a set of Fritz !Powerline (510/and two 540e) repeaters, plus one WiFi repeater Fritz 600) as my phone line and the router are in the basement.

    


    In my holiday home, though, it doesn't. The Wifi is managed by a Hybrid DSL/5G - box I have no alternative to, which is a Huawei DN9245W and works as DHCP Server, because this is almost impossible to change. Everything "real" is managed by another Fritz !Box 7590, connected via ethernet, and another set of Fritz !Powerline 510 and two 540e repeaters plus half a dozen Wifi Repeaters, mostly Fritz ! 310, 450E and 600. The house was partially built with local stones, which are very iron-y, and there's a lot of metallized glass. Full set is show in Image

    


    Now, this does produce different artifacts, about two per minute or in every 15th picture, see
Image with artifacts No. 1

    


    Thinking this might be a transmission problem, I tried forcing the streamgrab via TCP, because while rtsp doesn't have error correction, TCP does :

    


    ffmpeg.exe -rtsp_transport tcp -i
rtsp://user:pass@10.0.0.%ld:554/stream1 -y -f image2 -update 1 -r
1 -vframes 1 -qscale:v 30 %scamera\rtsp.jpg -loglevel quiet


    


    Which didn't change the artifacts much, see Image with artifacts No. 2

    


    The house now has a total of 12 Cameras, six of which are each "managed" by an older Dell Optiplex Desktop bought used off ebay with an i3 or i5 processor from about 2015, which goes to about 65% load. My software will check if the grabbed picture is finished saving (to RAMdisk), rename it, check if there are artifacts, if so, drop it, if not, convert to bitmap and then compare it to previous image, guess if there's a change, mark that change with a rhombus and rate it, save that as a jpeg file, and then some other stuff that's not relevant here. See : Image of my program running with six cameras

    


    I did try grabbing keyframes only, but a bunny or deer or burglar hopping through my property doesn't produce a keyframe, so that turned out to be missing the point.

    


    I'm out of ideas here. It does work flawlessly in the main house. It doesn't in the holiday house. I can hardly install more repeaters ; I already tried mesh and not-mesh, and the problem isn't exactly wifi overload, because even with just one camera running, it still persists. In certain places. Some have no problems. Reasons ? No clue. I really hope someone has a good idea.

    


  • C++ FFMPEG remuxing RTSP stream to mp4 video

    12 août 2017, par hung

    I try to use ffmpeg remuxing.c example to save RTSP stream from my IP camera to a mp4 video. But I just receive an one frame video. It returns an error message

    [mp4 @ 0x18de4e0] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 37206 >= 7202

    I check the property of output video and see that information (dimension, codec, framerate, bitrate) is fine.I think the problem is because of pts and dts. But I don’t know how to correct. Please help me.
    Here’s my code :

    extern "C" {
    #include <libavcodec></libavcodec>avcodec.h>
    #include <libavformat></libavformat>avio.h>
    #include <libavformat></libavformat>avformat.h>
    #include <libavutil></libavutil>timestamp.h>
    }

    int main(int argc, char **argv)
    {
    AVOutputFormat *ofmt = NULL;
    AVFormatContext *ifmt_ctx = NULL, *ofmt_ctx = NULL;
    AVPacket pkt;
    const char *in_filename, *out_filename;
    int ret, i;
    if (argc &lt; 3) {
       printf("usage: %s input output\n"
              "API example program to remux a media file with libavformat and libavcodec.\n"
              "The output format is guessed according to the file extension.\n"
              "\n", argv[0]);
       return 1;
    }
    in_filename  = argv[1];
    out_filename = argv[2];

    av_register_all();
    avformat_network_init();

    if ((ret = avformat_open_input(&amp;ifmt_ctx, in_filename, 0, 0)) &lt; 0) {
       fprintf(stderr, "Could not open input file '%s'", in_filename);
       goto end;
    }
    if ((ret = avformat_find_stream_info(ifmt_ctx, 0)) &lt; 0) {
       fprintf(stderr, "Failed to retrieve input stream information");
       goto end;
    }
    av_dump_format(ifmt_ctx, 0, in_filename, 0);


    avformat_alloc_output_context2(&amp;ofmt_ctx, NULL, NULL, out_filename);
    if (!ofmt_ctx) {
       fprintf(stderr, "Could not create output context\n");
       ret = AVERROR_UNKNOWN;
       goto end;
    }
    ofmt = ofmt_ctx->oformat;
    for (i = 0; i &lt; ifmt_ctx->nb_streams; i++) {
       AVStream *in_stream = ifmt_ctx->streams[i];
       AVStream *out_stream = avformat_new_stream(ofmt_ctx, in_stream->codec->codec);
       if (!out_stream) {
           fprintf(stderr, "Failed allocating output stream\n");
           ret = AVERROR_UNKNOWN;
           goto end;
       }
       ret = avcodec_copy_context(out_stream->codec, in_stream->codec);
       if (ret &lt; 0) {
           fprintf(stderr, "Failed to copy context from input to output stream codec context\n");
           goto end;
       }
       out_stream->codec->codec_tag = 0;
       if (ofmt_ctx->oformat->flags &amp; AVFMT_GLOBALHEADER)
           out_stream->codec->flags |= CODEC_FLAG_GLOBAL_HEADER;
    }
    av_dump_format(ofmt_ctx, 0, out_filename, 1);

    if (!(ofmt->flags &amp; AVFMT_NOFILE)) {
       ret = avio_open(&amp;ofmt_ctx->pb, out_filename, AVIO_FLAG_WRITE);
       if (ret &lt; 0) {
           fprintf(stderr, "Could not open output file '%s'", out_filename);
           goto end;
       }
    }
    ret = avformat_write_header(ofmt_ctx, NULL);
    if (ret &lt; 0) {
       fprintf(stderr, "Error occurred when opening output file\n");
       goto end;
    }
    while (1) {
       AVStream *in_stream, *out_stream;
       ret = av_read_frame(ifmt_ctx, &amp;pkt);
       if (ret &lt; 0)
           break;
       in_stream  = ifmt_ctx->streams[pkt.stream_index];
       out_stream = ofmt_ctx->streams[pkt.stream_index];

       /* copy packet */
       //pkt.pts = av_rescale_q_rnd(pkt.pts, in_stream->time_base, out_stream->time_base, (AVRounding)(AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX));
       //pkt.dts = av_rescale_q_rnd(pkt.dts, in_stream->time_base, out_stream->time_base, (AVRounding)(AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX));
       //pkt.duration = av_rescale_q(pkt.duration, in_stream->time_base, out_stream->time_base);
       pkt.dts += av_rescale_q(1, in_stream->codec->time_base, out_stream->codec->time_base);
       pkt.pts += av_rescale_q(1, in_stream->codec->time_base, out_stream->codec->time_base);
       pkt.duration += av_rescale_q(pkt.duration, in_stream->codec->time_base, out_stream->codec->time_base);

       pkt.pos = -1;

       ret = av_interleaved_write_frame(ofmt_ctx, &amp;pkt);
       if (ret &lt; 0) {
           fprintf(stderr, "Error muxing packet\n");
           break;
       }
       av_free_packet(&amp;pkt);
    }
    av_write_trailer(ofmt_ctx);
    end:
    avformat_close_input(&amp;ifmt_ctx);
    /* close output */
    if (ofmt_ctx &amp;&amp; !(ofmt->flags &amp; AVFMT_NOFILE))
       avio_close(ofmt_ctx->pb);
    avformat_free_context(ofmt_ctx);
    if (ret &lt; 0 &amp;&amp; ret != AVERROR_EOF) {
       fprintf(stderr, "Error occurred\n");
       return 1;
    }
    return 0;
    }

    If I check with a video file instead of RTSP link, the code work fine.

    How I run it :

    ./ffmpeg_stream rtsp://admin:centic.vn@10.49.34.234/Streaming/Channels/1?tcp video.mp4