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

本站现有博文338篇,共被浏览970813次

本站已经建立2682天!

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