Unable to get output buffers (err=-38) when attempting to screen-record emulator from ADB I am attempting to capture a video of my emulator device screen using the screenrecord feature in ADB. When I run the command adb shell screenrecord --verbose /sdcard/demo/capture.mp4 I get the following response from ADB;

Main display is 1440x2560 @60.00fps (orientation=0)
Configuring recorder for 1440x2560 video/avc at 4.00Mbps
Content area is 1440x2560 at offset x=0 y=0
Unable to get output buffers (err=-38)
Encoder failed (err=-38)
Stopping encoder and muxer 218|root@generic_x86_64:/ #
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.