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

本站现有博文324篇,共被浏览809373

本站已经建立2512天!

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