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

NoSupport [codec.profileLevel, avc1.4D401F, video/avc] [OMX.google.h264.decoder, video/avc] #1638

Closed
longuto opened this issue Nov 12, 2024 · 14 comments

Comments

@longuto
Copy link

longuto commented Nov 12, 2024

i use a old machine in Android 5.1.1 , It ok when I use hight machine. the error is NoSupport [codec.profileLevel, avc1.4D401F, video/avc] [OMX.google.h264.decoder, video/avc]

@pedroSG94
Copy link
Owner

Hello,

Are you using from file streaming?
Can you tell me more info about it? Show me the log of this code:

for (String s: CodecUtil.showAllCodecsInfo()) {
      Log.e("Pedro", s);
}

And tell me the video info about the file used (resolution, codec, profile, etc. You can get all info using ffmpeg or similar). You can share the file if you want.
Also, try with other video file created with the device that fail.

@longuto
Copy link
Author

longuto commented Nov 13, 2024

genericStream = GenericStream(baseContext, this, NoVideoSource(), MicrophoneSource()).apply {
getGlInterface().setForceRender(true, 15)
}
prepared = try {
genericStream.prepareVideo(width, height, vBitrate, rotation = rotation) &&
genericStream.prepareAudio(sampleRate, isStereo, aBitrate,
echoCanceler = true,
noiseSuppressor = true
)
} catch (e: IllegalArgumentException) {
false
}

fun prepareStream(resultCode: Int, data: Intent): Boolean {
keepAliveTrick()
stopStream()
mediaProjection?.stop()
val mediaProjection = mediaProjectionManager.getMediaProjection(resultCode, data)
this.mediaProjection = mediaProjection
val screenSource = ScreenSource(applicationContext, mediaProjection)
return try {
//ScreenSource need use always setCameraOrientation(0) because the MediaProjection handle orientation.
//You also need remove autoHandleOrientation if you are using it.
//You need to call it after prepareVideo to override the default value.
genericStream.getGlInterface().setCameraOrientation(0)
genericStream.changeVideoSource(screenSource)
// toggleAudioSource(selectedAudioSource)
genericStream.changeAudioSource(MicrophoneSource())
true
} catch (ignored: IllegalArgumentException) {
false
}
}

no use file streaming, use ScreenSource. I think the issue is related to my machine, as I'm using an old ARM machine. It works fine on higher version machines, and now I just want to know if there's a way to make it compatible with mine.

@pedroSG94
Copy link
Owner

If you are using ScreenSource i don't understand this:

[OMX.google.h264.decoder, video/avc]

Only from file source use decoders. Can you share me a full logcat to get more info about it?

@longuto
Copy link
Author

longuto commented Nov 13, 2024

test.txt
this is CodecUtil.showAllCodecsInfo logcat

@longuto
Copy link
Author

longuto commented Nov 13, 2024

full.txt
this is full logcat

@pedroSG94
Copy link
Owner

pedroSG94 commented Nov 13, 2024

Ok, you only have 1 encoder:

Name: OMX.rk.video_encoder.avc
                                                                                                    Type: video/avc
                                                                                                    ----- Encoder info -----
                                                                                                    Complexity range: 0 - 0
                                                                                                    CBR supported: false
                                                                                                    VBR supported: true
                                                                                                    CQ supported: false
                                                                                                    ----- -----
                                                                                                    ----- Video info -----
                                                                                                    Supported colors: 
                                                                                                    2135033992
                                                                                                    19
                                                                                                    21
                                                                                                    2130708361
                                                                                                    Profile: 1, level: 1
                                                                                                    Profile: 1, level: 2
                                                                                                    Profile: 1, level: 4
                                                                                                    Profile: 1, level: 8
                                                                                                    Profile: 1, level: 16
                                                                                                    Profile: 1, level: 32
                                                                                                    Profile: 1, level: 64
                                                                                                    Profile: 1, level: 128
                                                                                                    Profile: 1, level: 256
                                                                                                    Profile: 1, level: 512
                                                                                                    Profile: 1, level: 1024
                                                                                                    Profile: 1, level: 2048
                                                                                                    Profile: 1, level: 4096
                                                                                                    Profile: 1, level: 8192
                                                                                                    Profile: 1, level: 16384
                                                                                                    Profile: 1, level: 32768
                                                                                                    Profile: 2, level: 1
                                                                                                    Profile: 2, level: 2
                                                                                                    Profile: 2, level: 4
                                                                                                    Profile: 2, level: 8
                                                                                                    Profile: 2, level: 16
                                                                                                    Profile: 2, level: 32
                                                                                                    Profile: 2, level: 64
                                                                                                    Profile: 2, level: 128
                                                                                                    Profile: 2, level: 256
                                                                                                    Profile: 2, level: 512
                                                                                                    Profile: 2, level: 1024
                                                                                                    Profile: 2, level: 2048
                                                                                                    Profile: 2, level: 4096
                                                                                                    Profile: 2, level: 8192
                                                                                                    Profile: 2, level: 16384
                                                                                                    Profile: 2, level: 32768
                                                                                                    Profile: 8, level: 1
                                                                                                    Profile: 8, level: 2
                                                                                                    Profile: 8, level: 4
                                                                                                    Profile: 8, level: 8
                                                                                                    Profile: 8, level: 16
                                                                                                    Profile: 8, level: 32
                                                                                                    Profile: 8, level: 64
                                                                                                    Profile: 8, level: 128
                                                                                                    Profile: 8, level: 256
                                                                                                    Profile: 8, level: 512
                                                                                                    Profile: 8, level: 1024
                                                                                                    Profile: 8, level: 2048
                                                                                                    Profile: 8, level: 4096
                                                                                                    Profile: 8, level: 8192
                                                                                                    Profile: 8, level: 16384
                                                                                                    Profile: 8, level: 32768
                                                                                                    Bitrate range: 1 - 40000000
                                                                                                    Frame rate range: 0 - 960
                                                                                                    Width range: 176 - 1920
                                                                                                    Height range: 144 - 1088

As you can see the max resolution supported is 1920x1080. I assume that the problem is that you receive an error or return false in prepareVideo.
Can you share a logcat of all from you create the stream class to you call start stream or get the error?
Also share me the parameters used in prepareVideo method.

@pedroSG94
Copy link
Owner

full.txt this is full logcat

Ok, the problem is not related with the video, it is related with the audio. Your audio encoder is not working properly and you are not producing audio frames. For that reason the server close connection with you.

First of all try reset the device. Also try use a different configuration in prepareAudio method.

@longuto
Copy link
Author

longuto commented Nov 13, 2024

I am using the example code. How should I modify it? if i not use audio,how should i do
Uploading code.txt…

@pedroSG94
Copy link
Owner

pedroSG94 commented Nov 13, 2024

I tried to do a fix for it.
Try to compile the example in this branch:
#1640
Or use this gradle:

  implementation 'com.github.pedroSG94.RootEncoder:library:bed8cd205e'

Let me know if this solve the error.

@longuto
Copy link
Author

longuto commented Nov 13, 2024

it is error ,
logcat.txt
if i not use audio,how should i do

@pedroSG94
Copy link
Owner

pedroSG94 commented Nov 13, 2024

This error:

java.net.ConnectException: failed to connect to rtmp.teachain.net/47.96.248.18 (port 1935): isConnected failed: EHOSTUNREACH (No route to host)

Should be received in onConnectionFailed. It is not a crash, this only notify you the reason about the connection failed that is because the server is not available from your network (No route to host).

@pedroSG94
Copy link
Owner

This case:

it is error , logcat.txt if i not use audio,how should i do

And this case:

full.txt this is full logcat

Are not related. The second case could be a bug, the the first case is a connection problem so the library is working as expected for this first case.

@longuto
Copy link
Author

longuto commented Nov 13, 2024

There should be an error causing the RTMP push to fail. It works fine when I push from the emulator, but the error only occurs on this device.

@longuto
Copy link
Author

longuto commented Nov 13, 2024

Thank you, it's resolved now. It was my own mistake.

@longuto longuto closed this as completed Nov 13, 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