[Android] Scrcpy ERROR: Encoding error: java.lang.IllegalStateException: null
โ๐ป ๋ฐ์ ์๋ฌ
$ scrcpy
scrcpy 2.4 <https://github.com/Genymobile/scrcpy>
INFO: ADB device found:
INFO: --> (usb) ce0516058123de0e04 device SM_G930S
/usr/local/share/scrcpy/scrcpy-server: 1 file pushed. 4.5 MB/s (69007 bytes in 0.015s)
[server] INFO: Device: [samsung] samsung SM-G930S (Android 7.1.1)
[server] WARN: Audio disabled: it is not supported before Android 11
INFO: Renderer: opengl
INFO: OpenGL version: 4.3 (Compatibility Profile) Mesa 23.2.1-1ubuntu3.1~22.04.2
INFO: Trilinear filtering enabled
[server] ERROR: Encoding error: java.lang.IllegalStateException: null
[server] INFO: Retrying with -m1920...
[server] INFO: Retrying...
WARN: Demuxer 'audio': stream explicitly disabled by the device
INFO: Texture: 1440x2560--video-codec=h264 --video-encoder='OMX.google.h264.encoder'
[server] ERROR: Encoding error: java.lang.IllegalStateException: null
[server] INFO: Retrying with -m1600...
[server] INFO: Retrying...
[server] INFO: Retrying with -m1280...
[server] INFO: Retrying...
[server] ERROR: Encoding error: java.lang.IllegalStateException: null
[server] ERROR: Encoding error: java.lang.IllegalStateException: null
[server] INFO: Retrying with -m1024...
[server] INFO: Retrying...
[server] ERROR: Encoding error: java.lang.IllegalStateException: null
[server] INFO: Retrying with -m800...
[server] INFO: Retrying...
[server] ERROR: Encoding error: java.lang.IllegalStateException: null
WARN: Device disconnected
scrcpy ๋ช
๋ น์ด๋ฅผ ์ฌ์ฉํ์ ๋ ๋ํ๋๋ ์๋ฌ๋ค์ด๋ค.
Encoding Error๋ก ๋ณผ ์ ์๋๋ฐ ์๊ฐ๋ณด๋ค Encoding Error๋ฅผ ๋ค๋ฃจ๋ ๋ธ๋ก๊ทธ ๊ธ์ด ๋ง์ง ์์์ ์ ๋ฆฌํด๋ณธ๋ค.
โ๐ป ํด๊ฒฐ๋ฐฉ๋ฒ
ํด๊ฒฐ๋ฐฉ๋ฒ์ github issue์์ ๋ณผ ์ ์์๋ค.
https://github.com/Genymobile/scrcpy/issues/4299
์ด์ค์์ ๋๋ ๋ค์์ ๋ฐฉ๋ฒ์ผ๋ก ํด๊ฒฐํ๋ค.
[server] WARN: Audio disabled: it is not supported before Android 11
์๋ฌ์ ๊ฒฝ์ฐ์๋ ์๋๋ก์ด๋11 ์ด์ ์ ๊ธฐ๊ธฐ์์๋ audio๋ฅผ ์ง์ํ์ง ์๋ ๊ฒ์ผ๋ก ๋ณด์ธ๋ค. ๋ฐ๋ผ์ scrcpy Usage Example์๋ ๋์์๋ฏ์ด --no-audio
์ต์
์ ์ฌ์ฉํ๋ฉด ๋๋ค.
ํ์ฌ ์๋๋ก์ด๋ ๊ธฐ๊ธฐ๋ linearge os version 14 ์ด๊ธฐ ๋๋ฌธ์ ์๋๋ก์ด๋ 7์ด๋ค.
[server] ERROR: Encoding error: java.lang.IllegalStateException: null
์๋ฌ์ ๊ฒฝ์ฐ์๋ scrcpy๊ฐ ์ธ์ฝ๋ฉ์ ํ์ง ๋ชปํด์ ์๊ธฐ๋ ์ค๋ฅ๋ค. ๋ฐ๋ผ์ ์ธ์ฝ๋ฉ ์ต์
์ ๋ฐ๋ก ์ค์ผํ๋ค๋ ๊ฒ์ด ์ด์์ ํต์ฌ์ด์๋ค.
๋ค์์ ๋ช
๋ น์ด๋ฅผ ์ฌ์ฉํด์ ๊ฐ๋ฅํ ์ธ์ฝ๋ฉ ์ต์
์ ํ์ธํด๋ณด์.
$ scrcpy --no-audio --list-encoders
์ถ๋ ฅ ๊ฒฐ๊ณผ๋ ๋ค์๊ณผ ๊ฐ๋ค.
[server] INFO: Device: [samsung] samsung SM-G930S (Android 7.1.1)
[server] INFO: List of video encoders:
--video-codec=h264 --video-encoder='OMX.Exynos.AVC.Encoder'
--video-codec=h264 --video-encoder='OMX.google.h264.encoder'
--video-codec=h265 --video-encoder='OMX.Exynos.HEVC.Encoder'
[server] INFO: List of audio encoders:
--audio-codec=aac --audio-encoder='OMX.google.aac.encoder'
--audio-codec=flac --audio-encoder='OMX.google.flac.encoder'
๋ฐ๋ผ์ ์ด์ค ํ๋์ ์ต์
์ ์ฃผ๋ฉด ๋๋๋ฐ h264 encoder ๊ฐ ๋ง์ด ์ฌ์ฉ๋๋ ๊ฒ์ ํ์ธํ์ฌ 2๋ฒ์งธ ์ต์
์ ์ฃผ์๋ค.
โ๐ป ๊ฒฐ๋ก
๋ด๊ฐ encoding error๋ฅผ ํด๊ฒฐํ ๋ช
๋ น์ด๋ ๋ค์๊ณผ ๊ฐ๋ค.
$ scrcpy --no-audio --video-codec=h264 --video-encoder='OMX.google.h264.encoder'
Leave a comment