Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Screenshot/Record Screen #21

Closed
fireph opened this issue Mar 9, 2018 · 21 comments
Closed

Screenshot/Record Screen #21

fireph opened this issue Mar 9, 2018 · 21 comments

Comments

@fireph
Copy link

fireph commented Mar 9, 2018

Having a keyboard command to take a screenshot and one to start/stop recording the screen into a video would be an extremely useful feature for scrcpy.

scrcpy seems to already be using ffmpeg on the computer side, so saving the input stream to a file/screenshotting the input stream should be very do-able.

@redwolf2
Copy link

redwolf2 commented Mar 9, 2018

As a workaround for now:

Screenshots: Works on every application:
ALT RIGHT + Print
Then paste the image to your favorite image editor.

... or use the Windows Snipping tool.

Video recoring:
Just use OBS Studio and capture the window.

@rom1v
Copy link
Collaborator

rom1v commented Mar 9, 2018

Or:

Screenshot:

adb exec-out screencap -p > file.png

Video recording:

adb shell screenrecord /sdcard/file.mp4
adb pull /sdcard/file.mp4

@zaniar
Copy link

zaniar commented Oct 1, 2018

I think it is best to leave this kind of feature to other program.

@rom1v
Copy link
Collaborator

rom1v commented Oct 1, 2018

Just to give a bit more details.

The server streams to the client a raw H.264 video stream. This stream does not contain any time information (no timestamps), which is not a problem because it's live. But for recording, we would need to mux the raw stream into a container, with timestamps (especially with a variable-framerate stream).

Ideally, the timestamps would be provided by the server (to be accurate), but this would mean an additional layer to mux on the server + demux on the client, which involves copies, and could increase the lag a bit

Alternatively, the client might mux the stream adding the timestamps according to the date it receives the frames. It could work, but would probably require some dependencies. I'm not sure it's worth it, since adb shell screenrecord /sdcard/file.mp4 already does the job.

@tshah16
Copy link

tshah16 commented Oct 18, 2018

adb shell screenrecord /sdcard/file.mp4 does only for 180 seconds. I would like to record more than 1 hr. Any idea how can we use scrcpy to get this recording?

@redwolf2
Copy link

@shahtapan Just use OBS Studio and capture the window.

@rom1v
Copy link
Collaborator

rom1v commented Oct 19, 2018

@shahtapan Some work have been done to support recording in scrcpy, so hopefully it will be supported in a future version: #292.

@katieisnell
Copy link

Does the OBS Studio solution record the audio outputting from the device? If not then I think if this feature needs to be implemented into the strcpy with consideration to implement audio recording too 😄

@emartynov
Copy link

It would be great! I'm trying to use QuickTime player, but it is quite hassling to start, select area, be quick to remove mouse pointer, and don't forget to stop recording without passing mouse pointer through the recorded area.

@rom1v rom1v added the record label Nov 9, 2018
@rom1v
Copy link
Collaborator

rom1v commented Nov 9, 2018

If you are interested, you can test the WiP branch record (see #292).

@rom1v
Copy link
Collaborator

rom1v commented Nov 11, 2018

This is implemented in v1.5:

scrcpy --record file.mp4

🎉

@rom1v rom1v closed this as completed Nov 11, 2018
@redgitid
Copy link

@rom1v and screenshot?

@rom1v
Copy link
Collaborator

rom1v commented Nov 12, 2018

@rom1v and screenshot?

adb exec-out screencap -p > screenshot.png

:trollface:

@redgitid
Copy link

Thanks:smiley:

@Noob567
Copy link

Noob567 commented Nov 23, 2018

And do you know how to stop screen recording?

@rom1v
Copy link
Collaborator

rom1v commented Nov 23, 2018

@Noob567 #116 (comment)

@wchargin
Copy link

Screen recording works great, but adb exec-out screencap does not work
for apps that prevent taking a screenshot on device. It would be nice to
have something like scrcpy --screenshot file.png that uses scrcpy’s
recording mechanism to capture a single lossless frame.

@rom1v
Copy link
Collaborator

rom1v commented Apr 20, 2021

@wchargin Capturing a lossless frame is a totally different process on the server-side. And it would take several seconds.

Refs #684 #1951

Screen recording works great, but adb exec-out screencap does not work for apps that prevent taking a screenshot on device.

For now, Android 12 removed this possibility for screen recording too: #2129.

@BrunoFischerGermany
Copy link

BrunoFischerGermany commented Aug 15, 2021

Hey. I use
adb exec-out screencap -p >> Screenshot__%date:-4,4%%date:-10,2%%date:~-7,2%_%time:~0,2%%time:~3,2%%time:~6,2%.png

It create an png like Screenshot_20210815_202000.png in the scrcpy.exe folder.
I Think an key combination like ctrl + print in the scrcpy window would be great 👍

@lollita
Copy link

lollita commented Oct 24, 2021

"adb exec-out" not work in Windows. How to do?

@TehRaccoon
Copy link

Screenshot using scrcpy could be useful in cases where you want to bypass screenshot protection of some apps. The "adb exec-out" command does not work in such cases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests