Course Video Pipeline
Process course recordings end to end while preserving the user's requested output shape. Prefer independent clips unless the user explicitly asks for a merged lecture video. Do not infer permission to delete local sources or existing remote outputs.
Before Processing
- Read the user's source and destination paths exactly. Treat leading labels such as 全部文件 as UI text unless they exist in the remote path.
- Inspect remote filenames, sizes, formats, and existing outputs before downloading.
- Check local free space and available GPU, FFmpeg codec, WhisperX environment, and BaiduPCS-Go login.
- Choose the course adapter after sampling filenames, transcript text, and video structure. Read references/course-adapters.md for known styles and for detecting unfamiliar styles.
- Confirm the output mode: individual clips, merged clips, or both. Default to individual clips when unspecified.
Pipeline
- Download and validate every source video without changing its natural ordering.
- Transcribe source files independently. Reuse valid transcripts and clip plans instead of repeating GPU work.
- Build a deterministic clip or unit manifest. Review candidate boundaries when markers are ambiguous.
- Render clips and generate one SRT per clip. Generate a merged video and combined SRT only when requested.
- Generate a Markdown manifest containing label, output filename, source filename, source timestamps, duration, and any adaptation notes.
- Run the output validator before upload.
- Upload to the user's exact remote directory and verify remote counts and filenames.
- Clean up only after verification and only within the user's deletion authorization.
Required Output Contract
For every selected clip or retained knowledge unit, provide:
- One MP4 unless the requested unit is metadata-only.
- One timestamp-reset SRT with matching basename.
- One row in the lecture or chapter Markdown list.
- Stable sequential prefixes plus the original example or unit ID.
For merged mode, keep individual normalized clips locally and add one merged MP4 plus one timeline-adjusted combined SRT. Do not replace an existing merged or non-merged version unless the user asks to overwrite or remove it.
Execution Notes
- Use source-specific transcripts so timestamps reset to zero for each output clip.
- Prefer accurate FFmpeg trimming with h264_nvenc when supported. Fall back to libx264 rather than silently skipping accurate boundaries.
- Preserve course wording in Markdown; only normalize filenames and administrative labels.
- Stop on missing sources, invalid timestamps, zero-byte media, or unexplained count mismatches. Retry only failed files.
- For large batches, report concrete progress after download, transcription, rendering, and upload stages.
Read references/workflow.md before running the full pipeline. Read references/course-adapters.md when choosing split policy. Read references/manifest-upload.md when constructing manifests, Markdown lists, uploads, verification, or cleanup.