Well I have a same problem and no one seems to know what is going on.. 
Google themselves dont even know how to update samples with their stupid 
updates for sdks.. I implemented the camera into my app but once you stop 
recording the video it saves the file with 0 bytes and that's all.. Have no 
idea why it is happening or how to change anything.. Blame google for this 
poor documentation.

On Sunday, April 10, 2016 at 6:35:30 PM UTC+1, David Karr wrote:
>
> I managed to find a good video app sample at 
> https://github.com/googlesamples/android-Camera2Video .  I forked this to 
> make some simple utilitarian changes.  The result is functional, but not 
> pretty at all.  For what I'm using it for, pretty isn't important.
>
> My fork of this is at 
> https://github.com/davidmichaelkarr/android-Camera2Video/tree/refinements 
> .  I would paste some of the code from that here, but it might be more 
> effective to just have you look at the code there.
>
> What was surprising is that when I stop the video recording, it correctly 
> saves the video, but when I look in the filesystem, I see both the real 
> video and a zero-length video file.  The timestamp on the zero-length file 
> is a few seconds later than the real video file.
>
> I guess I understand why this is happening, but I'm not certain of the 
> best way to resolve this.
>
> The way the app is structured, the File to write the video to is set up 
> when preview is initiated.  The file isn't written to unless I start 
> recording video.  As a result, the file on disk is actually created when I 
> start preview mode, even if I don't record a video that time that I started 
> the app.
>
> One possible strategy for cleaning up that zero-length file is somehow 
> removing the file in "onPause" (or some variation of that).  Basically, to 
> remove the file when I "stop using the app".
>
> It might be cleaner to set up the file only when I start recording, but 
> I'm not sure how to properly structure that to make that happen.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/b7c3519f-cf31-482b-baab-e7eb4c13a2f0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to