scrcpy icon indicating copy to clipboard operation
scrcpy copied to clipboard

Video is 1.2FPS when selecting 15FPS --camera-fps

Open Uzver123 opened this issue 1 year ago • 4 comments

Environment

  • OS: [Windows 10]
  • scrcpy version: [2.4]
  • installation method: [Windows 64Bit portable]
  • device model: OnePlus 8 Pro
  • Android version: [13]

Describe the bug --camera-id=0 (back, 4000x3000, fps=[15, 29, 30]) --camera-id=1 (front, 2328x1748, fps=[15, 30])

When i select --camera-fps=24 i am getting ~23fps video when i select --camera-fps=15 fps i am getting 

1.2fps full command scrcpy -b1M --record-format=mp4 --no-audio-playback --video-source=camera --camera-id=0 --video-codec=h264 --camera-fps=15 --camera-size=320x240

Uzver123 avatar Apr 17 '24 14:04 Uzver123

How do you know what frame rate you actually get?

What is the console output if you add --print-fps?

rom1v avatar Apr 17 '24 15:04 rom1v

How do you know what frame rate you actually get?

Its recording the file i check fps then in mp4

What is the console output if you add --print-fps?

I am getting this error if i set --camera-fps to value less than 20


[server] INFO: Device: [OnePlus] OnePlus IN2023 (Android 13)
[server] INFO: Using camera '0'
INFO: Renderer: direct3d
INFO: Texture: 320x240
INFO: FPS counter started
[server] ERROR: Encoding error: java.lang.IllegalStateException: null
[server] INFO: Retrying...
[server] ERROR: Encoding error: java.lang.IllegalStateException: null
INFO: 1 fps
[server] INFO: Retrying...
[server] ERROR: Encoding error: java.lang.IllegalStateException: null
[server] INFO: Retrying...
INFO: 1 fps

Uzver123 avatar Apr 17 '24 19:04 Uzver123

Did you try with another encoder? https://github.com/Genymobile/scrcpy/blob/master/doc/video.md#encoder

Is screen mirroring working correctly?

rom1v avatar Apr 18 '24 08:04 rom1v

Is screen mirroring working correctly?

Regular feed (not camera) is working okay

Did you try with another encoder? https://github.com/Genymobile/scrcpy/blob/master/doc/video.md#encoder

Two of h.264 codecs are working with 15fps

15fps broken  --video-codec=h264 --video-encoder='OMX.qcom.video.encoder.avc'
15fps working --video-codec=h264 --video-encoder='c2.android.avc.encoder'
15fps working --video-codec=h264 --video-encoder='OMX.google.h264.encoder'

None of h.265 codecs are working with 15fps, wonder why?

15fps broken  --video-codec=h265 --video-encoder='OMX.qcom.video.encoder.hevc'
15fps broken  --video-codec=h265 --video-encoder='OMX.qcom.video.encoder.hevc.cq'
15fps broken  --video-codec=h265 --video-encoder='c2.android.hevc.encoder'

My goal is to output 4000x3000 video feed at 15fps.

Problem is that two codecs that work with 15fps stop working at resolution higher than 2304x1728 giving this error:

image

[server] INFO: Device: [OnePlus] OnePlus IN2023 (Android 13)
[server] INFO: Using camera '0'
[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:2215)
        at android.media.MediaCodec.configure(MediaCodec.java:2131)
        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)
INFO: Renderer: direct3d
INFO: Texture: 4000x3000
WARN: Device disconnected

Any of this commands will produce above error scrcpy -b50M --no-audio-playback --video-source=camera --camera-id=0 --camera-fps=15 --camera-size=4000x3000 --video-codec=h264 --video-encoder='c2.android.avc.encoder' or scrcpy -b50M --no-audio-playback --video-source=camera --camera-id=0 --camera-fps=15 --camera-size=4000x3000 --video-codec=h264 --video-encoder='OMX.google.h264.encoder'

while this one works fine scrcpy -b50M --no-audio-playback --video-source=camera --camera-id=0 --camera-fps=15 --camera-size=640x480 --video-codec=h264 --video-encoder='c2.android.avc.encoder' or scrcpy -b50M --no-audio-playback --video-source=camera --camera-id=0 --camera-fps=15 --camera-size=640x480 --video-codec=h264 --video-encoder='OMX.google.h264.encoder'

Uzver123 avatar Apr 18 '24 11:04 Uzver123