Stream Android screen to video player

前端 未结 1 1157
独厮守ぢ
独厮守ぢ 2020-12-18 15:14

I\'m using Windows 7 64 bit on my laptop and Android 5.0.1 on my Samsung Galaxy S4 device. I\'m trying to stream my device\'s screen via adb using following code: adb

相关标签:
1条回答
  • 2020-12-18 15:37

    In order to support the interactive adb shell command the shell_service uses pty. It helps to take care of all interactive user input like cursor key presses, etc. But the side effect of using pty is that it mangles binary output of the process. This is why capturing the output of adb shell screenrecord on the host side results in a corrupted file. Previously the only way to fix that was to post-process the file to remove those extra characters. But some time ago Google has added another version of the shell command which does not have the interactive mode and therefore does not need to use the pty. They called it exec-out.

    So in order to capture a file without corruption you should use

    adb exec-out screenrecord --output-format=h264 -
    
    0 讨论(0)
提交回复
热议问题