question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Camera request: still/freeze frame during takePhotoAsync

See original GitHub issue

As requested by the react-native-camera team, I’m opening a duplicate issue here. Full description copied below of https://github.com/react-native-community/react-native-camera/issues/1438.


I’d like to be able to capture a photo and have the experience be similar to the built in camera. Currently, the video preview continues beyond pressing the shutter & then a preview will show a prior frame from the video. This feels very odd when using the camera vs. the native experience.

Steps to reproduce

  1. With a mounted RNCamera component, call takePhotoAsync
  2. Replace component w/ <Image source={ ... } /> with the uri from the capture

Does it work with Expo Camera?

It probably works the same way. I’ll open an issue there as well.

Expected behaviour

The (video) preview should be able to be frozen during the capture of the still image to mimic what happens when using the built in camera. (At least on iOS, that’s how it works. I presume Android is the same, but don’t have a device.)

Actual behaviour

The component continues to show the video preview beyond what will be the actual captured image leading to an inconsistent user experience vs. the built in camera.

Environment

  • Node.js version: 9.5.0
  • React Native version: 0.54.2
  • React Native platform + platform version: iOS 11.2.5

react-native-camera

Version: 1.0.2

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
wbyoungcommented, Apr 6, 2018

@aalices, okay that sounds great. I missed this comment earlier and started taking a stab at it (at least on iOS). A PR is open on react-native-camera at https://github.com/react-native-community/react-native-camera/pull/1442. Maybe it’ll provide you with a place to start, but what I did is all pretty straight forward & really just a quick hack to get thing working. Your solution sounds better thought out and more elegant.

One thing I didn’t note over there that I did find, though, was a recommendation to simply disable the underlying connection rather than stopping the preview entirely on iOS. Basically:

[self.previewLayer connection].enabled = FALSE;

// instead of

[self.session stopRunning];

Both appeared to work, but I went with the latter since it was already done in a prior PR for react-native-camera.

0reactions
Okipacommented, Mar 29, 2019

This work well on iOS but prevent Android to do something in onPictureSaved.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Freeze Frame on Preset Recall - PTZOptics Knowledge Base
I read within the manual for the 20X that it is possible to set up the camera to freeze frame before switching to...
Read more >
How do I freeze a frame? - Splice Help Center
Open the video with the frame to be frozen in your Camera Roll; Play the video and pause at the specific frame; Tap...
Read more >
Photo Freeze Frame Effect in Video | Final Cut Pro Tutorial
Pause the action in your video by using a freeze frame effect in Final Cut Pro. In this tutorial, we'll learn two ways...
Read more >
Create A Photo Freeze Frame Effect | PowerDirector - YouTube
This PowerDirector 20 / 365 photo freeze frame tutorial teaches you how to use a snapshot, a transition, a camera overlay and keyframes...
Read more >
iphone - Immediately freeze-frame an AVCaptureSession
I've tried calling [session stopRunning] right after I request a still image capture, but this leads to unpredictable results; the still image ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found