40

I am a vlogger and after getting HTC Desire HD, found out its camera was all I ever needed. However, I usually have to see myself while recording video, to control my facial expressions, and with a rear-facing camera it's just not possible.

I know ADB allows for screenshots, but is there a way to stream the screen output to my PC's display? Not necessarily at 20+ fps, just a couple frames per second will do.

1
  • Is this question really a duplicate? The other one only asks on how to mirror screen. This one asks to do that via ADB specifically
    – Ooker
    Commented Jun 11, 2021 at 11:00

4 Answers 4

12

Try the Android Screencast app.

See the XDA thread for more details.

3
  • Looks nice and answers the question I put in my thread's title... But ironically, displays the black bar instead of camera output. I guess it's like print-screening Windows Media Player: you end up with everything except the video itself :( Commented Mar 29, 2011 at 17:59
  • 2
    I'm not sure why you got that problem, but even if it worked appropriately it only gives you a 4-5 fps refresh rate, which is far from "Live".
    – Matt
    Commented Mar 29, 2011 at 18:55
  • 6
    I doubt you will be able to pipe output from your phone's camera to another device. Have you tried a more hardware based approach, like setting up a mirror? :)
    – Chahk
    Commented Mar 29, 2011 at 21:01
47

screenrecord

screenrecord is an internal Android executable that dumps screen to a file, and ffplay from ffmpeg happens to be able to play an H.264 encoded stream from stdin

First enable ADB USB access and then on Ubuntu:

sudo apt-get install adb ffmpeg    
adb exec-out screenrecord --output-format=h264 - |
   ffplay -framerate 60 -probesize 32 -sync video  -

You might have to make the screen move a bit before you see anything:

enter image description here

Uncut demo: https://www.youtube.com/watch?v=fVgeoMYm61Q

Explanation of parameters:

See also: Use adb screenrecord command to mirror Android screen to PC via USB

Tested on Ubuntu 20.04, Android 11, Pixel 3a.

13
  • 5
    The video starts faster with smaller probesize. I got good results with ffplay -framerate 60 -probesize 32 -sync video - the "-framerate 60" removes the delay effect and "-sync video" drops the frames instead of fast forwading them.
    – arbuz
    Commented Jan 24, 2018 at 0:30
  • 1
    Exactly what I was looking for! I didn't want to install an app just to grab a screenshot when security policies were restricting it. For the record, it worked for me on Ubuntu 18.04 with Android 7.0.
    – b_laoshi
    Commented Jan 2, 2019 at 1:54
  • 1
    @CiroSantilli郝海东冠状病六四事件法轮功, this: stackoverflow.com/a/31401447/6403504 and, basing on it, this: stackoverflow.com/a/13587203/6403504
    – Bowi
    Commented Nov 10, 2020 at 10:42
  • 1
    Got it working on macOS Big Sur with Pixel 4 and Pixel 2. Awesome solution Commented Mar 23, 2021 at 16:10
  • 1
    Sample command to play with the IINA player: adb shell screenrecord --output-format=h264 - | iina --stdin --keep-running --mpv-framerate=30 --mpv-untimed --mpv-framedrop=no --mpv-correct-pts=no
    – alleus
    Commented Mar 23, 2022 at 10:50
1

Some Android phones have TV Out capabilities, usually through USB or HDMI, but sometimes through the 3.5 audio jack. I don't think HTC Desire has any TV-Out capability though.

-1

Airdroid is all you need. Simple and easy to use. You're able to see your camera out put live but for some reason not able to record it. Your pc and android phone must be on the same WiFi network.

1
  • Airdroid works over WiFi AFAIK. OP wanted a solution for ADB (via USB). He also wanted to see the device screen live, i.e. with no or just marginal delay. If not added recently, Airdroid doesn't support that IMHO.
    – Izzy
    Commented Sep 17, 2014 at 10:07

Not the answer you're looking for? Browse other questions tagged .