EADST

Python: Get Frames from the Video with OpenCV

Python: Get Frames from the Video with OpenCV

import os
import cv2

video_path = "test.mp4"
video_name = os.path.basename(video_path)
cap = cv2.VideoCapture(video_path)
save_dir = os.path.join('./result', video_name)
success, frame = cap.read()
frame_index = 1
save_format = 'img{:06d}.jpg' 
while success:
    frame_path = os.path.join(save_dir, save_format.format(frame_index))
    cv2.imwrite(frame_path, frame)
    frame_index += 1
    success, frame = cap.read()
相关标签
About Me
XD
Goals determine what you are going to be.
Category
标签云
Data Color BF16 Datetime ModelScope PIP SPIE Michelin Proxy Animate PDB icon Dataset Clash Git Windows Paddle Jev Hilton AI Breakpoint Diagram 算法题 Ubuntu 个人博客 OpenAI GPTQ uWSGI Statistics Magnet Knowledge NLTK LeetCode Tiktoken RGB NameSilo Vim VSCode Permission Pandas RAR Tracking Google Image2Text Transformers YOLO scipy 音频 OCR Heatmap 搞笑 UNIX Firewall GIT mmap UI Markdown Tensor Bipartite 飞书 Qwen2.5 Anaconda DeepStream 多线程 Qwen 继承 公式 TensorRT 长期记忆 证件照 Baidu WAN MD5 ONNX Password Bert llama.cpp Django Attention TSV IndexTTS2 腾讯云 COCO 图形思考法 Rebuttal Linux Freesound HuggingFace tqdm 顶会 Web Cloudreve Domain 云服务器 NLP XGBoost git Mixtral CUDA Math DeepSeek 论文 Food CEIR Pytorch Quantization Harness Base64 BTC CAM Review 多进程 阿里云 Video CTC Safetensors Jupyter Template Paper Crawler 关于博主 Algorithm JSON v2ray Hungarian EXCEL SQLite Claude Vmess BeautifulSoup Pickle LoRA 签证 版权 Docker C++ Quantize Sklearn Hotel 递归学习法 FlashAttention LLM uwsgi Logo Plate LaTeX Augmentation Github hf CLAP Numpy QWEN Card Plotly API网关 GPT4 v0.dev CC FP8 Random CV Interview diffusers Translation ResNet-50 论文速读 报税 Excel LLAMA XML FP16 SVR Disk Land git-lfs RL ChatGPT Use 强化学习 Search Nginx InvalidArgumentError News Streamlit SQL 第一性原理 torchinfo Jetson PyTorch VPN PDF GGML Zip TTS Bin FastAPI Miniforge Input Shortcut API ms-swift CSV Gemma Agent FP32 净利润 Bitcoin Python Distillation Website 财报 logger OpenCV Pillow Llama PyCharm tar 图标 TensorFlow transformers 自我改进 WebCrawler GoogLeNet VGG-16 Ptyhon Conda Qwen2 SAM printf 域名 HaggingFace FP64
站点统计

本站现有博文340篇,共被浏览1019332次

本站已经建立2719天!

热门文章
文章归档
回到顶部