在 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 将输入视频流输出到视频文件
最佳答案
我找到解决方案,使用默认的 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/