forked from j62/ctbrec
1
0
Fork 0

Merge branch 'dev' into flirt4free

This commit is contained in:
0xboobface 2019-04-14 20:00:53 +02:00
commit 5e8604d38b
5 changed files with 138 additions and 3 deletions

View File

@ -12,7 +12,6 @@
new models to record, and don't want hide models you don't like, so that they
don't show up again in the future
* Multi-selection in the thumbnail overview with ctrl instead of shift
1.19.1
========================

View File

@ -38,6 +38,7 @@ public class DonateTabFx extends Tab {
ImageView coffeeImage = new ImageView(getClass().getResource("/buymeacoffee-round.png").toString());
Button coffeeButton = new Button("Buy me a coffee");
coffeeButton.setPadding(new Insets(5));
coffeeButton.setOnMouseClicked((e) -> { DesktopIntegration.open("https://www.buymeacoffee.com/0xboobface"); });
VBox buyCoffeeBox = new VBox(5);
buyCoffeeBox.setAlignment(Pos.TOP_CENTER);
@ -45,6 +46,7 @@ public class DonateTabFx extends Tab {
ImageView paypalImage = new ImageView(getClass().getResource("/paypal-round.png").toString());
Button paypalButton = new Button("PayPal");
paypalButton.setPadding(new Insets(5));
paypalButton.setOnMouseClicked((e) -> { DesktopIntegration.open("https://www.paypal.me/0xb00bface"); });
VBox paypalBox = new VBox(5);
paypalBox.setAlignment(Pos.TOP_CENTER);
@ -52,6 +54,7 @@ public class DonateTabFx extends Tab {
ImageView patreonImage = new ImageView(getClass().getResource("/patreon-round.png").toString());
Button patreonButton = new Button("Become a Patron");
patreonButton.setPadding(new Insets(5));
patreonButton.setOnMouseClicked((e) -> { DesktopIntegration.open("https://www.patreon.com/0xb00bface"); });
VBox patreonBox = new VBox(5);
patreonBox.setAlignment(Pos.TOP_CENTER);

View File

@ -0,0 +1,58 @@
#### Configuration File
The configuration file stores all your settings and recorded models.
##### Location
ctbrec application:
- Windows: `C:\Users\{your user name}\AppData\Roaming\ctbrec\settings.json`
- Linux: `~/.config/ctbrec/settings.json`
- macOS: `/Users/{your user name}/Library/Preferences/ctbrec/settings.json`
server:
- Windows: `C:\Users\{your user name}\AppData\Roaming\ctbrec\server.json`
- Linux: `~/.config/ctbrec/server.json`
- macOS: `/Users/{your user name}/Library/Preferences/ctbrec/server.json`
##### Values
The application and the server share the same configuration file structure. That's why there are
values, which don't make sense in the server configuration and vice versa. These values are simply
ignored. This is a collection of the most interesting values:
- **chooseStreamQuality** (app only) - [`true`,`false`] Opens the stream resolution selection dialog, when you start recording a model.
- **concurrentRecordings** - [0 - 2147483647] Limits the number of concurrently running recordings. Once this number is reached, now more recordings are started
until a recording is finished. 0 means unlimited.
- **determineResolution** (app only) - [`true`,`false`] Display the stream resolution on the thumbnails.
- **generatePlaylist** (server only) - [`true`,`false`] Generate a playlist once a recording terminates. The playlist is used to detect, if a recording is finished
or not. If you disable this, the recording will stay in the state *recording*. You should only disable this, if you are doing some other post-processing.
- **httpPort** - [1 - 65536] The TCP port, the server listens on. In the server config, this will tell the server, which port to use. In the application this will set
the port ctbrec tries to connect to, if it is run in remote mode.
- **httpServer** (app only) - The TCP host where the server is running. Has no effect, if ctbrec is run in local reocrding mode.
- **httpTimeout** - [1 - 2147483647] in milliseconds. In the server configuration this sets the idle timeout for connections to the server. In the app this sets the connect and read timeout for any HTTP connection.
- **httpUserAgent** - The user agent, which is used in the HTTP header, when ctbrec connects to a camsite. This is used to disguise, that it actually is a recording software :)
- **httpUserAgentMobile** - Same as *httpUserAgent*, but in same cases we have to pretend to be a mobile phone :)
- **key** - Key for the HMAC based authentication. If this is set in server config and contains values, the HMAC authentication is automatically active.
- **livePreviews** (app only) - Enables the live preview feature in the app.
- **maximumResolution** - [1 - 2147483647]. Sets the maximum video height for a recording. ctbrec tries to find a stream quality, which is lower than or equal to this value. If the only provided stream quality is above this threshold, ctbrec won't record the stream.
- **minimumLengthInSeconds** - [0 - 2147483647] Automatically delete recordings, which are shorter than this amount of seconds. 0 disables this feature.
- **minimumSpaceLeftInBytes** - [0 - 9223372036854775807] The space in bytes ctbrec should conserve on the hard drive. 1 GiB = 1024 MiB = 1048576 KiB = 1073741824 bytes
- **onlineCheckIntervalInSecs** - [1 - 2147483647] How often ctbrec checks, if a model is online. This is not a guaranteed interval: If you record many models, the online check for all models can take longer than this interval. A minute is a reasonable value, but you can go lower, if you don't want to miss a anything. But don't go too low, or you risk to do too many requests in a short amount of time and get banned by some sites.
- **postProcessing** - Absolute path to a script, which is executed once a recording is finished. See [Post-Processing](/docs/PostProcessing.md).
- **recordingsDir** - Where ctbrec saves the recordings.
- **splitRecordings** (app only) - [0 - 2147483647] in seconds. Split recordings after this amount of seconds. The recordings are split up into several individual recordings,
which have the defined length (roughly). 0 means no splitting. The server does not support splitRecordings.

View File

@ -1 +1,58 @@
#### Post-Processing
#### Post-Processing
The post-processing gives you the possibility to run any script / program after a recording has finished. You can use that to convert
the files to another format, create preview images, rename / move the file etc.
There are example scripts included in the distribution zip (`pp.bat`, `pp.ps1`, `pp.sh`). See also the comments in those files.
##### Local Recording
If you are using the local recording mode, you can set the post-processing script / program on the settings tab under *Recorder* -> *Post-Processing*.
ctbrec will call the selected script after the recording has finished with the following parameters:
1. directory (absolute path)
2. file (absolute path)
3. model name
4. site name
5. unixtime (seconds since 1/1/1970 00:00)
##### Remote Recording (server)
If you are running the server and want to run a post-processing script, you have to edit the [configuration file](/docs/ConfigurationFile.md). Just set the absolute path to an executable script / program for the setting **postProcessing**. Since the recordings look a bit different for the server, the parameters, which are passed to the script are a bit different, too:
1. parent directory (absolute path)
2. directory of the recording (absolute path) - this directory contains the segments and the playlist
3. model name
4. site name
5. unixtime (seconds since 1/1/1970 00:00)
##### Example Scripts
Server script by @uo0Evx99@mastodon.cloud used on a Raspberry Pi 3 B+ to convert recordigns to mp4 files:
```
#!/bin/bash
#
#Explanation of the code: It first takes all the .ts files (because sadly the server
#doesnt save the video in 1 big file instead) and creates one big .ts file in the same
#folder called "all".
#
#Then it uses ffmpeg to re-encode the .ts file to .mp4 while just copying the audio
#and video codec to reduce the encoding time. It also uses the -movflags faststart so
#the video can be played back instantly when viewing online (e.g. with Plex)
#That re-encoded file is being stored in the folder /home/pi/hdd/plex/"MODEL NAME"/
#with the name "CURRENT TIME"-"MODEL NAME".mp4
#
#Then it deletes the folder in which all the .ts files were, because we dont need
#those anymore as we have our .mp4 file re-encoded already and ready to use/stream.
#
#This script has been used on a Raspberry Pi 3 B+
#
# $1 directory (absolute path)
# $2 file (absolute path)
# $3 model name
# $4 site name
# $5 unixtime
# format unixtime to human readable
TIME=$(date --date="@$5" +%H:%M_%d.%m.%Y)
cat $2/*.ts > "$2/all.ts" && ffmpeg -i "$2/all.ts" -acodec copy -vcodec copy -movflags faststart "/home/pi/hdd/plex/$3/$TIME-$3.mp4" && rm -r "$2"
```

View File

@ -2,7 +2,7 @@
To convert the files to another format, you have to remux them. You don't have to reencode them, since the
files (usually, have not seen an exception yet) already contain H.264 video and AAC audio. You can remux the
files manually with tools like [Avidemux](/docs/Avidemux.md), [MKVToolNix](/docs/MKVToolNix.md) or
[FFmpeg](/docs/FFmpeg.md) or use one of the post-processing scripts.
[FFmpeg](/docs/FFmpeg.md) or use one of the [post-processing](/docs/PostProcessing.md) scripts.
#### Streams are not getting recorded even though the model is online
- Is "Leave space on device set" and do you have enough space left?
@ -24,3 +24,21 @@ If you have direct access to the recordings you can use these players and open t
Otherwise use the ctbrec client. Set the **Record Location** to **Remote** and configure your server.
Under **General** select the **Player** of your choice. Then you can start the playback directly from the
**Recordings** tab.
#### Can I run several instances of CTB Recorder
It is possible to define the configuration directory and configuration file, which is used by ctbrec. This way you
can create several instances with different configurations.
On Windows, create a file called `ctbrec.l4j.ini` right next to `ctbrec.exe`. Add one of the following settings
or both to the file:
To change the config directory:
`-Dctbrec.config.dir=C:\Users\boobface\Desktop\ctbrec\conf`
To change only the config file:
`-Dctbrec.config=abc.json`
On Linux and macOS edit `ctbrec.sh` and add one or both of the above mentioned settings to the start line (preferably directly after $JAVA):
`$JAVA -Dctbrec.config=alternate-settings.json -Djdk.gtk.version=3 -cp ctbrec-1.19.1-final.jar ctbrec.ui.Launcher`