当前位置:网站首页>Picture synthesis video
Picture synthesis video
2022-04-23 03:36:00 【Crispy eggplant strips】
# -*- coding: UTF-8 -*-
import glob
import os
import cv2
import time
# Picture synthesis video
def picvideo(path, size):
filelist = os.listdir(path) # Get all file names in this directory
filelist.sort(key=lambda x: int(x[:-4])) ## File names are sorted by number
''' fps: Frame rate :1 Seconds n Write in a picture [ Control a picture to stay 5 Second , That's the frame rate 1, Repeat this picture 5 Time ] If there is 50 Zhang 534*300 Pictures of the , Set up here 1 Seconds to play 5 Zhang , So the duration of this video is 10 second '''
fps = 30
# file_path = str(int(time.time())) + ".mp4" # export path
file_path = "2.mp4"
fourcc = cv2.VideoWriter_fourcc('M', 'P', '4', 'V') # Different video codes correspond to different video formats ( example :'I','4','2','0' Corresponding avi Format )
video = cv2.VideoWriter(file_path, fourcc, fps, size)
for item in filelist:
item = os.path.join(os.getcwd(),path,item)
img = cv2.imread(item) # Use opencv Read images , Go straight back to numpy.ndarray object , The channel order is BGR , Note that BGR, Default range of channel values 0-255.
# cv2.imshow("img",img)
# cv2.waitKey(0)
video.write(img) # Write the picture into the video
video.release() # Release
picvideo('imgs_wu', (720, 1280))
版权声明
本文为[Crispy eggplant strips]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220602451653.html
边栏推荐
- Supersocket is Use in net5 - concept
- Visual programming - drawing assignment
- 2022 团体程序设计天梯赛 模拟赛 L2-4 哲哲打游戏 (25 分)
- List interface of collection
- Punch in: 4.23 C language chapter - (1) first knowledge of C language - (12) structure
- The principle and solution of not allowing pasting in an English Network
- A hundred dollars for a hundred chickens
- Concepts of objects and classes
- 集合之List接口
- L3-011 direct attack Huanglong (30 points)
猜你喜欢
![[microservices] (x) -- Unified gateway](/img/f8/0c4516a802086cbe4031183b27a775.jpg)
[microservices] (x) -- Unified gateway

New ORM framework -- Introduction to beetlsql

Basic use of Charles

Abstract classes, interfaces and common keywords

Use of rotary selector wheelpicker

淺學一下I/O流和File類文件操作

Romantic silhouette of L2-3 of 2022 group programming ladder Simulation Competition (25 points)

Deep learning notes (II) -- principle and implementation of activation function

Redis(17) -- Redis缓存相关问题解决

深度學習筆記(二)——激活函數原理與實現
随机推荐
Explanation keyword of MySQL
Design and implementation of redis (4): what is the event driver of redis
Application and definition of interface
L3-011 direct attack Huanglong (30 points)
Redis (17) -- redis cache related problem solving
MySQL is completely uninstalled and MySQL service is cleaned up
What to pay attention to when writing the first code
The art of concurrent programming (3): an in-depth understanding of the principle of synchronized
The fourth operation
AWS from entry to actual combat: creating accounts
Activity supports multi window display
Development record of primary sensitive word detection
变量、常量、运算符
2022 团体程序设计天梯赛 模拟赛 L2-3 浪漫侧影 (25 分)
String input problem
Visual programming -- how to customize the mouse cursor
Unity knowledge points (ugui)
. net 5 Web custom middleware implementation returns the default picture
C-11 problem I: find balloon
Oracle JDK vs OpenJDK