Plan 9: Audio-Video Pipeline

Video pipeline in action

Two important points about videos:

  1. A video is a series of images.
  2. 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] 
 


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

  1.  When a graphical program runs, it replaces the window label with the argument passed in initdraw(nil, nil, "label").
  2. riow has a CLI option -s label to set sticky window. Sticky windows are skipped while circling through open window.
  3. Plan 9 image is actually XBGR even though channel string is x8r8g8b8 and channel constant is XRGB32 on x86.
  4. Still images use YUV444 to maintain maximum details. Video uses YUV420 which sacrifices details for size. 


Code

 

 

 

Comments

Popular posts from this blog

Plan 9 : The Infinity Notebook

Emacs: Binary File Viewer

Plan 9 Remote File Access from Emacs