[BACK]Return to README.md CVS log [TXT][DIR] Up to [local] / projects / fauxstream

File: [local] / projects / fauxstream / README.md (download)

Revision 1.1, Sat Jun 23 22:54:14 2018 UTC (3 years, 5 months ago) by thfr
Branch: MAIN

add fauxstream - so far only with videostream

fauxstream
==========

fauxstream (for **f**fmpeg + **au**cat **x**11 **stream**) is a shell script to
simultaneously record a desktop video stream and one (or more?) audio streams.
The main goal is to allow screencasting (with additional voice-over stream?),
with defaults set to suit twitch.tv as the primary target. The license is ISC
(see [LICENSE.txt](LICENSE.txt)).

Rationale
---------

To my knowledge, there is no dedicated screen casting solution available on
OpenBSD. The port of ffmpeg can fulfill these functions, but seems to be
hampered by apparent lack of or suboptimal multithreading support, resulting
in dropped frames when recording.

It turns out that the reason for this is apparently lack of (or too little)
parallelism on th side of ffmpeg.

This script circumvents this by running multiple parallel recording streams
with both ffmpeg(1) and OpenBSD's aucat(1).

Note that this is likely only useful on multiprocess systems/kernels.

Requirements
------------

* ffmpeg (install from ports with `doas pkg_add ffmpeg`)
* aucat(1) (present on OpenBSD, FreeBSD)
* enable kern.audio.record:
# sysctl kern.audio.record=1

Limitations
-----------

* Higher recording resolutions, non-default video codecs, or simultaneously
  running applications may affect performance while recording to the point of
  dropping frames and leading to desynchronization.
* The recording with ffmpeg's x11grab doesn't register when an application goes
  fullscreen, and it continues to record it as being run in a window.
* Likely significantly worse performance on single-core CPUs/single-process
  systems.

Setting up the Monitoring Stream
--------------------------------

Refer to [FAQ 13](https://www.openbsd.org/faq/faq13.html#recordmon).

Usage
-----

```
-r <recording video resolution>
-a <additional audio stream>
-c <video codec>
-p <path>
-v1 <volume adjustment of stream 1>
-v2 <volume adjustment of stream 2>
```

Example(s):
-----------

`sh fauxstream -r 1920x1080 -a snd/0.mon "rtmp://SERVER.twitch.tv/app/STREAM_KEY`

**Note: To stop the recording, press Ctrl-C (not [q]!). Then the script will
continue to combine (mux) the recorded streams.**

Related Links:
--------------

* https://wiki.archlinux.org/index.php/Streaming_to_twitch.tv