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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

bitrate missing in MediaFormat (Nexus 5 - Android 6.0.1) #15

Closed
carlosmonzon opened this issue Aug 6, 2019 · 7 comments 路 Fixed by #29
Closed

bitrate missing in MediaFormat (Nexus 5 - Android 6.0.1) #15

carlosmonzon opened this issue Aug 6, 2019 · 7 comments 路 Fixed by #29

Comments

@carlosmonzon
Copy link

carlosmonzon commented Aug 6, 2019

Hi 馃憢 ,

I've got this exception while testing with a Nexus 5 (Android 6.0.1)

E/Transcoder: Fatal error while transcoding, this might be invalid format or bug in engine or Android. java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.Integer.intValue()' on a null object reference at android.media.MediaFormat.getInteger(MediaFormat.java:591) at com.otaliastudios.transcoder.strategy.DefaultAudioStrategy.getAverageInputBitRate(DefaultAudioStrategy.java:66) at com.otaliastudios.transcoder.strategy.DefaultAudioStrategy.createOutputFormat(DefaultAudioStrategy.java:39) at com.otaliastudios.transcoder.engine.Engine.computeTrackStatus(Engine.java:128) at com.otaliastudios.transcoder.engine.Engine.transcode(Engine.java:309) at com.otaliastudios.transcoder.Transcoder$1.call(Transcoder.java:121) at com.otaliastudios.transcoder.Transcoder$1.call(Transcoder.java:111) at java.util.concurrent.FutureTask.run(FutureTask.java:237) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)

I had the chance to debug it and I found that the mediaformat map doesn't have any bitrate key, which is causing the issue. I tested with another device and everything is good. Can we have a default bitrate in this case?

mediaformat map:

"max-input-size" -> {Integer@4429} 355
"aac-profile" -> {Integer@4431} 2
"mime" -> "audio/mp4a-latm"
"durationUs" -> {Long@4435} 43733333
"csd-0" -> {ByteArrayBuffer@4437} "java.nio.ByteArrayBuffer[position=0,limit=2,capacity=2]"
"channel-count" -> {Integer@4439} 1
"sample-rate" -> {Integer@4441} 48000
@natario1
Copy link
Owner

Do you know of some way to estimate bit rate for AAC audio tracks? Like we're doing for video in DefaultVideoStrategy.

@carlosmonzon
Copy link
Author

carlosmonzon commented Aug 19, 2019

@natario1 not really. I did a test using a default bitrate and it works on the nexus 5 but did also test with several android devices and sometimes the sample-rate is missing too.

@natario1
Copy link
Owner

@carlosmonzon could you or @martykan or anyone else here provide a video file that has this issue?

@carlosmonzon
Copy link
Author

@natario1 Here is the link for the video file. It was taken using a Nexus 5 (Android 6.0.1)
https://drive.google.com/file/d/1bMc7UvNGZtdwHZjREDJinU19iHULiiw3/view

@natario1
Copy link
Owner

natario1 commented Oct 1, 2019

I have downloaded this file through the link and tried, but I have found no issue. Can you confirm it is the right one?

@natario1
Copy link
Owner

natario1 commented Oct 1, 2019

I was able to reproduce this on API 23, thanks!

@carlosmonzon
Copy link
Author

@natario1 I'm was able to test with the latest version 0.7.2 and it is working using the same device and video file. Thank you!

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

Successfully merging a pull request may close this issue.

2 participants