Loading...
Loading...
Compare original and translation side by side
Extract frames every 10 seconds from all Movie_F videos in the CARDV folder.
Sample frames from Movie_R dashcam videos, one frame every 15 seconds.
Create motion samples for all parking camera videos with 5-second intervals.
Extract representative frames from Movie_F and Movie_R for July 27-29, 2025.从CARDV文件夹中的所有Movie_F视频中每10秒提取一帧。
对Movie_R行车记录仪视频进行帧采样,每15秒提取一帧。
为所有停车摄像头视频创建运动样本,采样间隔为5秒。
提取2025年7月27日至29日的Movie_F和Movie_R视频的代表性帧。Movie_FMovie_RPark_FPark_RallMovie_FC:\Users\yousu\Desktop\CARDVMovie_FMovie_RPark_FPark_RallMovie_FC:\Users\yousu\Desktop\CARDV{source_dir}/MOTION_SAMPLESYYYYMMDDYYYYMMDD-YYYYMMDD2025072720250727-20250729{source_dir}/MOTION_SAMPLESYYYYMMDDYYYYMMDD-YYYYMMDD2025072720250727-20250729{output_dir}/
├── INDEX.csv # Comprehensive metadata
├── 20250727150654_052278A_F001_001000ms.jpg # Frame 1 at 1s
├── 20250727150654_052278A_F002_011000ms.jpg # Frame 2 at 11s
├── 20250727150654_052278A_F003_021000ms.jpg # Frame 3 at 21s
└── ...{output_dir}/
├── INDEX.csv # 完整元数据
├── 20250727150654_052278A_F001_001000ms.jpg # 第1帧,对应视频1秒处
├── 20250727150654_052278A_F002_011000ms.jpg # 第2帧,对应视频11秒处
├── 20250727150654_052278A_F003_021000ms.jpg # 第3帧,对应视频21秒处
└── ...{YYYYMMDDHHMMSS}_{FILEIDA/B}_{POSITION}_{TIMESTAMP_MS}ms.jpg
Example: 20250727150654_052278A_F003_021000ms.jpg
└─────┬─────┘ └──┬──┘ └┬┘ └───┬───┘
Date/Time FileID Pos Timestamp
Components:
- YYYYMMDDHHMMSS: Video start time
- FILEIDA/B: Camera file ID + suffix (A=front, B=rear)
- F###: Frame position (F001, F002, F003...)
- ######ms: Milliseconds into video{YYYYMMDDHHMMSS}_{FILEIDA/B}_{POSITION}_{TIMESTAMP_MS}ms.jpg
示例:20250727150654_052278A_F003_021000ms.jpg
└─────┬─────┘ └──┬──┘ └┬┘ └───┬───┘
日期/时间 文件ID 帧位置 时间戳
组成部分:
- YYYYMMDDHHMMSS: 视频开始时间
- FILEIDA/B: 摄像头文件ID + 后缀(A=前视,B=后视)
- F###: 帧位置(F001、F002、F003...)
- ######ms: 视频内的毫秒级时间戳original_video,frame_file,camera,date,position,timestamp_ms,timestamp_s,frame_number,file_size_kb
20250727150654_052278A.MP4,20250727150654_052278A_F001_001000ms.jpg,Movie_F,20250727,F001,1000,1.0,24,1713.06original_videoframe_filecameradatepositiontimestamp_mstimestamp_sframe_numberfile_size_kboriginal_video,frame_file,camera,date,position,timestamp_ms,timestamp_s,frame_number,file_size_kb
20250727150654_052278A.MP4,20250727150654_052278A_F001_001000ms.jpg,Movie_F,20250727,F001,1000,1.0,24,1713.06original_videoframe_filecameradatepositiontimestamp_mstimestamp_sframe_numberfile_size_kb| Interval | Frames/Video | Total Frames | Storage | Reduction |
|---|---|---|---|---|
| 5s | 12 | 5,016 | 9 GB | 80% |
| 10s | 7 | 2,926 | 5 GB | 89% |
| 15s | 5 | 2,090 | 3.7 GB | 92% |
| 30s | 3 | 1,254 | 2.2 GB | 95% |
| 采样间隔 | 每视频提取帧数 | 总提取帧数 | 存储占用 | 缩减比例 |
|---|---|---|---|---|
| 5秒 | 12 | 5,016 | 9 GB | 80% |
| 10秒 | 7 | 2,926 | 5 GB | 89% |
| 15秒 | 5 | 2,090 | 3.7 GB | 92% |
| 30秒 | 3 | 1,254 | 2.2 GB | 95% |
timestamps = []
current_time = 1.0 # start offset
while current_time < (duration - 1.0):
timestamps.append(current_time)
current_time += sample_interval
timestamps.append(duration - 1.0) # always include endtimestamps = []
current_time = 1.0 # 起始偏移量
while current_time < (duration - 1.0):
timestamps.append(current_time)
current_time += sample_interval
timestamps.append(duration - 1.0) # 始终包含结束帧SKIP: video.MP4 too short (2.1s)
ERROR: Cannot open corrupted_video.MP4
WARNING: Failed to read frame 120 from video.MP4SKIP: video.MP4 时长过短(2.1秒)
ERROR: 无法打开损坏文件 corrupted_video.MP4
WARNING: 无法读取 video.MP4 的第120帧Use the motion-sampler skill to extract frames every 10 seconds from all Movie_F videos
in C:\Users\yousu\Desktop\CARDV. Save to MOTION_SAMPLES folder.使用motion-sampler skill从C:\Users\yousu\Desktop\CARDV路径下的所有Movie_F视频中每10秒提取一帧,保存到MOTION_SAMPLES文件夹。Extract frames every 5 seconds from Movie_R videos on July 27, 2025.20250727*.MP4从2025年7月27日的Movie_R视频中每5秒提取一帧。20250727*.MP4Create motion samples with 30-second intervals for all parking cameras (Park_F and Park_R)
to minimize storage while keeping a visual record.为所有停车摄像头(Park_F和Park_R)创建运动样本,采样间隔为30秒,在保留视觉记录的同时最小化存储占用。max_workersmax_workersjpeg_qualitysample_intervaljpeg_qualitysample_intervalmin_durationmin_durationmin_durationmin_durationmax_workersmax_workersG:\My Drive\PROJECTS\skills\motion-sampler\
├── skill.md # This file
├── README.md # Quick start guide
├── SKILL_MANIFEST.md # File inventory & testing
├── scripts/
│ ├── extract_motion_samples.py # Main extraction script
│ └── analyze_results.py # Post-processing analysis
├── assets/
│ ├── config_template.json # Default configuration
│ └── camera_mapping.json # Camera ID mapping
└── references/
├── SAMPLING_ALGORITHM.md # Detailed algorithm docs
└── PERFORMANCE_BENCHMARKS.md # Speed/storage benchmarksG:\My Drive\PROJECTS\skills\motion-sampler\
├── skill.md # 当前文档
├── README.md # 快速入门指南
├── SKILL_MANIFEST.md # 文件清单与测试文档
├── scripts/
│ ├── extract_motion_samples.py # 主提取脚本
│ └── analyze_results.py # 后处理分析脚本
├── assets/
│ ├── config_template.json # 默认配置文件
│ └── camera_mapping.json # 摄像头ID映射文件
└── references/
├── SAMPLING_ALGORITHM.md # 详细算法文档
└── PERFORMANCE_BENCHMARKS.md # 速度/存储基准测试文档{
"camera": "Movie_F",
"source_dir": "C:\\Users\\yousu\\Desktop\\CARDV",
"output_dir": "C:\\Users\\yousu\\Desktop\\CARDV\\MOTION_SAMPLES",
"sample_interval": 10.0,
"jpeg_quality": 92,
"max_workers": 4,
"date_filter": null,
"min_duration": 3.0,
"use_nvdec": false
}{
"status": "success",
"videos_processed": 2146,
"frames_extracted": 15022,
"total_size_mb": 26750.5,
"avg_frames_per_video": 7.0,
"processing_time_s": 305.2,
"throughput_videos_per_sec": 7.03,
"output_dir": "C:\\Users\\yousu\\Desktop\\CARDV\\MOTION_SAMPLES",
"index_file": "C:\\Users\\yousu\\Desktop\\CARDV\\MOTION_SAMPLES\\INDEX.csv"
}{
"camera": "Movie_F",
"source_dir": "C:\\Users\\yousu\\Desktop\\CARDV",
"output_dir": "C:\\Users\\yousu\\Desktop\\CARDV\\MOTION_SAMPLES",
"sample_interval": 10.0,
"jpeg_quality": 92,
"max_workers": 4,
"date_filter": null,
"min_duration": 3.0,
"use_nvdec": false
}{
"status": "success",
"videos_processed": 2146,
"frames_extracted": 15022,
"total_size_mb": 26750.5,
"avg_frames_per_video": 7.0,
"processing_time_s": 305.2,
"throughput_videos_per_sec": 7.03,
"output_dir": "C:\\Users\\yousu\\Desktop\\CARDV\\MOTION_SAMPLES",
"index_file": "C:\\Users\\yousu\\Desktop\\CARDV\\MOTION_SAMPLES\\INDEX.csv"
}