#3192(undetermined:new): Dropped Frames With Overlay Filter
#3192: Dropped Frames With Overlay Filter -------------------------------------+------------------------------------- Reporter: ian_m | Type: defect Status: new | Priority: normal Component: | Version: git- undetermined | master Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- Using the overlay filter to overlay video from a webcam onto x11grab causes many dropped frames. The frames seem to come in short bursts followed by a large number of dropped frames. This is easily seen by inserting showinfo into the x11grab stream before it is sent to the overlay filter. The attached file shows this behaviour. If the overlay filter isn't used, the frames appear to have approximately the correct timestamps as shown in the second attachment. -- Ticket URL: <https://trac.ffmpeg.org/ticket/3192> FFmpeg <http://ffmpeg.org> FFmpeg issue tracker
#3192: Dropped Frames With Overlay Filter -------------------------------------+------------------------------------- Reporter: ian_m | Owner: Type: defect | Status: new Priority: normal | Component: Version: git-master | undetermined Keywords: | Resolution: Blocking: | Blocked By: Analyzed by developer: 0 | Reproduced by developer: 0 -------------------------------------+------------------------------------- Comment (by cehoyos): What happens if you significantly decrease the x11grab resolution (640x480 or 400x200)? -- Ticket URL: <https://trac.ffmpeg.org/ticket/3192#comment:1> FFmpeg <http://ffmpeg.org> FFmpeg issue tracker
#3192: Dropped Frames With Overlay Filter -------------------------------------+------------------------------------- Reporter: ian_m | Owner: Type: defect | Status: new Priority: normal | Component: Version: git-master | undetermined Keywords: | Resolution: Blocking: | Blocked By: Analyzed by developer: 0 | Reproduced by developer: 0 -------------------------------------+------------------------------------- Comment (by ian_m): I get the same behavior, even at 400x200. -- Ticket URL: <https://trac.ffmpeg.org/ticket/3192#comment:2> FFmpeg <http://ffmpeg.org> FFmpeg issue tracker
#3192: Dropped Frames With Overlay Filter -------------------------------------+------------------------------------- Reporter: ian_m | Owner: Type: defect | Status: new Priority: normal | Component: Version: git-master | undetermined Keywords: | Resolution: Blocking: | Blocked By: Analyzed by developer: 0 | Reproduced by developer: 0 -------------------------------------+------------------------------------- Comment (by ubitux): Wouldn't that be related to the nanosleep hack used to sync with the framerate? -- Ticket URL: <https://trac.ffmpeg.org/ticket/3192#comment:3> FFmpeg <http://ffmpeg.org> FFmpeg issue tracker
#3192: Dropped Frames With Overlay Filter -------------------------------------+------------------------------------- Reporter: ian_m | Owner: Type: defect | Status: new Priority: normal | Component: Version: git-master | undetermined Keywords: | Resolution: Blocking: | Blocked By: Analyzed by developer: 0 | Reproduced by developer: 0 -------------------------------------+------------------------------------- Comment (by ian_m): I wrote the attached patch to make x11grab respect AVFMT_FLAGS_NONBLOCK but it didn't seem to fix the issue. -- Ticket URL: <https://trac.ffmpeg.org/ticket/3192#comment:4> FFmpeg <http://ffmpeg.org> FFmpeg issue tracker
#3192: Dropped Frames With Overlay Filter -------------------------------------+------------------------------------- Reporter: ian_m | Owner: Type: defect | Status: new Priority: normal | Component: Version: git-master | undetermined Keywords: | Resolution: Blocking: | Blocked By: Analyzed by developer: 0 | Reproduced by developer: 0 -------------------------------------+------------------------------------- Comment (by cehoyos): Is the problem also reproducible if you replace {{{-f x11grab -video_size 1680x1050 -framerate 30 -i :0.0}}} in your command line with {{{-f lavfi -i testsrc=s=1680x1050:r=30}}}? The following works fine here: {{{ $ ffmpeg -f x11grab -s 1920x1200 -i :0 -f v4l2 -s 320x176 -i /dev/video1 -filter_complex overlay -qscale 2 out.avi }}} -- Ticket URL: <https://trac.ffmpeg.org/ticket/3192#comment:5> FFmpeg <http://ffmpeg.org> FFmpeg issue tracker
#3192: Dropped Frames With Overlay Filter -------------------------------------+------------------------------------- Reporter: ian_m | Owner: Type: defect | Status: new Priority: normal | Component: Version: git-master | undetermined Keywords: | Resolution: Blocking: | Blocked By: Analyzed by developer: 0 | Reproduced by developer: 0 -------------------------------------+------------------------------------- Comment (by ian_m): No, if I use the testsrc instead of x11grab it seems to work. -- Ticket URL: <https://trac.ffmpeg.org/ticket/3192#comment:6> FFmpeg <http://ffmpeg.org> FFmpeg issue tracker
#3192: Dropped Frames With Overlay Filter -------------------------------------+------------------------------------- Reporter: ian_m | Owner: Type: defect | Status: new Priority: normal | Component: Version: git-master | undetermined Keywords: | Resolution: Blocking: | Blocked By: Analyzed by developer: 0 | Reproduced by developer: 0 -------------------------------------+------------------------------------- Comment (by cehoyos):
frame= 551 fps= 22 q=-1.0 Lsize= 3615kB time=00:00:24.63 bitrate=1202.2kbits/s
As pointed out on the mailing list, this indicates the problem is also reproducible without overlay: Your system does not reach the requested frame rate. Try with overlay and a framerate of ~15. -- Ticket URL: <https://trac.ffmpeg.org/ticket/3192#comment:7> FFmpeg <http://ffmpeg.org> FFmpeg issue tracker
#3192: Dropped Frames With Overlay Filter -------------------------------------+------------------------------------- Reporter: ian_m | Owner: Type: defect | Status: new Priority: normal | Component: Version: git-master | undetermined Keywords: | Resolution: Blocking: | Blocked By: Analyzed by developer: 0 | Reproduced by developer: 0 -------------------------------------+------------------------------------- Comment (by ian_m): Lowering the framerate does not seem to help. It seems that in the nonoverlay version, it takes a second or so for everything to initialize so the framerate x264 sees starts low and converges towards 30. In the overlay version the framerate is stuck at around 5-6 fps. -- Ticket URL: <https://trac.ffmpeg.org/ticket/3192#comment:8> FFmpeg <http://ffmpeg.org> FFmpeg issue tracker
#3192: Dropped Frames With Overlay Filter -------------------------------------+------------------------------------- Reporter: ian_m | Owner: Type: defect | Status: new Priority: normal | Component: Version: git-master | undetermined Keywords: x11grab | Resolution: Blocking: | Blocked By: Analyzed by developer: 0 | Reproduced by developer: 0 -------------------------------------+------------------------------------- Changes (by cehoyos): * keywords: => x11grab -- Ticket URL: <https://trac.ffmpeg.org/ticket/3192#comment:9> FFmpeg <http://ffmpeg.org> FFmpeg issue tracker
#3192: Dropped Frames With Overlay Filter -------------------------------------+------------------------------------- Reporter: ian_m | Owner: Type: defect | Status: new Priority: normal | Component: Version: git-master | undetermined Keywords: x11grab | Resolution: Blocking: | Blocked By: Analyzed by developer: 0 | Reproduced by developer: 0 -------------------------------------+------------------------------------- Comment (by jnvsor): Switching the input order is a workaround {{{ ffmpeg \ -f x11grab -framerate 30 -s hd1080 -i :0.0 \ -f v4l2 -framerate 30 -i /dev/video0 \ -filter_complex '[0][1]overlay=x=300:y=300[cap]' \ -map '[cap]' \ -c:v libx264 -pix_fmt yuv444p -preset ultrafast -qp 0 \ -threads 2 -y out.avi # frame= 225 fps= 18 q=-1.0 Lsize= 36782kB time=00:00:12.56 bitrate=23977.3kbits/s dup=0 drop=74 }}} Switch the input order and switch it on the overlay filter again: {{{ ffmpeg \ -f v4l2 -framerate 30 -i /dev/video0 \ -f x11grab -framerate 30 -s hd1080 -i :0.0 \ -filter_complex '[1][0]overlay=x=300:y=300[cap]' \ -map '[cap]' \ -c:v libx264 -pix_fmt yuv444p -preset ultrafast -qp 0 \ -threads 2 -y out.avi # frame= 208 fps= 30 q=-1.0 Lsize= 25993kB time=00:00:06.93 bitrate=30711.3kbits/s }}} -- Ticket URL: <https://trac.ffmpeg.org/ticket/3192#comment:10> FFmpeg <http://ffmpeg.org> FFmpeg issue tracker
participants (1)
-
FFmpeg