使用adb screenrecord命令通过USB将Android屏幕镜像到PC [英] Use adb screenrecord command to mirror Android screen to PC via USB

查看:357
本文介绍了使用adb screenrecord命令通过USB将Android屏幕镜像到PC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试了 fadden 的建议,将Android屏幕镜像到PC,但是vlc播放器屏幕什么也没显示:

I've tried the suggestion from fadden to mirror the Android screen to PC, but the vlc player screen show nothing:

此功能的正确命令行是什么?谢谢。

What would be the correct commands lines for this function? Thanks.

推荐答案

我不记得我用于初始测试的vlc命令行了。我最近在台式机Linux(Ubuntu 15.10)上尝试了一些其他操作。

I don't remember the vlc command line that I used for the initial testing. I've tried a few different things recently, on desktop Linux (Ubuntu 15.10).

VLC

如果仅将输出通过管道传输到 vlc --demux h264-,它似乎可以正常工作,但是您逐渐落后了。添加-h264-fps = 60 似乎有帮助,但是您开始遇到错误( ES_OUT_SET_(GROUP_)PCR的调用太晚了)。添加-clock-jitter = 0 似乎可以减轻错误的影响,但仍然很混乱。

If you just pipe the output into vlc --demux h264 -, it appears to work, but you get gradually farther behind. Adding --h264-fps=60 seems to help that, but you start getting errors ("ES_OUT_SET_(GROUP_)PCR is called too late"). Adding --clock-jitter=0 seems to make the errors less traumatic, but it's still pretty messed up.

ffplay

一个简单的 ffplay-可行,但似乎要花一些时间决定开始的秒数,最后却落后于整个时间。

A simple ffplay - works, but it seems to take a few seconds to decide to start, and ends up lagging well behind the entire time.

使用 ffplay -framerate 60 -framedrop -bufsize 16M-可以提供相当长一段时间的不错的质量。这是由于以下命令同步了帧率和比特率,因为视频将另外尝试以30fps的速度播放,由于额外的帧,随着时间的推移,一切看起来/变得越来越慢。然后,比特率将有助于使视频尽可能保持最佳定时。 我发现它可以在100-1000MS的延迟内运行;与大多数蓝牙耳机类似。 您可能会收到考虑增加探针大小错误,该错误可能会冻结流。最好重新启动屏幕记录或尝试附加 -probesize 16M

Using ffplay -framerate 60 -framedrop -bufsize 16M - gives you a decent quality that lasts for quite a while. This is due to the below command that synchronises the framerate and bitrate as the video will otherwise be trying to play at 30fps making everything look/get slower over time due to the extra frames. The bitrate will then help keep the video properly timed as best as possible. I've found it works within a 100-1000MS delay; similarly to most Bluetooth headsets. You might get a "consider increasing probesize" error that may freeze the stream. It's best to restart screenrecord or try appending -probesize 16M

注意:使用ffplay进行的此配置可与预先通过管道传递的以下adb命令一起使用。如果您正在执行GPU密集型任务或使用较旧的手机,建议使用 1280x720 的尺寸。如果您的电话不支持60fps(或似乎不以60fps录制),请更改为适当的值,例如30或24。

Note: This configuration with ffplay works with the following adb command piped beforehand. If you're running GPU intensive tasks or using an older phone, a size of 1280x720 is a better recommendation. If your phone doesn't support 60fps (or doesn't seem to record in 60fps) change until appropriate with values such as 30 or 24.

adb exec-out screenrecord --bit-rate = 16m --output-format = h264 --size 1920x1080-

mplayer

命令 mplayer -demuxer h264es-似乎产生了最佳结果。立即启动,几乎没有延迟,而且不会像vlc那样异常。

The command mplayer -demuxer h264es - seems to yield the best results. Starts immediately, very little delay, and doesn't freak out like vlc.

这篇关于使用adb screenrecord命令通过USB将Android屏幕镜像到PC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆