[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'

Categories:

Updated:

Leave a comment