Skip to content

Commit

Permalink
feat: add Split Record and Record Chapter actions (#272)
Browse files Browse the repository at this point in the history
* feat: add Split Record and Record Chapter actions

* chore: version up
  • Loading branch information
bryce-seifert authored Jun 22, 2024
1 parent 9484b50 commit 6b983a0
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 11 deletions.
25 changes: 25 additions & 0 deletions actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,31 @@ export function getActions() {
this.sendRequest('ToggleRecordPause')
},
}
actions['SplitRecordFile'] = {
name: 'Split Recording',
description: 'Requires using the Advanced output mode, and enabling file splitting in the Records settings',
options: [],
callback: () => {
this.sendRequest('SplitRecordFile')
},
}
actions['CreateRecordChapter'] = {
name: 'Create Record Chapter',
description: 'Requires using the Hybrid MP4 encoder',
options: [
{
type: 'textinput',
useVariables: true,
label: 'Chapter Name',
id: 'chapterName',
default: '',
},
],
callback: async (action) => {
const chapterName = await this.parseVariablesInString(action.options.chapterName)
this.sendRequest('CreateRecordChapter', { chapterName: chapterName })
},
}
actions['start_streaming'] = {
name: 'Start Streaming',
options: [],
Expand Down
2 changes: 1 addition & 1 deletion companion/HELP.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This module will allow you to control OBS Studio using the obs-websocket plugin.

**Recording & Streaming & Outputs**

- Recording (Toggle Record / Start / Stop / Toggle Pause / Pause / Resume)
- Recording (Toggle Record / Start / Stop / Toggle Pause / Pause / Resume / Split / Create Chapter)
- Streaming (Start / Stop / Toggle)
- Set Stream Settings
- Send Stream Caption
Expand Down
2 changes: 1 addition & 1 deletion companion/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "obs-studio",
"shortname": "obs",
"description": "Control OBS Studio using the obs-websocket plugin",
"version": "3.5.0",
"version": "3.6.0",
"license": "MIT",
"repository": "git+https://github.com/bitfocus/companion-module-obs-studio.git",
"bugs": "https://github.com/bitfocus/companion-module-obs-studio/issues",
Expand Down
5 changes: 5 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,11 @@ class OBSInstance extends InstanceBase {
this.states.replayBuffer = data.outputActive
this.checkFeedbacks('replayBufferActive')
})
this.obs.on('RecordFileChanged', (data) => {
if (data.newOutputPath) {
this.setVariableValues({ recording_file_name: data.newOutputPath.match(/[^\\\/]+(?=\.[\w]+$)|[^\\\/]+$/) })
}
})
this.obs.on('VirtualcamStateChanged', (data) => {
this.outputs['virtualcam_output'].outputActive = data.outputActive
this.checkFeedbacks('output_active')
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "obs-studio",
"version": "3.5.0",
"version": "3.6.0",
"main": "index.js",
"type": "module",
"scripts": {
Expand All @@ -16,7 +16,7 @@
"url": "git+https://github.com/bitfocus/companion-module-obs-studio.git"
},
"devDependencies": {
"@companion-module/tools": "^1.5.0"
"@companion-module/tools": "^1.5.1"
},
"prettier": "@companion-module/tools/.prettierrc.json"
}
}
12 changes: 6 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
p-timeout "^4.1.0"
tslib "^2.6.2"

"@companion-module/tools@^1.5.0":
version "1.5.0"
resolved "https://registry.yarnpkg.com/@companion-module/tools/-/tools-1.5.0.tgz#ce3cc1fc8aa71ebcbb8fcc65ccaad22099bb3c9e"
integrity sha512-J9sY2DE6i7bWYZ1uoPE8Drux53StYVqpVe+xHF0mERvV9QXOvPQ5AqxM12ts/Jd0vzd94jqLEUzm1I/y/KEWtw==
"@companion-module/tools@^1.5.1":
version "1.5.1"
resolved "https://registry.yarnpkg.com/@companion-module/tools/-/tools-1.5.1.tgz#5f5d3e65eee22926e704de3084e3f66de9d841d0"
integrity sha512-9KJC0mZLpg7dlS3MKCYzbUbOjiDMpjjwHgeAxMzh9AOM1ybgsEkmYLfIyZ/EWWSSJ/1s75IJmOtIUWVkZUuqhQ==
dependencies:
"@typescript-eslint/eslint-plugin" "^5.59.9"
"@typescript-eslint/parser" "^5.59.9"
Expand All @@ -38,7 +38,7 @@
find-up "^7.0.0"
parse-author "^2.0.0"
prettier "^2.8.8"
tar "^6.2.0"
tar "^6.2.1"
webpack "^5.90.0"
webpack-cli "^5.1.4"
zx "^7.2.3"
Expand Down Expand Up @@ -2092,7 +2092,7 @@ tapable@^2.1.1, tapable@^2.2.0:
resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.2.1.tgz#1967a73ef4060a82f12ab96af86d52fdb76eeca0"
integrity sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==

tar@^6.2.0:
tar@^6.2.1:
version "6.2.1"
resolved "https://registry.yarnpkg.com/tar/-/tar-6.2.1.tgz#717549c541bc3c2af15751bea94b1dd068d4b03a"
integrity sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==
Expand Down

0 comments on commit 6b983a0

Please sign in to comment.