buffer - Save real time video recording to sd-card using Local Socket in Android - Video not playable -
trying capture video , save sd card in mp4/3gp formats using local socket. beingness able write bytes bytes sd card video file not playable.i have gone through many examples :
https://github.com/fyhertz/spydroid-ipcamera
https://github.com/mconf/sipdroid
and many more. have noticed people suggesting might problem of file's header. tried skip "mdat" info header:
private void skipheader() throws ioexception { // skip atoms preceding mdat atom byte[] buffer = new byte[3]; while (true) { while (mreceiver.getinputstream().read() != 'm'); mreceiver.getinputstream().read(buffer,0,3); if (buffer[0] == 'd' && buffer[1] == 'a' && buffer[2] == 't') break; } }
at lastly nil worked me.what need making video files playable using local socket
from explanation, have in mind implement screen recorder. of course of study intention scheme have implemented part of technology software offering.
in such case, best approach improve exist, incorporating code new features or new performance , giving credit original source came across , included part of software - expected. beauty of open source, allows code reused, distributed , improved.
at github there plenty of projects... know, nice , others awesome. particular case, suggestion utilize existing code allows streaming recording scheme capture video, writing without need root device, final users not interested void warranty of newly purchased device run software.
it of import accomplish speed allows @ to the lowest degree capturing 20 screen per sec in android different screen sizes, providing resolution , low cpu usage. these characteristics maintain solution stable , still looking stone solid.
i think best approach can take, save time , lots of headaches, incorporate "sji-android-screen-capture" code part of project. if target devices android 4.2~4.4, go supports these android versions. more info , source code itself, find available @ github repository. alternatively, can utilize android screencapture sample capture device screen in real time.
android buffer mp4 video-recording localsocket
No comments:
Post a Comment