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

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

本站已经建立2583天!

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