video-to-notes is a Codex skill and helper toolkit for turning lecture source material into professional Chinese LaTeX course notes and a compiled PDF.
The main workflow is:
transcript TXT + slide PDF/PPT/PPTX -> slide images -> LaTeX notes -> rendered PDF
If a YouTube URL and cookies.txt are provided, the workflow can first download subtitles only, convert them to TXT, and then use the transcript with the local slides.
SKILL.md: the Codex skill instructions. This is the source of truth for the writing, figure-selection, subtitle-download, LaTeX, and validation workflow.assets/notes-template.tex: the default Chinese LaTeX note template, including a simple title page, highlight boxes, listings, figures, and TikZ.scripts/prepare_slide_images.py: renders a slide PDF intopic/page_N.pngimages. It can auto-discover one PDF and one TXT in the current directory.scripts/srt_to_txt.py: converts.srtor.vttsubtitles into a readable.txttranscript.clean.sh: archives the current lecture workspace into a named folder after notes are generated.agents/openai.yaml: a short agent-facing entry point for invoking the skill.demo/: sample slide PDFs for testing the image-preparation helper.
- Local transcript TXT plus local slide PDF.
- Local transcript TXT plus local slide PPT/PPTX, after converting the deck to PDF.
- YouTube URL or
url.txtpluscookies.txt, then downloaded subtitles plus local slides.
When there are multiple candidate transcripts or slide decks, choose the files explicitly instead of relying on auto-discovery.
Python helpers use only the standard library except for optional PDF rendering support:
python3 -m pip install pdf2imageInstall Poppler so PDF pages can be rendered. On macOS:
brew install popplerOn Ubuntu/Debian:
sudo apt-get install poppler-utilsFor optional YouTube subtitle download, install yt-dlp:
python3 -m pip install yt-dlpFor final PDF compilation, install a LaTeX distribution with XeLaTeX and common packages such as ctex, tcolorbox, listings, tikz, and pgfplots.
Place the lecture transcript and slide deck in the working directory. If the transcript is in subtitle format, convert it first:
python3 scripts/srt_to_txt.py lecture.srt transcript.txtIf the working directory contains exactly one .pdf and one .txt, use auto-discovery:
python3 scripts/prepare_slide_images.py --autoOtherwise, pass the slide PDF explicitly:
python3 scripts/prepare_slide_images.py --pdf slides.pdf --output picThe helper writes images as pic/page_1.png, pic/page_2.png, and so on. If pic/ already contains page images, it reuses them by default. Add --force to re-render.
To test with a demo deck:
python3 scripts/prepare_slide_images.py --pdf demo/karpathy_llm_intro.pdf --output pic --forceAsk Codex to use the video-to-notes skill with your transcript and slides. The skill will:
- inspect the sources and slide images,
- use
assets/notes-template.texas the base document, - select or create teaching figures,
- write a complete Chinese note,
- compile the
.texfile to PDF, - validate that referenced assets exist and the PDF builds.
For manual use, start from assets/notes-template.tex, replace the body block, and reference slide screenshots with the pic/page_N.png convention.
xelatex notes.tex
xelatex notes.texRun XeLaTeX twice when the table of contents or references need a second pass.
chmod +x clean.sh
./clean.sh Lec_01_Introclean.sh creates the target folder and moves pic/, all root-level *.pdf, *.txt, and *.tex files into it. It does not currently move .srt or .vtt files.
- Notes are written in Chinese unless requested otherwise.
- Slide screenshots should use
pic/page_N.png; captions should explain the teaching role without adding source page numbers. - Figures should stay outside
importantbox,knowledgebox,warningbox, anddialoguebox. - Each major section should end with
本章小结. - The document should end with a top-level
总结与延伸section. - Final delivery should include the generated
.tex, compiled.pdf, and every referenced asset.