[libav-bugs] [Bug 574] New: Missed frames using x11grab are not handled correctly

bugzilla at libav.org bugzilla at libav.org
Fri Oct 11 20:41:50 CEST 2013


https://bugzilla.libav.org/show_bug.cgi?id=574

           Summary: Missed frames using x11grab are not handled correctly
           Product: Libav
           Version: git HEAD
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: Normal
         Component: libavfilter
        AssignedTo: bugzilla at libav.org
        ReportedBy: levi.cameron+libav at alliancesoftware.com.au


Created attachment 434
  --> https://bugzilla.libav.org/attachment.cgi?id=434
Debug output

If x11grab misses any frames, it does not make them up with duplicated frames
like it used to. Specifically, it appears that time spent blocked on system
calls is 'lost' causing the framerate to drop below the target framerate (it
may be concidence but it seems to only count time at a 50% rate).

This may also be the cause of https://bugzilla.libav.org/show_bug.cgi?id=568 --
over time it will start to drift.


Reproduce:

In terminal 1:
./avconv -an -loglevel debug -f x11grab -s 720x576 -r 25 -i :0 -vsync 1 -f
rawvideo -pix_fmt yuv420p -r 25 - 2>out.txt | wc -c

At the same time in terminal 2:
A=10 ; B=30 ; C=10 ; echo sleeping $A ; sleep $A ; echo slept $A, now pausing ;
killall -SIGSTOP wc ; echo sleeping $B ; sleep $B ; echo slept $B now resuming
; killall -SIGCONT wc ; echo sleeping $C ; sleep $C ; echo killing avconv ;
killall avconv

ie sleep for 10 seconds, then cause avconv to block for 30 seconds, then
restart avconv for 10 seconds. A similar thing happens if you use
SIGSTOP/SIGCONT on the ffmpeg process directly but the wc -c acts as a second
check on how much data was actually output.


Relevant parts of output: (full output is attached)

frame=   13 fps=  0 q=0.0 size=    7898kB time=0.52 bitrate=124416.0kbits/s
frame=   26 fps= 25 q=0.0 size=   15795kB time=1.04 bitrate=124416.0kbits/s
...
frame=  247 fps= 25 q=0.0 size=  150052kB time=9.88 bitrate=124416.0kbits/s
frame=  260 fps= 25 q=0.0 size=  157950kB time=10.40 bitrate=124416.0kbits/s

(pause happens here)

frame=  268 fps=  7 q=0.0 size=  162810kB time=10.72 bitrate=124416.0kbits/s
frame=  427 fps= 10 q=0.0 size=  259402kB time=17.08 bitrate=124416.0kbits/s
..
frame=  874 fps= 17 q=0.0 size=  530955kB time=34.96 bitrate=124416.0kbits/s
frame=  878 fps= 17 q=0.0 Lsize=  533385kB time=35.12 bitrate=124416.0kbits/s


Notice that the time in the stream is just over 35 seconds (10 + 50%*30 + 10)
whereas it should in fact be just over 10 + 30 + 30 = 50. 



Prior to commit c9cc76290f8139a012a12efe7e581276b8bd8dff the missing time is
made up for correctly with duplicate frames. That commit activated the setpts
filter.

-- 
Configure bugmail: https://bugzilla.libav.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.


More information about the libav-bugs mailing list