<div dir="ltr">Probably it does not help an awful lot, but I recall an interesting project from couple of years ago called erlyvideo (later flussonic). I believe they have been busy with a similar challenge (video streaming with Erlang) and put a lot of work into tweaking performance. Perhaps you can still find interesting hints and discussions in the mailing list archive (or elsewhere) when searching for this project.</div><div class="gmail_extra"><br><div class="gmail_quote">On 2 March 2017 at 21:26, Dmytro Lytovchenko <span dir="ltr"><<a href="mailto:dmytro.lytovchenko@gmail.com" target="_blank">dmytro.lytovchenko@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Making it "more realtime" has little sense, as it is not realtime platform and never was, and never intended to be.<br></div><div><br></div>A few points to consider.<div>1. Erlang is not a realtime platform, i.e. it does not give you millisecond/microsecond guarantees. It is soft realtime, which guarantees that your code will eventually  and periodically get CPU time with some +/- 100 ms precision depending on the current load.</div><div><br></div><div>2. If you want such millisecond precision you could write the critical decoding/feeding part in native code with an appropriate tool such as C/C++/Rust/Ocaml/Java/C# etc while Erlang will do the rest of the management and orchestration in your system.</div><div><br></div><div>3. One more way would be to let Erlang decode video ahead of time, so that you have few frames ready and cached for such a hiccup moment. Then even if some frame is late, there is always another frame ready to cover for it. Then let video player smooth the hiccups. I think streaming services do this at the cost of significant caching ahead.</div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-03-02 21:17 GMT+01:00 Vans S <span dir="ltr"><<a href="mailto:vans_163@yahoo.com" target="_blank">vans_163@yahoo.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I currently need to stream 60 frames per second of video and I made a simple test case using erlang.<br>
<br>
I have 1 gen_server doing a erlang:send_after every 17ms, when the handle_info procs it calls<br>
<br>
os:perf_counter(1000) then compares the last time to the current, if the difference is > 20,<br>
print to console.<br>
<br>
Iv noticed that about every 2-3 seconds, the send_after arrives around in 20-23ms, this is not<br>
respecting the millisecond realtime nature that I thought Erlang can provide.<br>
<br>
Is there any VM arguments that could be passed to increase the realtime properties or other<br>
things that can be done?<br>
<br>
The testcase is just a naked rebar app with 1 gen_server not doing anything else.<br>
______________________________<wbr>_________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/list<wbr>info/erlang-questions</a><br>
</blockquote></div><br></div>
<br>______________________________<wbr>_________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/<wbr>listinfo/erlang-questions</a><br>
<br></blockquote></div><br></div>