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

本站现有博文337篇,共被浏览961703次

本站已经建立2673天!

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