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

本站现有博文321篇,共被浏览776382

本站已经建立2467天!

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