Skip to content
This repository has been archived by the owner on Jun 16, 2023. It is now read-only.

Generating a video thumbnail? #291

Closed
getnashty opened this issue May 20, 2016 · 7 comments
Closed

Generating a video thumbnail? #291

getnashty opened this issue May 20, 2016 · 7 comments

Comments

@getnashty
Copy link

Does anyone have ideas for how to generate a thumbnail of the video being recorded?

I'm trying to Camera.constants.CaptureMode.still as an option into the capture() instance method (as such capture([Camera.constants.CaptureMode.still]), but nothing is happening (the docs specify that it takes options, but also says the arg is just callback, so I'm not clear on this point).

Any ideas?

@getnashty
Copy link
Author

getnashty commented May 20, 2016

Nevermind, seems like the docs specify capture([options]), but should be capture({options})...

So capture({mode: Camera.constants.CaptureMode.still}) is working (but I haven't finished yet).

I'll leave this for anyone searching on thumbnails in the future

@bsiddiqui
Copy link

@getnashty were you able to figure out how to get a thumbnail from the captured video? From the docs it seems like if you pass mode to options the camera will capture a still instead of a video.

@getnashty
Copy link
Author

hi @bsiddiqui - I did figure this out. The way I did it, was unfortunately hack-y. But because there is no video encoding going on before it hits the server, I had no other way of making a thumbnail.

So when someone starts recording, the first thing I do is take a picture, then immediately after start recording a video. So the video might miss a moment, but it works for this use-case.

@matart15
Copy link

matart15 commented Nov 9, 2016

@getnashty Something like this

  startRecording() {
    if (this.camera) {
      this.camera.capture()
        .then((data) => {
          console.log(data)
          this.camera.capture({mode: Camera.constants.CaptureMode.video})
            .then((data) => console.log(data))
            .catch(err => console.error(err));
        })
        .catch(err => console.error(err));
      this.setState({
        isRecording: true
      });
    }
  }

What about shutter sounds?

on ios it makes still image shutter sound
on android it makes 2 different sounds on record button

@GeoffreyPlitt
Copy link

Is there a way to extract the thumbnail from a specific timecode in the video?

@bz123
Copy link

bz123 commented Sep 7, 2017

@GeoffreyPlitt you have to do that using a service on server side.

@GeoffreyPlitt
Copy link

Nope, we're using react-native-video-processing which does it on the device.

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

No branches or pull requests

5 participants