-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
339 lines (193 loc) · 11.7 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
<!DOCTYPE html>
<!--[if IEMobile 7 ]><html class="no-js iem7"><![endif]-->
<!--[if lt IE 9]><html class="no-js lte-ie8"><![endif]-->
<!--[if (gt IE 8)|(gt IEMobile 7)|!(IEMobile)|!(IE)]><!--><html class="no-js" lang="en"><!--<![endif]-->
<head>
<meta charset="utf-8">
<title>WAITWUT?!?</title>
<meta name="author" content="Tiago Stürmer Daitx">
<meta name="description" content="Compared to VLC, desktop streaming through FFmpeg allowed me to reduce latency to a minimum, usually less than a second. To achieve such latencies I …">
<!-- http://t.co/dKP3o1e -->
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="canonical" href="http://www.waitwut.info/">
<link href="/favicon.png" rel="icon">
<link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet" type="text/css">
<link href="/stylesheets/data-table.css" media="screen, projection" rel="stylesheet" type="text/css" />
<script src="/javascripts/modernizr-2.0.js"></script>
<script src="/javascripts/ender.js"></script>
<script src="/javascripts/octopress.js" type="text/javascript"></script>
<link href="/atom.xml" rel="alternate" title="WAITWUT?!?" type="application/atom+xml">
<!--Fonts from Google"s Web font directory at http://google.com/webfonts -->
<link href="http://fonts.googleapis.com/css?family=PT+Serif:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css">
<link href="http://fonts.googleapis.com/css?family=PT+Sans:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css">
<link href='http://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-40503562-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body >
<header role="banner"><hgroup>
</hgroup>
</header>
<!-- <nav role="navigation"><ul class="subscription" data-subscription="rss">
<li><a href="/atom.xml" rel="subscribe-rss" title="subscribe via RSS">RSS</a></li>
</ul>
<form action="http://google.com/search" method="get">
<fieldset role="search">
<input type="hidden" name="q" value="site:www.waitwut.info" />
<input class="search" type="text" name="q" results="0" placeholder="Search"/>
</fieldset>
</form>
<ul class="main-navigation">
<li><a href="/">Blog</a></li>
<li><a href="/blog/archives">Archives</a></li>
</ul>
</nav> -->
<div id="main">
<div id="content">
<div class="blog-index">
<article>
<header>
<h1 class="entry-title"><a href="/blog/2013/06/09/desktop-streaming-with-ffmpeg-for-lower-latency/">Desktop Streaming With FFmpeg for Lower Latency</a></h1>
<p class="meta">
<time datetime="2013-06-09T15:22:00-03:00" pubdate data-updated="true">2013-06-09</time>
| <a href="/blog/2013/06/09/desktop-streaming-with-ffmpeg-for-lower-latency/#disqus_thread">Comments</a>
</p>
</header>
<div class="entry-content"><p>Compared to <a href="/blog/2013/06/07/desktop-streaming-with-vlc/" title="Desktop streaming with VLC">VLC</a>, desktop streaming through <a href="http://www.ffmpeg.org/" title="FFmpeg is a complete, cross-platform solution to record, convert and stream audio and video.">FFmpeg</a> allowed me to reduce latency to a minimum, usually less than a second. To achieve such latencies I also had to rely on <a href="http://ffmpeg.org/ffplay.html" title="FFplay is a very simple and portable media player using the FFmpeg libraries and the SDL library.">FFplay</a> instead of <a href="http://www.videolan.org/vlc/" title="VLC media player">VLC</a> as a client.</p>
<h2>tl;dr</h2>
<p>For smallest possible latency:</p>
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>$ ffmpeg -f x11grab -s 1600x900 -r 50 -vcodec mpeg2video -b:v 8000 -f mpegts udp://192.168.0.10:1234</span></code></pre></td></tr></table></div></figure>
<p>Using rtp gives second best latency</p>
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>$ ffmpeg -f x11grab -s 1600x900 -r 50 -vcodec mpeg2video -b:v 8000 -f rtp rtp://192.168.0.10:1234</span></code></pre></td></tr></table></div></figure>
<p>Much higher quality with a bit higher latency:</p>
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>$ ffmpeg -f x11grab -s 1600x900 -r 50 -vcodec libx264 -preset ultrafast -tune zerolatency -crf 18 -f mpegts udp://localhost:1234</span></code></pre></td></tr></table></div></figure>
<p>For lowest CPU usage and even higher latency (screen rate reduced to 5 fps):</p>
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>$ ffmpeg -f x11grab -s 1600x900 -r 5 -vcodec libx264 -preset ultrafast -tune zerolatency -crf 18 -f mpegts udp://localhost:1234</span></code></pre></td></tr></table></div></figure>
<p>For Windows use <code>dshow</code> instead of <code>x11grab</code> (that’s from [examples][ I saw, I didn’t actually test it).</p>
<p>Remember to replace 1600x900 with your own screen resolution – on Linux <code>xrandr</code> is a handy way to figure that out.</p>
<p>On the client side run <code>ffplay udp://192.168.0.10:1234</code>.</p>
<h2>Motivation</h2>
<p>As in the <a href="/blog/2013/06/07/desktop-streaming-with-vlc/" title="Desktop streaming with VLC">previous article</a> I’m looking for a way to share my desktop (read-only) with a broader audience. I was particularly interested in seeing how fast I could push it, given the reports I have read about very low latency streaming.</p>
<p>Keep reading for the full report.</p>
</div>
<footer>
<a rel="full-article" href="/blog/2013/06/09/desktop-streaming-with-ffmpeg-for-lower-latency/">Read on →</a>
</footer>
</article>
<article>
<header>
<h1 class="entry-title"><a href="/blog/2013/06/07/desktop-streaming-with-vlc/">Desktop Streaming With VLC</a></h1>
<p class="meta">
<time datetime="2013-06-07T17:45:00-03:00" pubdate data-updated="true">2013-06-07</time>
| <a href="/blog/2013/06/07/desktop-streaming-with-vlc/#disqus_thread">Comments</a>
</p>
</header>
<div class="entry-content"><p>Stream your desktop with VLC using the command line.</p>
<h2>tl;dr</h2>
<p>For smallest possible latency:</p>
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>$ cvlc screen:// --screen-fps=25 --live-caching=10 --sout "#transcode{vcoded=mp2v,vb=256,fps=25,acodec=none}:std{access=udp{caching=10},mux=raw,dst=192.168.0.10:1234}"</span></code></pre></td></tr></table></div></figure>
<p>On the client side run <code>vlc udp://@:1234</code>.</p>
<p>For lowest CPU usage:</p>
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>$ cvlc screen:// --screen-fps=5 --live-caching=100 --sout "#transcode{venc=x264{preset=ultrafast,tune=zerolatency,qp=10,nr=1000},vcodec=x264,vb=100,fps=5,acodec=none}:std{access=http,mux=ts,dst=/stream}"</span></code></pre></td></tr></table></div></figure>
<p>On the client side run <code>vlc http://<host>:8080/stream</code></p>
<h2>Motivation</h2>
<p>While investigating ways to share my desktop for remote presentations I found out that VLC is able to stream my desktop. I figured out that it might be a good alternative to read-only VNC sessions for some settings and got into testing it in my local network. I also did a simple comparison of it against <a href="http://www.karlrunge.com/x11vnc/" title="x11vnc a VNC server for real X displays">x11vnc</a>.</p>
<p>Now, some VLC setup.</p>
</div>
<footer>
<a rel="full-article" href="/blog/2013/06/07/desktop-streaming-with-vlc/">Read on →</a>
</footer>
</article>
<div class="pagination">
<a href="archives">Blog Archives</a>
</div>
</div>
<aside class="sidebar">
<section>
<ul id="recent_posts">
<li class="post">
<a href="http://www.waitwut.info" alt="Home"><img src="/images/Home.png"></a>
<a href="http://www.waitwut.info/archives/" alt="Archives"><img src="/images/Calendar.png"></a>
<a href="http://www.waitwut.info/atom.xml" alt="subscribe feed"><img src="/images/rss.png"></a>
</li>
</ul>
</section>
<section>
<h1>Recent Posts</h1>
<ul id="recent_posts">
<li class="post">
<a href="/blog/2013/06/09/desktop-streaming-with-ffmpeg-for-lower-latency/">Desktop streaming with FFmpeg for lower latency</a>
</li>
<li class="post">
<a href="/blog/2013/06/07/desktop-streaming-with-vlc/">Desktop streaming with VLC</a>
</li>
</ul>
</section>
<section>
<h1>GitHub Repos</h1>
<ul id="gh_repos">
<li class="loading">Status updating…</li>
</ul>
<a href="https://github.com/tdaitx">@tdaitx</a> on GitHub
<script type="text/javascript">
$.domReady(function(){
if (!window.jXHR){
var jxhr = document.createElement('script');
jxhr.type = 'text/javascript';
jxhr.src = '/javascripts/libs/jXHR.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(jxhr, s);
}
github.showRepos({
user: 'tdaitx',
count: 0,
skip_forks: true,
target: '#gh_repos'
});
});
</script>
<script src="/javascripts/github.js" type="text/javascript"> </script>
</section>
<section class="googleplus googleplus-hidden">
<h1>
<a href="https://plus.google.com/tdaitx?rel=author">
<img src="http://www.google.com/images/icons/ui/gprofile_button-32.png" width="32" height="32">
Google+
</a>
</h1>
</section>
</aside>
</div>
</div>
<footer role="contentinfo"><p>
This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by/3.0/deed.en_US">Creative Commons Attribution 3.0 Unported License</a> - Tiago Stürmer Daitx -
<span class="credit">Powered by <a href="http://octopress.org">Octopress</a></span>
</p>
</footer>
<script type="text/javascript">
var disqus_shortname = 'waitwut-info';
var disqus_script = 'count.js';
(function () {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = 'http://' + disqus_shortname + '.disqus.com/' + disqus_script;
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
}());
</script>
</body>
</html>