Plan 9: Audio-Video Pipeline
Video pipeline in action
Two important points about videos:
- A video is a series of images.
- RGB format is used for display. YUV format is used for storage and transmission.
Recording
────────────────────────────────────────────────────────
[Video Source] → [Frame Processing] → [Video Encode] ┐
├→ [Mux] → [Container Stream]
[Audio Source] → [Audio Processing] → [Audio Encode] ┘
Playback
────────────────────────────────────────────────────────
[Container Stream] → [Demux] → [Video Decode] → [Video Sink]
│
└→ [Audio Decode] → [Audio Sink]
────────────────────────────────────────────────────────
[Video Source] → [Frame Processing] → [Video Encode] ┐
├→ [Mux] → [Container Stream]
[Audio Source] → [Audio Processing] → [Audio Encode] ┘
Playback
────────────────────────────────────────────────────────
[Container Stream] → [Demux] → [Video Decode] → [Video Sink]
│
└→ [Audio Decode] → [Audio Sink]
Sink as a Screensaver / Image viewer
Use composable programs to run screensaver or image viewer. DEL to exit the program.
Options:
g grid ( 1x2 , 2x2 etc.)
k interactive (press any key to continue)
l loop
r images per second (rate)s stretch
Lessons Learnt
- When a graphical program runs, it replaces the window label with the argument passed in initdraw(nil, nil, "label").
- riow has a CLI option -s label to set sticky window. Sticky windows are skipped while circling through open window.
- Plan 9 image is actually XBGR even though channel string is x8r8g8b8 and channel constant is XRGB32 on x86.
- Still images use YUV444 to maintain maximum details. Video uses YUV420 which sacrifices details for size.
Code
Comments
Post a Comment