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

本站现有博文333篇,共被浏览918082

本站已经建立2623天!

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