Save real time video recording to sd-card using Local Socket in Android - Video not playable

  • Replies:0
Suvrajit Banerjee
  • Forum posts: 2

Jun 27, 2014, 9:18:35 AM via Website

------------------------------------
Save real time video recording to sd-card using Local Socket in Android - Video not playable

Trying to capture a video and save it to sd card in Mp4/3gp formats using local socket. Being able to write bytes by bytes to sd card but the video file is not playable.I have gone through many examples :

  • Edit: Links to external sources are not allowed *

and many more. I have noticed people suggesting this might be a problem of file's header. I tried to skip those "mdat" data too from header:...

private void skipHeader() throws IOException {
// Skip all 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 last nothing worked for me.What extra do I need to do for making those video files playable using Local Socket

---------------------------------------------------

— modified on Jun 27, 2014, 10:03:08 AM by moderator

Reply