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
标签云
ms-swift Pytorch PyTorch Paper Excel OpenCV LoRA Google Rebuttal Search BeautifulSoup Gemma Food VSCode LLM Color EXCEL 飞书 Image2Text 公式 UI QWEN icon Claude Base64 ChatGPT PDF Git PIP TTS printf scipy Proxy SQLite YOLO LaTeX Quantization Card Hilton Domain Pandas Video Streamlit MD5 Password 递归学习法 FlashAttention Shortcut 关于博主 hf SVR RAR TensorFlow Review SQL CAM 域名 版权 PyCharm Paddle RGB torchinfo Qwen Animate Interview Input 阿里云 llama.cpp FP16 Magnet VPN News TSV Land Agent Clash Mixtral Docker PDB Qwen2.5 git-lfs DeepStream GIT CTC 证件照 FP32 Disk Baidu ONNX Llama LLAMA AI 图形思考法 NameSilo HuggingFace Freesound Plate Use GGML git Data Bin 算法题 Plotly Breakpoint v2ray Jupyter 多线程 第一性原理 CLAP Distillation transformers Linux CEIR Safetensors Windows Dataset Hungarian GPTQ CSV C++ 财报 Conda OpenAI CC Website 腾讯云 Firewall 签证 Sklearn HaggingFace IndexTTS2 Python Translation ResNet-50 Statistics tar NLP ModelScope FastAPI CV 报税 继承 音频 Quantize API diffusers UNIX Cloudreve 强化学习 论文 Heatmap Tiktoken WebCrawler Attention uWSGI Datetime Bipartite Numpy Django Augmentation FP8 云服务器 多进程 XGBoost OCR Bert Ptyhon uwsgi Crawler Vim mmap Transformers 搞笑 BF16 XML InvalidArgumentError 论文速读 Logo Vmess GPT4 Jetson Diagram logger RL VGG-16 BTC Template Zip Knowledge Qwen2 GoogLeNet TensorRT 图标 Web JSON Tracking Tensor SAM Hotel v0.dev 顶会 Michelin Anaconda Pillow Permission Ubuntu Miniforge Markdown NLTK LeetCode FP64 Nginx Bitcoin Math CUDA Pickle COCO WAN SPIE 净利润 Algorithm Random DeepSeek Github tqdm
站点统计

本站现有博文332篇,共被浏览900716

本站已经建立2602天!

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