33

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
    Jun 11 at 11:00
11

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 :( Mar 29 '11 at 17:59
  • 1
    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
    Mar 29 '11 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
    Mar 29 '11 at 21:01
27

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.

11
  • 4
    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
    Jan 24 '18 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
    Jan 2 '19 at 1:54
  • @b_laoshi great, added the new working versions report to the answer. Jan 2 '19 at 8:57
  • 1
    @CiroSantilli郝海东冠状病六四事件法轮功, this: stackoverflow.com/a/31401447/6403504 and, basing on it, this: stackoverflow.com/a/13587203/6403504
    – Bowi
    Nov 10 '20 at 10:42
  • 1
    Got it working on macOS Big Sur with Pixel 4 and Pixel 2. Awesome solution Mar 23 at 16:10
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
    Sep 17 '14 at 10:07

Not the answer you're looking for? Browse other questions tagged or ask your own question.