0

I have looked all over the internet to get a way to extract image of everyframe of a video using react-native-ffmpeg. I am making a mobile app and I want to show all per frame images on the video timeline. I want to do this natively on mobile so that I can utilise hardware power of mobile. That is the reason I am looking for react-native-ffmpeg kind of library. Am I in the right direction? This npmjs.com/package/react-native-ffmpeg is what I am trying to use. I need to know the command to do the job.

EdG
  • 2,243
  • 6
  • 48
  • 103
  • Hello @EdG, were you able to figure this out, please? I'm stuck, trying to implement something similar to WhatsApp status video trimming feature. – its_tayo Sep 22 '20 at 22:54
  • https://stackoverflow.com/questions/40088222/ffmpeg-convert-video-to-images/40090033 – diedu Sep 26 '20 at 05:27

1 Answers1

0

To calculate frame rate of the video follow this link :
https://askubuntu.com/questions/110264/how-to-find-frames-per-second-of-any-video-file

After finding the frame rate, you can extract each frame now, for example :

To extract all frames from a 24 fps movie using ffmpeg :
The %03d dictates that the ordinal number of each output image will be formatted using 3 digits.

ffmpeg -i input.mov -r 24/1 out%03d.jpg

another resource : https://gist.github.com/loretoparisi/a9277b2eb4425809066c380fed395ab3

also refer to .execute() method in react-native-ffmpeg.

Nine Tails
  • 378
  • 3
  • 15