Android encode video with ffmpeg while it is still recording -


i want develop android aplication allows me continuously record video , upload parts of video server without stopping recording. crucial application can record 60 min without stopping video.

initial approach

application consits of 2 parts:

  1. mediarecorder records video continuously camera.
  2. cutter/copy - part: while video recorded have take out segments , send them server. part implemented using http://ffmpeg4android.netcompss.com/
    libffmpeg.so. used videokit wrapper allows me directly run ffmpeg params need.

my problem

i tried ffmpeg command params

ffmpeg -ss 00:00:03 -i <in-file> -t 00:00:05 -vcodec copy -acodec copy <out-file>  

which worked great me long android's mediarecorder finished recording.

when execute same command, while mediarecorder recording file, ffmpeg exits error message "operation not permitted".

  • i think error message doesn't mean android prevents access file. think ffmpeg needs "moov-atoms" find proper position in video.

for reason thought of other approaches (which don't need moov-atom):

  1. create rtsp stream android , access rtsp stream later. problem knowledge android sdk doesn't support recording rtsp stream.
  2. maybe possible access camera directly ffmpeg (/dev/video0 seems video device?!)
  3. i read webm alternative streaming, maybe android can record webm streams?!

tldr: long didn't read:

i want access video file ffmpeg (libffmpeg.so) while recording. fffmpeg exits error message "operation not permitted"

goal:

my goal record video (and audio) , take parts of video while still recording , upload them server.

maybe can me solve probelm or have other ideas on how approach problem.

thanks lot in advance.

your real time requirement may lead away ffmpeg webrtc , or html5.

some resources;

http://dev.w3.org/2011/webrtc/editor/getusermedia.html (section5)

https://github.com/lukeweber/webrtc-jingle-client

ondello .. have api

rather going native , trying @ video stream or getting @ framebuffer acquire xcopy of in video buffer, , duplicate stream manage connection (socket or chunked http), may want @ api type alternatives....


Comments