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

本站现有博文327篇,共被浏览833185

本站已经建立2538天!

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