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

本站现有博文324篇,共被浏览809354

本站已经建立2512天!

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