Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Uzver123 opened this issue Apr 17, 2024 · 4 comments
Open

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

Uzver123 opened this issue Apr 17, 2024 · 4 comments

Comments

@Uzver123
Copy link

Uzver123 commented Apr 17, 2024

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

@rom1v
Copy link
Collaborator

rom1v commented Apr 17, 2024

How do you know what frame rate you actually get?

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

@Uzver123
Copy link
Author

Uzver123 commented Apr 17, 2024

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

@rom1v
Copy link
Collaborator

rom1v commented Apr 18, 2024

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

Is screen mirroring working correctly?

@Uzver123
Copy link
Author

Uzver123 commented Apr 18, 2024

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 Uzver123 reopened this Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants