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

本站现有博文328篇,共被浏览840222

本站已经建立2545天!

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