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

本站现有博文320篇,共被浏览757201

本站已经建立2422天!

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