video - Rendering Performance ffmpeg of JAVACV on Android -
i doing application creates video using set of photos saved in sd-card. problem trying fix application crashes when create videos. crashes depends of resolution of source picture files. example, can render video using 400 images resolution of 320x480 can 25-frames video using images resolution of 2500x3200.
i doing rendering process in background using asynctask (for providing feedback user , maintain informed of rendering process). when rendering process crashes no warnings/errors/etc captured in logcat. using ddms examining memory usage can not view memory leak (i not recieve memory warning on logcat). reasons supose may problem related ffmpeg libraries (but have no idea).
i have testet different codecs defined on avcodec.java, like:
av_codec_id_mpeg1video = 1, av_codec_id_mpeg2video = 2, av_codec_id_h263 = 5, av_codec_id_mjpeg = 8,
etc
trying lossless video codecs seems not doing effect, , errors when try codecs.
i running application on sony ericsson xperia arc (1ghz cpu, 320mb intern memory).
i not know if smartphone has enough power render long hd video, see in market there app's droid timelapse can it.
any suggestion appreciated have no idea how can fix that.
thank you.
ok, have found solution, not originating problem.
to create video using sort of code like:
ffmpegframerecorder recorder = new ffmpegframerecorder(name,width,heigth); recorder.start() while(imagesinfolder){ iplimage img = highgui.cvloadimage("/path/to/image[i].jpg") recorder.record(img) i++; }
it seems create memory problem, maybe because iplimage not cleaned garbage collector.
my solution use, instead of highgui.cvloadimage, method: opencv_core.cvloadimage(img); , then, opencv_core.cvreleaseimage(img); in every iteration.
ffmpegframerecorder recorder = new ffmpegframerecorder(name,width,heigth); recorder.start() while(imagesinfolder){ iplimage img = opencv_core.cvloadimage("/path/to/image[i].jpg") recorder.record(img) img.cvreleaseimage(); i++; }
using it, poblems have disappeared , can render long videos witout issues.
Comments
Post a Comment