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

本站现有博文323篇,共被浏览795390

本站已经建立2493天!

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