glt / GIFBuilder

MP4 to GIF
148 stars 41 forks source link

奔溃了。。。 #1

Open YeChenLiu opened 8 years ago

YeChenLiu commented 8 years ago

1446/com.glgjing.gifbuilder E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #1 Process: com.glgjing.gifbuilder, PID: 11230 java.lang.RuntimeException: An error occured while executing doInBackground() at android.os.AsyncTask$3.done(AsyncTask.java:304) at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355) at java.util.concurrent.FutureTask.setException(FutureTask.java:222) at java.util.concurrent.FutureTask.run(FutureTask.java:242) at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) at java.lang.Thread.run(Thread.java:818) Caused by: java.lang.IllegalArgumentException at android.media.MediaMetadataRetriever.setDataSource(MediaMetadataRetriever.java:73) at com.glgjing.gifencoder.BitmapExtractor.createBitmaps(BitmapExtractor.java:24) at com.glgjing.gifbuilder.MainActivity$1$1.doInBackground(MainActivity.java:84) at com.glgjing.gifbuilder.MainActivity$1$1.doInBackground(MainActivity.java:69) at android.os.AsyncTask$2.call(AsyncTask.java:292) at java.util.concurrent.FutureTask.run(FutureTask.java:237) at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)  at java.lang.Thread.run(Thread.java:818) 

921712319 commented 7 years ago

你好,这个问题你解决了吗?我也遇到了这个问题。

yumi0629 commented 7 years ago

@YeChenLiu @921712319 因为例子中 mainActivity中的getRealFilePath()方法获取到的文件路径根本就是错的!!改了就不会报这个错了,但是生成gif图片的时候依然无法生成,会报错:videoFrame is a NULL pointer。这个还在看,而且他最后生成的并不是gif的文件,这个demo简直就是坑!!

YeChenLiu commented 7 years ago

@yumi0629 这么坑 居然还有几十个star!

AtlanGK commented 7 years ago

getRealFilePath的方法有问题,修改这个方法,参照http://blog.csdn.net/guankai1990/article/details/76634350,之后就编过了并且生成了gif

youngmanhua commented 6 years ago

@AtlanGK 有没有解决方案

youngmanhua commented 6 years ago

好像根本不是路径的问题,我直接换成本地路径“/storage/emulated/0/DCIM/Camera/VID_20180108_171805.mp4”还是会奔溃,这个路径是我从adb shell里面一步步找到的,肯定正确