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

本站现有博文333篇,共被浏览922434

本站已经建立2628天!

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