Closed 1bharath-yadav closed 5 months ago
The encoder failed. I'm surprised that it does not retry with a lower resolution. Does it only happen with camera capture?
Can you try with -m1024
?
Yea
sorry I am an Idoit it works
scrcpy -m 1024 --video-source=camera --no-audio --camera-facing=front \
--v4l2-sink=/dev/video0
scrcpy 2.4 <https://github.com/Genymobile/scrcpy>
INFO: Video orientation is locked for v4l2 sink. See --lock-video-orientation.
INFO: Camera video source: control disabled
INFO: ADB device found:
INFO: --> (usb) Q8JR4DUCLJIRKVPZ device 2201117PI
/usr/share/scrcpy/scrcpy-server: 1 file pushed, 0 skipped. 115.2 MB/s (69007 bytes in 0.001s)
[server] INFO: Device: [Xiaomi] POCO 2201117PI (Android 13)
INFO: Renderer: opengl
INFO: OpenGL version: 4.6 (Compatibility Profile) Mesa 24.0.7-arch1.3
INFO: Trilinear filtering enabled
[server] INFO: Using camera '1'
INFO: v4l2 sink started to device: /dev/video0
INFO: Texture: 960x720
WARN: Killing the server...
scrcpy -m 1024 --video-source=camera --no-audio --camera-facing=front --v4l2-sink=/dev/video0
Does it work if you don't pass --no-audio
? Does it work if you don't pass -m 1024
?
It should have retried with a lower resolution automatically.
To investigate, could you please test with this server binary where I added some logs:
scrcpy-server
SHA-256: 7e2f156508386b809abbd47362fef835724e78b8fc8d0911b8f67f9537c651a
And reproduce the error:
export SCRCPY_SERVER_PATH=/path/to/this/scrcpy-server # adapt the path
scrcpy --video-source=camera --camera-facing=front
Then post the console output.
Thank you
scrcpy -m 1024 --video-source=camera --no-video-playback --camera-facing=front \
--v4l2-sink=/dev/video0
scrcpy 2.4 <https://github.com/Genymobile/scrcpy>
INFO: Video orientation is locked for v4l2 sink. See --lock-video-orientation.
INFO: Camera video source: control disabled
INFO: Camera video source: microphone audio source selected
INFO: ADB device found:
INFO: --> (usb) Q8JR4DUCLJIRKVPZ device 2201117PI
/usr/share/scrcpy/scrcpy-server: 1 file pushed, 0 skipped. 72.4 MB/s (69007 bytes in 0.001s)
[server] INFO: Device: [Xiaomi] POCO 2201117PI (Android 13)
[server] INFO: Using camera '1'
INFO: v4l2 sink started to device: /dev/video0
scrcpy --video-source=camera --camera-facing=front \
--v4l2-sink=/dev/video0
scrcpy 2.4 <https://github.com/Genymobile/scrcpy>
INFO: Video orientation is locked for v4l2 sink. See --lock-video-orientation.
INFO: Camera video source: control disabled
INFO: Camera video source: microphone audio source selected
INFO: ADB device found:
INFO: --> (usb) Q8JR4DUCLJIRKVPZ device 2201117PI
/usr/share/scrcpy/scrcpy-server: 1 file pushed, 0 skipped. 63.4 MB/s (69007 bytes in 0.001s)
[server] INFO: Device: [Xiaomi] POCO 2201117PI (Android 13)
INFO: Renderer: opengl
INFO: OpenGL version: 4.6 (Compatibility Profile) Mesa 24.0.7-arch1.3
INFO: Trilinear filtering enabled
[server] INFO: Using camera '1'
INFO: v4l2 sink started to device: /dev/video0
INFO: Texture: 2320x1744
[server] ERROR: Encoding error: java.lang.IllegalArgumentException: null
WARN: Device disconnected
[server] ERROR: Exception on thread Thread[video,5,main]
java.lang.IllegalArgumentException
at android.media.MediaCodec.native_configure(Native Method)
at android.media.MediaCodec.configure(MediaCodec.java:2214)
at android.media.MediaCodec.configure(MediaCodec.java:2130)
at com.genymobile.scrcpy.SurfaceEncoder.streamScreen(SurfaceEncoder.java:69)
at com.genymobile.scrcpy.SurfaceEncoder.lambda$start$0$com-genymobile-scrcpy-SurfaceEncoder(SurfaceEncoder.java:253)
at com.genymobile.scrcpy.SurfaceEncoder$$ExternalSyntheticLambda0.run(Unknown Source:4)
at java.lang.Thread.run(Thread.java:1012)
i dont know how to test server
i dont know how to test server
Download the scrcpy-server
binary I linked in https://github.com/Genymobile/scrcpy/issues/4921#issuecomment-2109401604.
Then set an environment variable to force scrcpy to use this specific one (adapt the path):
export SCRCPY_SERVER_PATH=/path/to/this/scrcpy-server
Just after, in the same terminal, execute:
scrcpy --video-source=camera --camera-facing=front
Yes yes doing that
On Tue, 14 May, 2024, 12:24 pm Romain Vimont, @.***> wrote:
i dont know how to test server
Download the scrcpy-server binary I linked in #4921 (comment) https://github.com/Genymobile/scrcpy/issues/4921#issuecomment-2109401604 somewhere.
Then set an environment variable to force scrcpy using this specific one (adapt the path):
export SCRCPY_SERVER_PATH=/path/to/this/scrcpy-server
Just after, in the same terminal, execute:
scrcpy --video-source=camera --camera-facing=front
— Reply to this email directly, view it on GitHub https://github.com/Genymobile/scrcpy/issues/4921#issuecomment-2109417823, or unsubscribe https://github.com/notifications/unsubscribe-auth/BBOPGZD27RBUDWVHZ33OCE3ZCGYIXAVCNFSM6AAAAABHVP4IRKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBZGQYTOOBSGM . You are receiving this because you modified the open/close state.Message ID: @.***>
$ scrcpy --video-source=camera --camera-facing=front
scrcpy 2.4 <https://github.com/Genymobile/scrcpy>
INFO: Camera video source: control disabled
INFO: Camera video source: microphone audio source selected
INFO: ADB device found:
INFO: --> (usb) Q8JR4DUCLJIRKVPZ device 2201117PI
/home/Archer/Desktop/scrcpy-server: 1 file pushed, 0 skipped. 135.3 MB/s (109486 bytes in 0.001s)
[server] INFO: Device: [Xiaomi] POCO 2201117PI (Android 13)
INFO: Renderer: opengl
INFO: OpenGL version: 4.6 (Compatibility Profile) Mesa 24.0.7-arch1.3
INFO: Trilinear filtering enabled
[server] INFO: Using camera '1'
[server] INFO: ==== Size{width=2320, height=1744}
INFO: Texture: 2320x1744
[server] ERROR: Encoding error: java.lang.IllegalArgumentException: null
[server] INFO: ==== firstFrameSend=false
[server] INFO: ==== consecutiveErrors=0
[server] INFO: ==== downsizeOnError=true
[server] INFO: maxSizeFallback index=1920
[server] INFO: fallback accepted=true
[server] INFO: Retrying with -m1920...
[server] INFO: Retrying...
[server] INFO: ==== Size{width=1920, height=1440}
INFO: Texture: 1920x1440
Hmm, that's great, but now it retries :thinking:
[server] INFO: Retrying with -m1920...
The initial issue was that it did not retry, so I added logs to understand why :confused:
Could you reproduce your initial issue (somehow) with this new server binary?
scrcpy --video-source=camera --no-audio --camera-facing=front \
--v4l2-sink=/dev/video0
scrcpy 2.4 <https://github.com/Genymobile/scrcpy>
INFO: Video orientation is locked for v4l2 sink. See --lock-video-orientation.
INFO: Camera video source: control disabled
INFO: ADB device found:
INFO: --> (usb) Q8JR4DUCLJIRKVPZ device 2201117PI
/home/Archer/Desktop/scrcpy-server: 1 file pushed, 0 skipped. 162.4 MB/s (109486 bytes in 0.001s)
[server] INFO: Device: [Xiaomi] POCO 2201117PI (Android 13)
INFO: Renderer: opengl
INFO: OpenGL version: 4.6 (Compatibility Profile) Mesa 24.0.7-arch1.3
INFO: Trilinear filtering enabled
[server] INFO: Using camera '1'
[server] INFO: ==== Size{width=2320, height=1744}
INFO: v4l2 sink started to device: /dev/video0
INFO: Texture: 2320x1744
[server] ERROR: Encoding error: java.lang.IllegalArgumentException: null
[server] INFO: ==== firstFrameSend=false
[server] INFO: ==== consecutiveErrors=0
[server] INFO: ==== downsizeOnError=false
WARN: Device disconnected
[server] ERROR: Exception on thread Thread[video,5,main]
java.lang.IllegalArgumentException
at android.media.MediaCodec.native_configure(Native Method)
at android.media.MediaCodec.configure(MediaCodec.java:2214)
at android.media.MediaCodec.configure(MediaCodec.java:2130)
at com.genymobile.scrcpy.SurfaceEncoder.streamScreen(SurfaceEncoder.java:70)
at com.genymobile.scrcpy.SurfaceEncoder.lambda$start$0$com-genymobile-scrcpy-SurfaceEncoder(SurfaceEncoder.java:259)
at com.genymobile.scrcpy.SurfaceEncoder$$ExternalSyntheticLambda0.run(Unknown Source:4)
at java.lang.Thread.run(Thread.java:1012)
Oh, ok, thank you very much! I understand now.
When V4L2 sink is set, the "downsize on error" feature is disabled:
love your work
Environment Archlinux
Describe the bug scrcpy --video-source=camera --camera-facing=front \ --v4l2-sink=/dev/video0;
scrcpy 2.4 https://github.com/Genymobile/scrcpy INFO: Video orientation is locked for v4l2 sink. See --lock-video-orientation. INFO: Camera video source: control disabled INFO: Camera video source: microphone audio source selected INFO: ADB device found: INFO: --> (usb) Q8JR4DUCLJIRKVPZ device 2201117PI /usr/share/scrcpy/scrcpy-server: 1 file pushed, 0 skipped. 138.8 MB/s (69007 bytes in 0.000s) [server] INFO: Device: [Xiaomi] POCO 2201117PI (Android 13) [server] INFO: Using camera '1' INFO: Renderer: opengl INFO: OpenGL version: 4.6 (Compatibility Profile) Mesa 24.0.7-arch1.3 INFO: Trilinear filtering enabled INFO: v4l2 sink started to device: /dev/video0 INFO: Texture: 2320x1744 [server] ERROR: Encoding error: java.lang.IllegalArgumentException: null [server] ERROR: Exception on thread Thread[video,5,main] java.lang.IllegalArgumentException at android.media.MediaCodec.native_configure(Native Method) at android.media.MediaCodec.configure(MediaCodec.java:2214) at android.media.MediaCodec.configure(MediaCodec.java:2130) at com.genymobile.scrcpy.SurfaceEncoder.streamScreen(SurfaceEncoder.java:69) at com.genymobile.scrcpy.SurfaceEncoder.lambda$start$0$com-genymobile-scrcpy-SurfaceEncoder(SurfaceEncoder.java:253) at com.genymobile.scrcpy.SurfaceEncoder$$ExternalSyntheticLambda0.run(Unknown Source:4) at java.lang.Thread.run(Thread.java:1012) WARN: Device disconnected