chikadance
chikadance

Reputation: 4167

how to redirect adb screenrecord output to pc(windows/linux) storage

In linux, I use following code to cast android screen to pc, it work well

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

so I think exist way to redirect screenrecord output to pc storage, so I try following code

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

but the output video file cannot be opened by vlc and google-chrome, how to fix it?

ffplay is belongs ffmpeg, so I guess exist similar cli in ffmpeg to output input video streaming into video file

Upvotes: 0

Views: 3542

Answers (1)

chikadance
chikadance

Reputation: 4167

I find the soluiton, use default ffmpeg, in latest linux mint, it use avconv to instead ffmpeg, but 2 clis syntax are same, following is my code

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

Upvotes: 1

Related Questions