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

Maminxuan maminxuan at h3c.com
Thu Nov 24 14:39:57 EET 2016


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 01D24692.EAF99380]

         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 01D24692.EAF99380]
         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/20161124/51b93bc5/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/20161124/51b93bc5/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/20161124/51b93bc5/attachment-0001.png>


More information about the Libav-user mailing list