Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Video timer inconsistencies #65

Closed
UGhari opened this issue Oct 13, 2017 · 4 comments
Closed

Video timer inconsistencies #65

UGhari opened this issue Oct 13, 2017 · 4 comments

Comments

@UGhari
Copy link

UGhari commented Oct 13, 2017

I know you have already closed an issue similar to this, but I think you would understand best how to approach such an issue as you know how all of your code works. As the title says after hitting record I show a time elapsed.

I have used CountDownTimer:

`new CountDownTimer(10000, 1000) {

                    public void onTick(long millisUntilFinished) {
                        forcePressNext = true;
                        timerVideo.setText(20-millisUntilFinished/1000 + "s");
                    }

                    public void onFinish() {
                        timerVideo.setText("10s!");
                        if (forcePressNext == true) {
                            isRecording = false;
                            cameraView.stopCapturingVideo();
                        }
                    }
                }.start();`

It is quite inconsistent by 2/3s and the inconsistency gets larger on older devices, have you got any ideas?

thanks

@natario1
Copy link
Owner

No, surely there is a delay between the moment you call startVideo and the moment the recording actually start (we must setup recording), and between endVideo and the moment it actually ends.

I don't know if and how this could be improved.

@UGhari
Copy link
Author

UGhari commented Oct 13, 2017

I shall investigate further and let you know if I find anything

@Barai-Vivek
Copy link

This is not a good way but i solved my problem.
It did work for me in when i tried to 1500 milliseconds to my desired seconds
for example if you want 5 sec video you need (5000+1500) milliseconds it worked for me in motorola and asus devices.

            long capturesec =  (5*1000)+1500;
            //for 5 sec = 6500
            //for 10 sec 11500
            //for 15 sec 16500
           cameraView.startCapturingVideo(file);
            new CountDownTimer(capturesec, 1000) {
                public void onTick(long millisUntilFinished) {
                    txtTime.setText("00:0" + ((millisUntilFinished-1500) / 1000));
                }

                public void onFinish() {
                    txtTime.setText("00:00");
                    cameraView.stopCapturingVideo();
                  
                }
            }.start();

@Aks-4125
Copy link

@natario1 any update for this issue? I am still facing same issue. video duration is different than countdown timer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants