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

本站现有博文341篇,共被浏览1037700次

本站已经建立2725天!

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