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

本站现有博文341篇,共被浏览1036289次

本站已经建立2724天!

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