Transcoder icon indicating copy to clipboard operation
Transcoder copied to clipboard

java.lang.IllegalStateException: No retriever available

Open daviduzan opened this issue 3 years ago • 2 comments

Trying to transcode a video which for some reason doesn't have geo location data the transcoder fail, but could continue without a special issue.

Just changing the current implementation in DefaultDataSource.java line 251 from:

@Nullable @Override public double[] getLocation() { LOG.i("getLocation()"); String string = mMetadata.extractMetadata(METADATA_KEY_LOCATION); if (string != null) { float[] location = new ISO6709LocationParser().parse(string); if (location != null) { double[] result = new double[2]; result[0] = (double) location[0]; result[1] = (double) location[1]; return result; } } return null; }

To:

@Nullable @Override public double[] getLocation() { LOG.i("getLocation()"); String string = null; try { string = mMetadata.extractMetadata(METADATA_KEY_LOCATION); } catch (Exception e) { LOG.e("getLocation Exception", e); } if (string != null) { ....

To avoid this exception: '' java.lang.IllegalStateException: No retriever available at android.media.MediaMetadataRetriever.nativeExtractMetadata(Native Method) at android.media.MediaMetadataRetriever.extractMetadata(MediaMetadataRetriever.java:399) ''

And everything works fine.

daviduzan avatar Jul 29 '21 12:07 daviduzan

Hey, feel free to open a PR!

natario1 avatar Jul 29 '21 13:07 natario1

This looks like a duplicate of https://github.com/natario1/Transcoder/issues/146

millsjustin avatar Aug 19 '21 23:08 millsjustin