# Store the extracted frame from video file in array

**URL:** <https://forum.opencv.org/t/store-the-extracted-frame-from-video-file-in-array/9714>\
**Category:** Python\
**Created:** [August 2, 2022, 12:38am UTC](https://forum.opencv.org/t/store-the-extracted-frame-from-video-file-in-array/9714 "2022-08-02T00:38:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![roy](https://avatars.discourse-cdn.com/v4/letter/r/4da419/32.png) [@roy](https://forum.opencv.org/u/roy)\
**Post date:** [August 2, 2022, 12:38am UTC](https://forum.opencv.org/t/store-the-extracted-frame-from-video-file-in-array/9714/1 "2022-08-02T00:38:06Z")

</div>

Below code me to extract individual frame from the video, I just wanted to make a new video file from frame 21 to 24. I wanted to save frames 21 to 24 in an array that I could later convert to a video file.

```auto
    while success:
        success, image = vidobj.read()
        cv2.imwrite("frame%d.jpg"%count, image)

```

---

<div class="post-metadata">

**Author:** ![berak](https://avatars.discourse-cdn.com/v4/letter/b/85f322/32.png) [@berak](https://forum.opencv.org/u/berak)\
**Post date:** [August 2, 2022, 6:17am UTC](https://forum.opencv.org/t/store-the-extracted-frame-from-video-file-in-array/9714/2 "2022-08-02T06:17:14Z")

</div>

what do you want to do, exactly ? do you want to write a video file, stitch a panorama, or make an array of it ? those things are all unrelated to each other.

please try to be as precise as possible, and remove the “garbage words” from your question.

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [August 2, 2022, 8:17am UTC](https://forum.opencv.org/t/store-the-extracted-frame-from-video-file-in-array/9714/3 "2022-08-02T08:17:37Z")

</div>

this is easy to find:

[https://docs.opencv.org/3.4/d7/d9e/tutorial\_video\_write.html](https://docs.opencv.org/3.4/d7/d9e/tutorial_video_write.html)

crosspost:

> <https://stackoverflow.com/questions/73200964/store-the-extracted-frame-from-video-file-in-array>
