[FFmpeg-trac] #8377(undetermined:new): Using kmsgrab + h264_vaapi with audio causes stutter

FFmpeg trac at avcodec.org
Mon Nov 11 18:26:43 EET 2019

#8377: Using kmsgrab + h264_vaapi with audio causes stutter
             Reporter:  asineth      |                     Type:  defect
               Status:  new          |                 Priority:  normal
            Component:               |                  Version:
  undetermined                       |  unspecified
             Keywords:               |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
 Whenever I use kmsgrab + vaapi to record my desktop with ffmpeg and I
 include audio (I've tested this with both -f pulse and -f alsa) it causes
 the video to become stuttery. I included commands, ffmpeg logs, and the
 videos to compare.

 Distro: Archlinux x86_64

 Here's my vainfo:
 vainfo: VA-API version: 1.5 (libva 2.5.0)
 vainfo: Driver version: Mesa Gallium driver 19.2.3 for AMD Radeon (TM) RX
 470 Graphics (POLARIS10, DRM 3.33.0, 5.3.8-arch1-1, LLVM 9.0.0)
 vainfo: Supported profile and entrypoints
       VAProfileMPEG2Simple            : VAEntrypointVLD
       VAProfileMPEG2Main              : VAEntrypointVLD
       VAProfileVC1Simple              : VAEntrypointVLD
       VAProfileVC1Main                : VAEntrypointVLD
       VAProfileVC1Advanced            : VAEntrypointVLD
       VAProfileH264ConstrainedBaseline: VAEntrypointVLD
       VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
       VAProfileH264Main               : VAEntrypointVLD
       VAProfileH264Main               : VAEntrypointEncSlice
       VAProfileH264High               : VAEntrypointVLD
       VAProfileH264High               : VAEntrypointEncSlice
       VAProfileHEVCMain               : VAEntrypointVLD
       VAProfileHEVCMain               : VAEntrypointEncSlice
       VAProfileHEVCMain10             : VAEntrypointVLD
       VAProfileJPEGBaseline           : VAEntrypointVLD
       VAProfileNone                   : VAEntrypointVideoProc

 # without audio
 # log: https://www.transfer.sh/KfuPb/ffmpeg-20191110-172753.log
 # video: https://streamable.com/eoyp2
 ffmpeg -y -framerate 60 -vsync 0 -device /dev/dri/card0 -vaapi_device
 /dev/dri/renderD128 -f kmsgrab -i - -vf 'hwmap,scale_vaapi=format=nv12'
 -c:v h264_vaapi -profile:v constrained_baseline -bf 0 output.mp4 -loglevel
 debug -report
 # with audio
 # log: https://www.transfer.sh/cVdJb/ffmpeg-20191110-172632.log
 # video: https://streamable.com/vaxin
 ffmpeg -y -framerate 60 -vsync 0 -device /dev/dri/card0 -vaapi_device
 /dev/dri/renderD128 -f kmsgrab -i - -f alsa -i default -vf
 'hwmap,scale_vaapi=format=nv12' -c:v h264_vaapi -c:a aac -profile:v
 constrained_baseline -bf 0 output_waudio.mp4 -loglevel debug -report

Ticket URL: <https://trac.ffmpeg.org/ticket/8377>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker

More information about the FFmpeg-trac mailing list