I am on Android 4.2 and calling MediaExtractor.setDataSource, and it sometimes throws an IOException from "failed to create an extractor instance". I found where this is selected from a C ++ implementation, but this did not help.
Other people with the same problem and neither answer nor answer that do not help me:
android.media.MediaExtractor. Has anyone made this beast work? "Failed to create extractor instance" Exception
show media extractor "failed to create an extractor instance
Failed to create mediaextractor instance using setDataSource ()
In a desperate attempt to figure this out, I wrote a small little application that I could demonstrate this:
public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } @Override public boolean onCreateOptionsMenu(Menu menu) {
There is one button in action for this application that calls "doStuff". The result is as follows:
05-12 15:27:42.639: E/Andy(18757): trying file [aaitn.mp4] 05-12 15:27:42.689: E/Andy(18757): splat Failed to instantiate extractor. 05-12 15:27:42.689: E/Andy(18757): trying file [unusual aspect.mp4] 05-12 15:27:42.709: E/Andy(18757): trying file [test.mp4] 05-12 15:27:55.039: E/Andy(18757): trying file [aaitn.mp4] 05-12 15:27:55.119: E/Andy(18757): trying file [unusual aspect.mp4] 05-12 15:27:55.149: E/Andy(18757): trying file [test.mp4] 05-12 15:28:03.209: E/Andy(18757): trying file [aaitn.mp4] 05-12 15:28:03.259: E/Andy(18757): splat Failed to instantiate extractor. 05-12 15:28:03.259: E/Andy(18757): trying file [unusual aspect.mp4] 05-12 15:28:03.279: E/Andy(18757): trying file [test.mp4] 05-12 15:28:12.289: E/Andy(18757): trying file [aaitn.mp4] 05-12 15:28:12.379: E/Andy(18757): trying file [unusual aspect.mp4] 05-12 15:28:12.419: E/Andy(18757): trying file [test.mp4] 05-12 15:28:17.879: E/Andy(18757): trying file [aaitn.mp4] 05-12 15:28:17.929: E/Andy(18757): trying file [unusual aspect.mp4] 05-12 15:28:17.949: E/Andy(18757): splat Failed to instantiate extractor. 05-12 15:28:17.949: E/Andy(18757): trying file [test.mp4]
This confuses a few calculations.
- Sometimes it works, and sometimes not
- Failed to make the first attempt.
Now I'm sure that other people use this interface, and it works for them, which either means that the devices I use (MK808) have broken the firmware, or there is a trick that I donβt have to make it reliable. Does anyone have any ideas?
The log code is surprisingly clear, except when the GC starts up and the synchronization of the GC does not correlate with the problem.
change
I changed my button so that it starts a thread that iterates over 1000 times across all three files. Everything went without problems. Big scratch. I found that if I shake the mouse while this thread is running, it starts to crash, but it starts to work again as soon as I let go. The launch of another thread, which simply interferes with doing math for a while, did not cause this. In the real world, this application has come; removing the mouse does not make the problem go away, but it is a great application and does many other things too.