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

本站现有博文322篇,共被浏览789475

本站已经建立2485天!

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