Skip to content

Instantly share code, notes, and snippets.

@pon13y
pon13y / readme.md
Created September 18, 2018 15:38 — forked from max-mapper/readme.md
ffmpeg youtube live event rtmp stream from raspberry pi with raspi camera (raspivid)
  1. compile ffmpeg for arm https://github.com/fiorix/ffmpeg-arm
  2. create youtube 'live event'. get rtmp url + session id
  3. run this:
raspivid -o - -t 0 -vf -hf -fps 30 -b 6000000 | ffmpeg -re -ar 44100 -ac 2 -acodec pcm_s16le -f s16le -ac 2 -i /dev/zero -f h264 -i - -vcodec copy -acodec aac -ab 128k -g 50 -strict experimental -f flv rtmp://a.rtmp.youtube.com/live2/<SESSION>

you can tweak -b and -fps to your liking. the settings above work well for 1080p. by not specifying width or height we get the full 1920x1080 resolution from the raspi camera

title description date categories slug
QQ协议分析
QQ协议分析
2014-04-16
protocol
qq-protocol

一. 文字聊天协议族(TCPF, Text Chatting Protocol Family)

本文基本上这为两篇文章的翻译和整合 -- Scalable networking And Why are event-driven server so great

OPPC模型瓶颈

传统服务器模型如Apache为每一个请求生成一个子进程。当用户连接到服务器的一个子进程就产生,并处理连接。每个连接获得一个单独的线程和子进程。当用户请求数据返回时,子进程开始等待数据库操作返回。如果此时另一个用户也请求返回数据,这时就产生了阻塞。

这种模式在非常小的工作负荷是表现良好,当请求的数量变得太大是服务器会压力过于巨大。 当Apache达到进程的最大数量,所有进程都变得缓慢。每个请求都有自己的线程,如果服务代码使用PHP编写时,每个进程所需要的内存量是相当大的[1]。

fork()操作延时

This file has been truncated, but you can view the full file.
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<head>
<title>fnord0 subscriptions in Google Reader</title>
</head>
<body>
<outline text="(title unknown)" title="(title unknown)"
type="rss"
xmlUrl="http://showmetheco.de/articles/2011/6/%3C%=%20href_to_rss%20%%3E" htmlUrl="http://www.google.com/reader/view/feed%2Fhttp%3A%2F%2Fshowmetheco.de%2Farticles%2F2011%2F6%2F%253C%25%3D%2520href_to_rss%2520%25%253E"/>
<outline text="(title unknown)" title="(title unknown)"