scrcpy: ERROR: Could not open video stream

On Arch GNU/Linux, built scrcpy using the released .jar.

meson x --buildtype release --strip -Db_lto=true \
    -Dprebuilt_server=/path/to/scrcpy-server.jar
cd x
ninja
sudo ninja install

I have a Samsung Galaxy Note II N7100 running Replicant 6.0 0003. The resulution should be 720x1280.

$ scrcpy -m 1280 
/usr/local/share/scrcpy/scrcpy-server.jar: 1 file pushed. 1.9 MB/s (19038 bytes in 0.009s)
Invalid return value 0 for stream protocol
Invalid return value 0 for stream protocol
Invalid return value 0 for stream protocol
Invalid return value 0 for stream protocol
Invalid return value 0 for stream protocol
ERROR: Could not open video stream
ERROR: Exception on thread Thread[main,5,main]
java.lang.IllegalStateException
	at android.media.MediaCodec.native_stop(Native Method)
	at android.media.MediaCodec.stop(MediaCodec.java:1901)
	at com.genymobile.scrcpy.ScreenEncoder.streamScreen(ScreenEncoder.java:69)
	at com.genymobile.scrcpy.Server.scrcpy(Server.java:21)
	at com.genymobile.scrcpy.Server.main(Server.java:70)
	at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
	at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:258)
INFO: Initial texture: 720x1280

Any ideas? I think Replicant may be the offender here.

Edit: installed android sdk aura -A android-sdk and built my own .jar; same result.

Edit2: Does not affect Samsung S9 with Stock or LineageOS

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 19

Commits related to this issue

Most upvoted comments

@mikhoul Maybe you could increase the definition until it fails.

scrcpy -m 1024
scrcpy -m 1280
…

The command scrcpy -b2M -m800 did get it working for me.

I had this issue too, I have very little to do with this program until 5min ago, But seems like this error has been very briefly looked at before in Issue #73 Using the lower resolution/bitrate with the parameters,

scrcpy -b2M -m800

I can get scrcpy -m 1650 to work but I fail at scrcpy -m 1700 Inserting -b2M doesn’t effect the outcome. Even reducing to -b1M doesn’t allow 1700.