video compression using silicompressor in android not working -


i trying compress videos in project therefore using silicompressor. when pass destination path application gets , hang , nothing. create folder in storage , stores video file when try play it, gives error "failed play video". , file has size of 24 bytes. take , tell have done wrong.

here code.

file destinationpath = new file("/storage/emulated/0/dcim/camera/myvideo");             destinationpath.mkdir();             file file = new file(destinationpath.getabsolutepath());             toast.maketext(post.this, "folder: " + file, toast.length_short).show();              try {                 filepath = silicompressor.with(post.this).compressvideo(videouri, file.tostring());                 video.setvideouri(uri.parse(filepath));                 toast.maketext(post.this, "completed", toast.length_short).show();             } catch (urisyntaxexception e) {                 log.d("exception", e.tostring());                 toast.maketext(post.this, e.getmessage(), toast.length_short).show();                 e.printstacktrace();             } 

try running compression code using asynctask

here can find demo app code video compression.


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -