Unable to get output buffers (err=-38) when attempting to screen-record emulator from ADB
From ADB documentation :


  "Some devices might not be able to record at their native display
  resolution. If you encounter problems with screen recording, try using
  a lower screen resolution."


Documentation link :
https://developer.android.com/studio/command-line/adb.html#screenrecord

Try to use the size option :


  --size widthxheight
  
  Sets the video size. The default value is the device's native display resolution (if supported), 1280x720 if
  not. For best results, use a size supported by your device's Advanced
  Video Coding (AVC) encoder.