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

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

本站已经建立2578天!

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