-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
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
Add --no-video (to mirror audio only) #3978
Conversation
Contrary to the other tasks (controller and audio capture/encoding), the screen encoder was executed synchronously. As a consequence, scrcpy-server could not terminate until the screen encoder returned. Convert it to an async processor. This allows to terminate on controller error, and this paves the way to disable video mirroring. PR #3978 <#3978>
Some server parameters may depend on one another. For example, audio_bit_rate is meaningless if audio is false. But it is inconsistent to disable some parameters based on these dependencies checks, but not others. Handling all dependencies between parameters would add too much complexity for no benefit. So just pass individual parameters independently. PR #3978 <#3978>
Use a build which includes the opus muxer, to support recording to .opus files. Refs <https://github.com/rom1v/scrcpy-deps/commits/6.0-scrcpy-3> PR #3978 <#3978>
Just tried the |
@Piripe Thank you for your tests 👍 If you could test recording only the audio to |
I tried recording only the audio with and without the mirroring, it works great! 2023-05-12.00-16-17_.mp4(Note: I'm REALLY unorganized, as you can see in my taskbar) The script: #NoTrayIcon
#Persistent
global hAutoadb
/* Setup Tray icon and add item that will handle
* double click events
*/
Menu Tray, Icon
Menu Tray, Icon, icon.ico
Menu Tray, Add, Show / Hide autoadb, TrayClick
Menu Tray, Add, Mirror Display, DisplayClick
Menu Tray, Default, Mirror Display
;// Run autoadb hidden
DetectHiddenWindows On
Run autoadb scrcpy --no-video,, Hide, PID
WinWait ahk_pid %PID%
hAutoadb := WinExist()
DetectHiddenWindows Off
return
TrayClick:
OnTrayClick()
return
DisplayClick:
Run scrcpy --no-audio --turn-screen-off --stay-awake --show-touches -b 30M,,, PID
WinWait ahk_pid %PID%
hScrcpy := WinExist()
WinHide ahk_id %hScrcpy%
return
;// Show / hide Autoadb on double click
OnTrayClick() {
if DllCall("IsWindowVisible", "Ptr", hAutoadb) {
WinHide ahk_id %hAutoadb%
} else {
WinShow ahk_id %hAutoadb%
WinActivate ahk_id %hAutoadb%
}
} |
Hi, will this work with v4l2? Currently, v4l2 with no display with --required-audio doesn't stream audio |
I plan to add
|
Use a build which includes the opus muxer, to support recording to .opus files. Refs <https://github.com/rom1v/scrcpy-deps/commits/6.0-scrcpy-3> PR #3978 <#3978>
Question about the option name: in this MR, I'm wondering if it should be called For example, if we use a V4L2 think without a scrcpy window ( What do you think? |
Yeah, it would be more intuitive |
This option impacts video and audio _playback_. For example, if we use V4L2, the device is still "mirrored" (via V4L2), even if playback is disabled. Therefore, "playback" is more approriate than "mirror". The initial option --no-display option was renamed to --no-mirror by commit 6928acd, but this has never been released, so it is ok to rename it one more time. Refs #3978 <#3978 (comment)>
This option impacts video and audio _playback_. For example, if we use V4L2, the device is still "mirrored" (via V4L2), even if playback is disabled. Therefore, "playback" is more approriate than "mirror". The initial option --no-display option was renamed to --no-mirror by commit 6928acd, but this has never been released, so it is ok to rename it one more time. Refs #3978 <#3978 (comment)> PR #4033 <#4033>
As a first step, rename
--no-display
to--no-mirror
:--display=
which is totally unrelated (it refers to the device display)Using the short version
-N
works as before.Using
--no-display
still works, but generates a warning:Then add a new option
--no-video
:And adapt recording to audio files:
scrcpy --no-video --record=file.opus scrcpy --no-video --audio-codec=aac --record-file=file.aac # .m4a/.mp4 and .mka/.mkv are also supported for both opus and aac
To record only:
The
opus
muxer has been added to the prebuilt FFmpeg for windows releases: https://github.com/rom1v/scrcpy-deps/commits/6.0-scrcpy-3Fixes #3842
Please review and test. Here is a release of this PR:
scrcpy-win64-pr3978.zip
SHA-256: 69c2eb1d3cad610a4e8488ffce6b8f66365b1375b321feb4f2426b3165a5c337
scrcpy-win32-pr3978.zip
SHA-256: 559d582f04359ccf4ca72532e73b890079bd9276ba43946cc48d07571b1abc51