video - Android: Save Mediarecorder-Stream as playable file -
i want record videos android device (nexus 10) , upload later youtube.
so far i'am recording android mediarecoder , stream via localsocket save data multiple files. files not playable.
i read articles sine api-level 18 possible convert files mediacodec and/or mediamuxer. , found this code, not understand how handle it.
has easy example shows how convert raw data localsocket playable file (i.e. mp4 files)?
my mediarecoder looks this:
recorder = new mediarecorder(); recorder.setaudiosource(mediarecorder.audiosource.default); recorder.setvideosource(mediarecorder.videosource.default); camcorderprofile camcorderprofile_hq = camcorderprofile.get(camcorderprofile.quality_high); camcorderprofile_hq.fileformat = mediarecorder.outputformat.mpeg_4; camcorderprofile_hq.videocodec = mediarecorder.videoencoder.mpeg_4_sp; recorder.setprofile(camcorderprofile_hq); recorder.setpreviewdisplay(surfaceholder.getsurface()); clientsocket = new localsocket(); clientsocket.connect(new localsocketaddress(socket_address)); recorder.setoutputfile(clientsocket.getfiledescriptor()); recorder.prepare(); recorder.start();
thanks in advance.
i don't think can that. writing mp4 muxed file requires file descriptor seekable. unix sockets not. because muxing mp4 commonly requires muxer seek , forth write indices etc... , cannot done on local sockets.
if can't output file , copy it, might interesting you: http://hello-qd.blogspot.it/2013/05/how-to-process-mediarecorder-frames.html.
Comments
Post a Comment