Pandoc + reveal.jsでMarkdownによるスライド作成をWindowsで行えるようにするまでの環境づくりの手順。
と、イロイロといじったのでそれをメモしておく。
Markdownでサクッとスライドが作れるといいなーと思って昨年ぐらいより Pandoc + reveal.js を使い始めた。
PCを新しくしたついでに環境をイロイロ整え直したので、それをメモしておこーかなと。
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
Terminal Commands: | |
One webcam: | |
ffmpeg -f alsa -ac 2 -i hw:1,0 -f v4l2 -s 1280x720 -r 10 -i /dev/video1 -vcodec libx264 -pix_fmt yuv420p -preset ultrafast -r 25 -g 20 -b:v 2500k -codec:a libmp3lame -ar 44100 -threads 6 -b:a 11025 -bufsize 512k -f flv rtmp://a.rtmp.youtube.com/live2/YOURSTREAMNAMEHERE | |
Two webcam overlay: | |
ffmpeg -f alsa -ac 2 -i hw:1,0 -f v4l2 -s 1280x720 -r 10 -i /dev/video1 -f v4l2 -s 320x240 -r 10 -i /dev/video0 -filter_complex "[1:v]setpts=PTS-STARTPTS[bg]; [2:v]setpts=PTS-STARTPTS[fg]; [bg][fg]overlay=shortest=1 [out]" -map "[out]" -map 0:a -vcodec libx264 -pix_fmt yuv420p -preset veryfast -r 25 -g 20 -b:v 2500k -codec:a libmp3lame -ar 44100 -threads 6 -b:a 11025 -bufsize 512k -f flv rtmp://a.rtmp.youtube.com/live2/YOURSTREAMNAMEHERE |
This should work conceptually on any Linux OS with PulseAudio but these particular instructions are for Ubuntu.
There are two major reasons for using simultaneous output. The first is self-evident - we can output to say a bluetooth
headset and wired headphones at the same time to enable two people to watch a movie with headphones on a single computer.
The second reason is a sort of a convenience for setup. We know the simultaneous sink name so the default.pa
config
would work without modification so long as simultaneous output is enabled. If we were to set this up without that,
we'd have to customize the config with our specific device sink name. That's totally doable but personally I always
setup simultaneous output. That's why I haven't described the alternative in this gist.