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

MediaFormatValidator.validateAudioOutputFormat validates the inputFormat instead of outputFormat #69

Open
edwardotis opened this issue Oct 30, 2018 · 2 comments

Comments

@edwardotis
Copy link
Contributor

I'm using Android720pFormatStrategy and getting a runtime exception on short video created in an Android 8.0.0 Nexus 5X emulator.

Input audio format:
{sample-rate=8000, track-id=2, durationUs=2200000, mime=audio/3gpp, channel-count=1, language=```, max-input-size=52}

Output audio format:
{max-bitrate=192, sample-rate=8000, mime=audio/mp4a-latm, channel-count=2, bitrate=192, csd-0=java.nio.HeapByteBuffer[pos=0 lim=2 cap=2]}

// validateVideoOutputFormat correctly gets passed the output format
MediaFormatValidator.validateVideoOutputFormat(mVideoTrackTranscoder.getDeterminedFormat())
https://github.com/ypresto/android-transcoder/blob/master/lib/src/main/java/net/ypresto/androidtranscoder/engine/VideoTrackTranscoder.java#L97

//validateAudioOutputFormat gets passed the input format. This looks like a bug. It should be using the output format variable for validating the output format. MediaFormatValidator.validateAudioOutputFormat(mAudioTrackTranscoder.getDeterminedFormat());
https://github.com/ypresto/android-transcoder/blob/master/lib/src/main/java/net/ypresto/androidtranscoder/engine/AudioTrackTranscoder.java#L82

error:
10-29 18:03:01.988 9457-9599/com.yahoo.mobile.client.android.tripod.demo.exposure E/MediaTranscoder: Fatal error while transcoding, this might be invalid format or bug in engine or Android.
net.ypresto.androidtranscoder.engine.InvalidOutputFormatException: Audio codecs other than AAC is not supported, actual mime type: audio/3gpp
at net.ypresto.androidtranscoder.engine.MediaFormatValidator.validateAudioOutputFormat(MediaFormatValidator.java:47)
at net.ypresto.androidtranscoder.engine.MediaTranscoderEngine$1.onDetermineOutputFormat(MediaTranscoderEngine.java:163)
at net.ypresto.androidtranscoder.engine.QueuedMuxer.onSetOutputFormat(QueuedMuxer.java:66)
at net.ypresto.androidtranscoder.engine.QueuedMuxer.setOutputFormat(QueuedMuxer.java:61)
at net.ypresto.androidtranscoder.engine.VideoTrackTranscoder.drainEncoder(VideoTrackTranscoder.java:207)
at net.ypresto.androidtranscoder.engine.VideoTrackTranscoder.stepPipeline(VideoTrackTranscoder.java:105)
at net.ypresto.androidtranscoder.engine.MediaTranscoderEngine.runPipelines(MediaTranscoderEngine.java:191)
at net.ypresto.androidtranscoder.engine.MediaTranscoderEngine.transcodeVideo(MediaTranscoderEngine.java:97)
at net.ypresto.androidtranscoder.MediaTranscoder$4.call(MediaTranscoder.java:184)
at net.ypresto.androidtranscoder.MediaTranscoder$4.call(MediaTranscoder.java:166)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)

@edwardotis edwardotis changed the title AudioTrackTranscoder#getDeterminedFormat returns inputFormat instead of outputFormat MediaFormatValidator.validateAudioOutputFormat validates the inputFormat instead of outputFormat Oct 30, 2018
@edwardotis
Copy link
Contributor Author

edwardotis commented Oct 31, 2018

@ypresto I've created a PR with a fix to the issue. Can you take a look? Thanks
#70

...

@edwardotis
Copy link
Contributor Author

bump

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

1 participant