[Libav-user] 答复: Is the max fps of gdigrab to grab desktop only 15 frame/s??

Maminxuan maminxuan at h3c.com
Fri Nov 25 03:19:05 EET 2016


Hi,
         Add more information, the video_zise is 1920x1080.
If I reduced it to 640x480, the fps was increased to 40.

Best wish
Jack

发件人: maminxuan 12126 (CCPL)
发送时间: 2016年11月24日 20:40
收件人: 'libav-user at ffmpeg.org'
主题: Is the max fps of gdigrab to grab desktop only 15 frame/s??

Hi,
         I used gdigrab to grab desktop. I set the framerate to 30, but, actually, the framerate was only 15 in my test. Why?
         Here is the options of my desktop:
         [cid:image001.png at 01D246FC.F82E6A20]

         Here is my code:
         ……
         av_dict_set(&options,"framerate","30",0);
    AVInputFormat *ifmt = av_find_input_format("gdigrab");
    if (avformat_open_input(&fct, "desktop", ifmt, &options) != 0){
        printf("Couldn't open input stream\n");
        return -1;
    }
    ……
    while(av_read_frame(vs->in_fct, packet)>=0)
    {
        icount++;
        finish = clock();
        duration = (double)(finish - start) / CLOCKS_PER_SEC;
        printf("%f seconds, count: %d\n", duration, icount);
        start = clock();
        av_free_packet(packet);
    }

    Here is the result:
[cid:image002.png at 01D246FC.F82E6A20]
         From the result, we can see, the average time was 60ms to get one picture. Why was it so slow? Were there any options about it to increase the fps?
         Thank you and look forward for your mail.


Best wish
Jack

-------------------------------------------------------------------------------------------------------------------------------------
本邮件及其附件含有杭州华三通信技术有限公司的保密信息,仅限于发送给上面地址中列出
的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制、
或散发)本邮件中的信息。如果您错收了本邮件,请您立即电话或邮件通知发件人并删除本
邮件!
This e-mail and its attachments contain confidential information from H3C, which is
intended only for the person or entity whose address is listed above. Any use of the
information contained herein in any way (including, but not limited to, total or partial
disclosure, reproduction, or dissemination) by persons other than the intended
recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender
by phone or email immediately and delete it!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20161125/81fa3733/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 17774 bytes
Desc: image001.png
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20161125/81fa3733/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 139565 bytes
Desc: image002.png
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20161125/81fa3733/attachment-0001.png>


More information about the Libav-user mailing list