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

本站现有博文332篇,共被浏览875634

本站已经建立2583天!

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