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

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

本站已经建立2635天!

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