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

本站现有博文321篇,共被浏览764594

本站已经建立2442天!

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