Transcoder
Transcoder copied to clipboard
java.lang.IllegalStateException: No retriever available
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.
Hey, feel free to open a PR!
This looks like a duplicate of https://github.com/natario1/Transcoder/issues/146