android - jcodec Permission Denied for NIOUtils.readableFileChannel -


i'm trying use jcodec frames mp4 on emulator. have following permissions in manifest:

<uses-permission android:name="android.permission.write_external_storage"/> <uses-permission android:name="android.permission.read_external_storage" /> <uses-permission android:name="android.permission.write_internal_storage" /> <uses-permission android:name="android.permission.read_internal_storage" /> 

the file through adb shell looks this:

root@generic_x86_64:/sdcard/download # pwd /sdcard/download root@generic_x86_64:/sdcard/download # ls -la -rwxrwx--x root     sdcard_rw 19967250 2015-10-12 16:39 hummingbird.mp4 

i've tried doing chmod 777 hummingbird.mp4, doesn't change last set of permissions reason?

the following code produces exception below.

string basedir = environment.getexternalstoragedirectory().getabsolutepath(); string fn = basedir + "/download/hummingbird.mp4"; // test dir make sure i'm in right place string dir = basedir + "/download"; file fdir = new file(dir); log.i("tag", "fdir.isdir()=" + fdir.isdirectory()); // true filemp4 = new file(fn); try {    ch = nioutils.readablefilechannel(filemp4); // line 220 in trace below } catch (filenotfoundexception e) {    e.printstacktrace(); } 

i did filemp4.exists() returns true.

exception

10-14 23:32:27.090 4595-4595/medloh.com.mp4frames w/system.err: java.io.filenotfoundexception: /storage/1f1a-300c/download/hummingbird.mp4: open failed: eacces (permission denied) 10-14 23:32:27.090 4595-4595/medloh.com.mp4frames w/system.err:     @ libcore.io.iobridge.open(iobridge.java:452) 10-14 23:32:27.090 4595-4595/medloh.com.mp4frames w/system.err:     @ java.io.fileinputstream.<init>(fileinputstream.java:76) 10-14 23:32:27.090 4595-4595/medloh.com.mp4frames w/system.err:     @ org.jcodec.common.nioutils.readablefilechannel(nioutils.java:336) 10-14 23:32:27.090 4595-4595/medloh.com.mp4frames w/system.err:     @ medloh.com.mp4frames.mainactivity.onactivityresult(mainactivity.java:220) 10-14 23:32:27.090 4595-4595/medloh.com.mp4frames w/system.err:     @ android.app.activity.dispatchactivityresult(activity.java:6428) 10-14 23:32:27.090 4595-4595/medloh.com.mp4frames w/system.err:     @ android.app.activitythread.deliverresults(activitythread.java:3695) 10-14 23:32:27.090 4595-4595/medloh.com.mp4frames w/system.err:     @ android.app.activitythread.handlesendresult(activitythread.java:3742) 10-14 23:32:27.090 4595-4595/medloh.com.mp4frames w/system.err:     @ android.app.activitythread.-wrap16(activitythread.java) 10-14 23:32:27.090 4595-4595/medloh.com.mp4frames w/system.err:     @ android.app.activitythread$h.handlemessage(activitythread.java:1393) 10-14 23:32:27.090 4595-4595/medloh.com.mp4frames w/system.err:     @ android.os.handler.dispatchmessage(handler.java:102) 10-14 23:32:27.090 4595-4595/medloh.com.mp4frames w/system.err:     @ android.os.looper.loop(looper.java:148) 10-14 23:32:27.090 4595-4595/medloh.com.mp4frames w/system.err:     @ android.app.activitythread.main(activitythread.java:5417) 10-14 23:32:27.090 4595-4595/medloh.com.mp4frames w/system.err:     @ java.lang.reflect.method.invoke(native method) 10-14 23:32:27.090 4595-4595/medloh.com.mp4frames w/system.err:     @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:726) 10-14 23:32:27.090 4595-4595/medloh.com.mp4frames w/system.err:     @ com.android.internal.os.zygoteinit.main(zygoteinit.java:616) 10-14 23:32:27.090 4595-4595/medloh.com.mp4frames w/system.err: caused by: android.system.errnoexception: open failed: eacces (permission denied) 10-14 23:32:27.090 4595-4595/medloh.com.mp4frames w/system.err:     @ libcore.io.posix.open(native method) 10-14 23:32:27.090 4595-4595/medloh.com.mp4frames w/system.err:     @ libcore.io.blockguardos.open(blockguardos.java:186) 10-14 23:32:27.090 4595-4595/medloh.com.mp4frames w/system.err:     @ libcore.io.iobridge.open(iobridge.java:438) 10-14 23:32:27.090 4595-4595/medloh.com.mp4frames w/system.err:     ... 14 more 

see problems code/configuration?

i able 'nioutils.readablefilechannel(filemp4)' statment working creating file @ /data/tmp/hummingbird.mp4 (adb push). not sure if it's /sdcard , symbolic links, or maybe needed make sure directories , file owned system instead of root.

anyway, i'm on other issues , problems decoding mp4 that's story.


Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -