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

Add keyframes and additional video encoder codec settings #4857

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

Add keyframes and additional video encoder codec settings #4857

Uzver123 opened this issue Apr 17, 2024 · 2 comments

Comments

@Uzver123
Copy link

Uzver123 commented Apr 17, 2024

Please add additional video encoder settings especially the keyframe interval, right now ScrCpy records all-intra videos without any keyframe which is very wasteful in terms of bitrate because bitrate is split across every frame (not compressed at all, each frame same size).

I understand this is probably done to keep resources usage lower on the phone, but not always a desired method. really need ability to specify keyframe interval.

Also need ability to control ISO/exposure etc.

Would be nice if you could add command line to the video encoder so we can pass custom command line options to codec without need to request each individual one as feature.

@Uzver123 Uzver123 changed the title ScrCpy please add additional video encoder codec settings Add keyframes and additional video encoder codec settings Apr 17, 2024
@rom1v
Copy link
Collaborator

rom1v commented Apr 17, 2024

right now ScrCpy records all-intra videos without any keyframe

Hmm, no, it is set to 10 seconds:

private static final int DEFAULT_I_FRAME_INTERVAL = 10; // seconds

Would be nice if you could add command line to the video encoder so we can pass custom command line options to codec without need to request each individual one as feature.

This option already exists: --video-codec-options:

    --video-codec-options=key[:type]=value[,...]
        Set a list of comma-separated key:type=value options for the device
        video encoder.
        The possible values for 'type' are 'int' (default), 'long', 'float' and
        'string'.
        The list of possible codec options is available in the Android
        documentation:
        <https://d.android.com/reference/android/media/MediaFormat>

For example:

scrcpy --video-codec-options=i-frame-interval=1

or as a float (since Build.VERSION_CODES.N_MR1):

scrcpy --video-codec-options=i-frame-interval:float=1.5

cf https://developer.android.com/reference/android/media/MediaFormat#KEY_I_FRAME_INTERVAL

@Uzver123
Copy link
Author

Uzver123 commented Apr 17, 2024

Would be nice if you could add command line to the video encoder so we can pass custom command line options to codec without need to request each individual one as feature.

Tested, you correct keyframe is there its just every 20 seconds not 10 in my case and i never waited so long on my test.

This option already exists: --video-codec-options:

Oh nice

Is there way to disable auto focus and or set manual focus distance, i know this is probably not done trough the codec.

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