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

本站现有博文336篇,共被浏览948105

本站已经建立2659天!

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