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

I got SPS profile_idc 100, can I set profile_idc 66 (baseline)? #510

Closed
likezjuisee opened this issue Apr 25, 2019 · 5 comments
Closed

I got SPS profile_idc 100, can I set profile_idc 66 (baseline)? #510

likezjuisee opened this issue Apr 25, 2019 · 5 comments
Labels

Comments

@likezjuisee
Copy link

DRGGAM0850405292.zip
This is H.264 raw data, but Broadway can not parse profile_idc 100 data. Broadway supports profile_idc 66 (baseline). So how can I set the screen data to baseline?

@likezjuisee
Copy link
Author

Or can I encode the screen data with another video format, that will be played in the browser?

@rom1v
Copy link
Collaborator

rom1v commented Jun 6, 2019

Is it sufficient:

diff --git a/server/src/main/java/com/genymobile/scrcpy/ScreenEncoder.java b/server/src/main/java/com/genymobile/scrcpy/ScreenEncoder.java
index c946e99..0265f51 100644
--- a/server/src/main/java/com/genymobile/scrcpy/ScreenEncoder.java
+++ b/server/src/main/java/com/genymobile/scrcpy/ScreenEncoder.java
@@ -143,6 +143,7 @@ public class ScreenEncoder implements Device.RotationListener {
         format.setInteger(MediaFormat.KEY_FRAME_RATE, frameRate);
         format.setInteger(MediaFormat.KEY_COLOR_FORMAT, MediaCodecInfo.CodecCapabilities.COLOR_FormatSurface);
         format.setInteger(MediaFormat.KEY_I_FRAME_INTERVAL, iFrameInterval);
+        format.setInteger(MediaFormat.KEY_PROFILE, MediaCodecInfo.CodecProfileLevel.AVCProfileBaseline);
         // display the very first frame, and recover from bad quality when no new frames
         format.setLong(MediaFormat.KEY_REPEAT_PREVIOUS_FRAME_AFTER, MICROSECONDS_IN_ONE_SECOND * REPEAT_FRAME_DELAY / frameRate); // µs
         return format;

?

https://stackoverflow.com/a/32238984/1987178

@rom1v rom1v added the codec label Jun 6, 2019
@likezjuisee
Copy link
Author

We have resolved this problem, besides KEY_FROFILE, KEY_LEVEL is also needed to set.
Thanks all the same.

@rom1v
Copy link
Collaborator

rom1v commented Jun 11, 2019

OK, thank you for your feedback. 👍

The need seems too specific for adding a command-line option to select the profile/level, and you solved the problem on your side, so I'm closing.

@alligatorme
Copy link

@likezjuisee #1226, it seems to be the final solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants