[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

         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:
    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)
        finish = clock();
        duration = (double)(finish - start) / CLOCKS_PER_SEC;
        printf("%f seconds, count: %d\n", duration, icount);
        start = clock();

    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

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