From c569e02d8ab5ebcbb5a44e10c14799fa097c9bc7 Mon Sep 17 00:00:00 2001 From: Sacha Chua Date: Wed, 2 Nov 2022 13:08:03 -0400 Subject: OBS overlays, starting to get publish and edit on res --- roles/obs/overlay.svg | 301 ++++++++++++++++++++++++++++++++++++++++ roles/obs/tasks/main.yml | 14 +- roles/obs/tasks/obs-setup.yml | 32 ++++- roles/obs/tasks/track.yml | 15 +- roles/obs/tasks/user.yml | 3 +- roles/obs/templates/mpv.conf | 2 +- roles/obs/templates/scenes.json | 77 +++++----- 7 files changed, 391 insertions(+), 53 deletions(-) create mode 100644 roles/obs/overlay.svg (limited to 'roles/obs') diff --git a/roles/obs/overlay.svg b/roles/obs/overlay.svg new file mode 100644 index 0000000..73a7e6f --- /dev/null +++ b/roles/obs/overlay.svg @@ -0,0 +1,301 @@ + +image/svg+xmlInitializing...Initializing...Initializing... diff --git a/roles/obs/tasks/main.yml b/roles/obs/tasks/main.yml index 36e14c3..bf856ec 100644 --- a/roles/obs/tasks/main.yml +++ b/roles/obs/tasks/main.yml @@ -1,5 +1,5 @@ - name: Load icecast vars - tags: wip + tags: obs-profile, wip include_vars: file: ../../stream/defaults/main.yml - name: Add repo @@ -53,5 +53,13 @@ regexp: '(AllowUsers(?!.*\b{{ emacsconf_id }}-{{ item.id }}\b).*)$' replace: \1 {{ emacsconf_id }}-{{ item.id }} loop: "{{ emacsconf_tracks }}" - - +- name: Allow sudo from {{ emacsconf_user }} to the stream users + tags: wip + become: true + become_user: root + copy: + content: | + {% for item in emacsconf_tracks %} + {{ emacsconf_user }} ALL=({{ emacsconf_id }}-{{ item.id }}) NOPASSWD: ALL + {% endfor %} + dest: /etc/sudoers.d/50_emacsconf diff --git a/roles/obs/tasks/obs-setup.yml b/roles/obs/tasks/obs-setup.yml index 1da678a..59170f1 100644 --- a/roles/obs/tasks/obs-setup.yml +++ b/roles/obs/tasks/obs-setup.yml @@ -6,13 +6,12 @@ state: directory - name: Create profile directories file: - path: "~{{ emacsconf_user }}/.config/obs-studio/basic/{{ item.name }}" + path: "~{{ emacsconf_user }}/.config/obs-studio/basic/profiles/{{ item.name }}" state: directory owner: "{{ emacsconf_user }}" group: "{{ emacsconf_group }}" mode: 0775 - name: Install OBS global profile - tags: wip template: src: global.ini owner: "{{ emacsconf_user }}" @@ -23,7 +22,7 @@ src: profile.ini owner: "{{ emacsconf_user }}" group: "{{ emacsconf_group }}" - dest: "~{{ emacsconf_user }}/.config/obs-studio/basic/{{ item.name }}/basic.ini" + dest: "~{{ emacsconf_user }}/.config/obs-studio/basic/profiles/{{ item.name }}/basic.ini" mode: 0664 - name: Install OBS scenes tags: obs-scene @@ -32,17 +31,33 @@ owner: "{{ emacsconf_user }}" group: "{{ emacsconf_group }}" dest: "~{{ emacsconf_user }}/.config/obs-studio/basic/scenes/{{ item.id }}.json" +- name: Copy overlay template for video + tags: obs-scene + copy: + src: overlay.svg + dest: "~{{ emacsconf_user }}/video.svg" + owner: "{{ emacsconf_user }}" + group: "{{ emacsconf_group }}" +- name: Copy overlay template for video + tags: obs-scene + copy: + src: overlay.svg + dest: "~{{ emacsconf_user }}/other.svg" + owner: "{{ emacsconf_user }}" + group: "{{ emacsconf_group }}" - name: Create text files for OBS sources copy: content: "Initializing..." owner: "{{ emacsconf_user }}" group: "{{ emacsconf_group }}" - dest: "~{{ emacsconf_user }}/{{ item }}.txt" + dest: "~{{ emacsconf_user }}/{{ filename }}.txt" mode: 0664 loop: - news - url - bottom + loop_control: + loop_var: filename - name: Create OBS scripts for tracks template: src: obs-track @@ -50,4 +65,11 @@ owner: "{{ emacsconf_user }}" group: "{{ emacsconf_group }}" mode: 0775 - +- name: Fix permissions + become: true + become_user: root + file: + path: "~{{ emacsconf_user }}" + owner: "{{ emacsconf_user }}" + group: "{{ emacsconf_group }}" + recurse: true diff --git a/roles/obs/tasks/track.yml b/roles/obs/tasks/track.yml index 93b789d..a0acf16 100644 --- a/roles/obs/tasks/track.yml +++ b/roles/obs/tasks/track.yml @@ -1,5 +1,5 @@ - name: Set vars - tags: wip, obs-scene, mpv + tags: obs-scene, obs-profile, mpv, wip set_fact: old_emacsconf_user: "{{ emacsconf_user }}" old_emacsconf_home: "{{ emacsconf_home }}" @@ -10,7 +10,7 @@ - name: Set up user include: user.yml - name: Set up user-related things - become: "{{ emacsconf_user }}" + become_user: "{{ emacsconf_user }}" block: - name: Set up track bins for addition to paths file: @@ -27,6 +27,7 @@ group: "{{ emacsconf_group }}" state: directory - name: Add MPV profile + tags: mpv-conf template: src: mpv.conf dest: "~{{ emacsconf_user }}/.config/mpv/mpv.conf" @@ -40,8 +41,12 @@ group: "{{ emacsconf_group }}" mode: 0775 - name: Set up OBS profiles and scenes - tags: obs-profile - include: obs-setup.yml + tags: obs-profile, obs-scene + include_tasks: + file: obs-setup.yml + apply: + tags: + - obs-profile - name: Add FFMPEG script for streaming template: src: stream-desktop-with-ffmpeg.sh @@ -75,7 +80,7 @@ owner: "{{ emacsconf_user }}" group: "{{ emacsconf_group }}" - name: Reset vars - tags: wip, obs-scene, mpv + tags: obs-scene, obs-profile, mpv, wip set_fact: old_emacsconf_user: "{{ emacsconf_user }}" old_emacsconf_home: "{{ emacsconf_home }}" diff --git a/roles/obs/tasks/user.yml b/roles/obs/tasks/user.yml index a941d7f..caaf2d9 100644 --- a/roles/obs/tasks/user.yml +++ b/roles/obs/tasks/user.yml @@ -2,7 +2,6 @@ group: name: "{{ emacsconf_group }}" - name: Add user - tags: wip user: name: "{{ emacsconf_user }}" group: "{{ emacsconf_group }}" @@ -15,10 +14,10 @@ state: directory mode: 700 - name: Set up SSH key access + tags: wip template: src: authorized_keys dest: "/home/{{ emacsconf_user }}/.ssh/authorized_keys" - force: no - name: Change ownership of SSH directory file: path: "/home/{{ emacsconf_user }}/.ssh" diff --git a/roles/obs/templates/mpv.conf b/roles/obs/templates/mpv.conf index 9aff3ee..b1bd1ca 100644 --- a/roles/obs/templates/mpv.conf +++ b/roles/obs/templates/mpv.conf @@ -15,7 +15,7 @@ sub-use-margins=yes sub-scale-by-window=yes sub-pos=103 sub-margin-x=120 -sub-margin-y=40 +sub-margin-y=20 sub-align-x=left # Style sub-font="{{ emacsconf_font }}" diff --git a/roles/obs/templates/scenes.json b/roles/obs/templates/scenes.json index 4e6e4bd..a92f29e 100644 --- a/roles/obs/templates/scenes.json +++ b/roles/obs/templates/scenes.json @@ -1,6 +1,6 @@ { - "current_program_scene": "All track audio and screen", - "current_scene": "All track audio and screen", + "current_program_scene": "Video audio and screen", + "current_scene": "Video audio and screen", "current_transition": "Fade", "groups": [ { @@ -30,8 +30,8 @@ "push-to-talk-delay": 0, "settings": { "custom_size": true, - "cx": 103, - "cy": 507, + "cx": 494, + "cy": 715, "id_counter": 0, "items": [ { @@ -56,11 +56,11 @@ "locked": false, "name": "News", "pos": { - "x": 22, - "y": 390 + "x": 12, + "y": 0 }, "private_settings": {}, - "rot": -90, + "rot": 0, "scale": { "x": 1, "y": 1 @@ -93,11 +93,11 @@ "locked": false, "name": "URL", "pos": { - "x": 55, - "y": 389 + "x": 114, + "y": 691 }, "private_settings": {}, - "rot": -90, + "rot": 0, "scale": { "x": 1, "y": 1 @@ -131,7 +131,7 @@ "name": "Logo", "pos": { "x": 0, - "y": 404 + "y": 603 }, "private_settings": {}, "rot": 0, @@ -236,6 +236,8 @@ "push-to-talk": false, "push-to-talk-delay": 0, "settings": { + "color2": 4294967295, + "drop_shadow": false, "font": { "face": "Sans Serif", "flags": 0, @@ -243,6 +245,7 @@ "style": "" }, "from_file": true, + "outline": true, "text_file": "/home/{{ emacsconf_id }}-{{ item.id }}/news.txt" }, "sync": 0, @@ -271,7 +274,7 @@ "font": { "face": "Sans Serif", "flags": 0, - "size": 24, + "size": 20, "style": "" }, "from_file": true, @@ -346,14 +349,14 @@ "OBSBasic.SelectScene": [], "libobs.hide_scene_item.Bottom": [], "libobs.hide_scene_item.Screen Capture (XSHM)": [], - "libobs.hide_scene_item.dev-qa": [], - "libobs.hide_scene_item.dev-vid": [], "libobs.hide_scene_item.emacsconf base": [], + "libobs.hide_scene_item.gen-qa": [], + "libobs.hide_scene_item.gen-vid": [], "libobs.show_scene_item.Bottom": [], "libobs.show_scene_item.Screen Capture (XSHM)": [], - "libobs.show_scene_item.dev-qa": [], - "libobs.show_scene_item.dev-vid": [], - "libobs.show_scene_item.emacsconf base": [] + "libobs.show_scene_item.emacsconf base": [], + "libobs.show_scene_item.gen-qa": [], + "libobs.show_scene_item.gen-vid": [] }, "id": "scene", "mixers": 0, @@ -503,11 +506,11 @@ "locked": false, "name": "News", "pos": { - "x": 31, - "y": 595 + "x": 21, + "y": 6 }, "private_settings": {}, - "rot": -90, + "rot": 0, "scale": { "x": 1, "y": 1 @@ -540,11 +543,11 @@ "locked": false, "name": "URL", "pos": { - "x": 64, - "y": 594 + "x": 123, + "y": 697 }, "private_settings": {}, - "rot": -90, + "rot": 0, "scale": { "x": 1, "y": 1 @@ -615,7 +618,7 @@ "name": "{{ emacsconf_id }} base", "pos": { "x": 9, - "y": 205 + "y": 6 }, "private_settings": {}, "rot": 0, @@ -734,11 +737,11 @@ "hotkeys": { "OBSBasic.SelectScene": [], "libobs.hide_scene_item.Screen Capture (XSHM)": [], - "libobs.hide_scene_item.dev-vid": [], "libobs.hide_scene_item.emacsconf base": [], + "libobs.hide_scene_item.gen-vid": [], "libobs.show_scene_item.Screen Capture (XSHM)": [], - "libobs.show_scene_item.dev-vid": [], - "libobs.show_scene_item.emacsconf base": [] + "libobs.show_scene_item.emacsconf base": [], + "libobs.show_scene_item.gen-vid": [] }, "id": "scene", "mixers": 0, @@ -851,11 +854,11 @@ "locked": false, "name": "News", "pos": { - "x": 31, - "y": 580 + "x": 12, + "y": 0 }, "private_settings": {}, - "rot": -90, + "rot": 0, "scale": { "x": 1, "y": 1 @@ -888,11 +891,11 @@ "locked": false, "name": "URL", "pos": { - "x": 64, - "y": 579 + "x": 114, + "y": 691 }, "private_settings": {}, - "rot": -90, + "rot": 0, "scale": { "x": 1, "y": 1 @@ -925,8 +928,8 @@ "locked": false, "name": "Logo", "pos": { - "x": 9, - "y": 594 + "x": 0, + "y": 603 }, "private_settings": {}, "rot": 0, @@ -962,8 +965,8 @@ "locked": false, "name": "{{ emacsconf_id }} base", "pos": { - "x": 9, - "y": 190 + "x": 0, + "y": 0 }, "private_settings": {}, "rot": 0, -- cgit v1.2.3