在linux中,我使用以下代码将android屏幕投射到pc上,它运行良好

adb shell "screenrecord --time-limit 1 --output-format=h264 -; screenrecord --time-limit 180 --output-format=h264 -" | ffplay -

所以我认为存在将屏幕记录输出重定向到PC存储的方式,所以我尝试遵循代码
adb shell "screenrecord --time-limit 1 --output-format=h264 -; screenrecord --time-limit 180 --output-format=h264 -" >> /tmp/t.mp4

但是输出的视频文件不能被vlc和google chrome打开,如何修复?
FFPLAY属于FFMPEG,所以我猜想FFMPEG中存在类似的CLI,将输入的视频流输出到视频文件中。

最佳答案

我找到了soluiton,使用默认的ffmpeg,在最新的linux mint中,它使用avconv来代替ffmpeg,但是2个clis语法是相同的,下面是我的代码

adb shell "screenrecord --time-limit 1 --output-format=h264 -; screenrecord --time-limit 180 --output-format=h264 -" | avconv -i - /tmp/t.mp4

关于android - 如何将ADB ScreenRecord输出重定向到PC(Windows/Linux)存储,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/53559359/

10-12 04:12