Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Amazon IVS timed metadata #135

Closed
wants to merge 20 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
af3256a
refactor: Update vcpkg.json, .gitignore, and vcpkg-configuration.json
royshil Jul 11, 2024
d8de0e9
refactor: Update timed-metadata-utils.cpp to use nlohmann/json librar…
royshil Jul 11, 2024
c0366e9
refactor: Add vcpkg installation step to build-project.yaml
royshil Jul 11, 2024
8775fa0
refactor: Update vcpkg installation step in build-project.yaml
royshil Jul 11, 2024
c862c4b
refactor: Update vcpkg installation step in build-project.yaml
royshil Jul 11, 2024
de587d6
refactor: Update vcpkg installation step in build-project.yaml
royshil Jul 11, 2024
94453d1
refactor: Improve vcpkg installation step in build-project.yaml
royshil Jul 11, 2024
92eea00
refactor: Separate cloning and bootstrap steps in FindOpenSSL.cmake
royshil Jul 11, 2024
edc6750
fix translation. more code cleanup
royshil Jul 12, 2024
1cae218
refactor: Update variable name in transcription-filter.cpp for transl…
royshil Jul 15, 2024
f30503e
refactor: Add cleared_last_sub flag to whisper-processing.cpp
royshil Jul 15, 2024
f2ef058
refactor: Update whisper-processing.cpp to add cleared_last_sub flag
royshil Jul 16, 2024
71f2fea
refactor: Update FindOpenSSL.cmake to use latest OpenSSL version
royshil Jul 17, 2024
9055ebe
Merge commit '4e3fdcd6ef47cf4b012f3d3dfa19ac0f005dc080' into roy.time…
royshil Jul 17, 2024
5ce3a53
refactor: Update timed-metadata-utils.cpp to fix JSON formatting issue
royshil Jul 17, 2024
ba929d3
refactor: Update timed-metadata-utils.cpp to fix JSON formatting issue
royshil Jul 18, 2024
763a3a0
Merge commit '19017ca17f7ece0258e4924b050cce972b7cb0ac' into roy.time…
royshil Jul 18, 2024
71beb03
refactor: Update timed-metadata-utils.cpp to fix JSON formatting issue
royshil Jul 18, 2024
b009bd0
refactor: Update vad_threshold default value to 0.95
royshil Jul 18, 2024
9f10390
refactor: Improve error handling in find_file_in_folder_by_regex_expr…
royshil Jul 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/workflows/build-project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,19 @@ jobs:
"pluginName=${ProductName}" >> $env:GITHUB_OUTPUT
"pluginVersion=${ProductVersion}" >> $env:GITHUB_OUTPUT

- name: Install vcpkg
id: vcpkg
run: |
git clone https://github.com/microsoft/vcpkg.git
cd vcpkg
.\bootstrap-vcpkg.bat
# Configure the VCPKG_ROOT and PATH environment variables
Add-Content $env:GITHUB_ENV "VCPKG_ROOT=${{ github.workspace }}/vcpkg"
Add-Content $env:GITHUB_PATH "${{ github.workspace }}/vcpkg"
# Install the necessary packages
cd ..
vcpkg install

- name: Build Plugin 🧱
uses: ./.github/actions/build-plugin
with:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
!README.md
!/vendor
!patch_libobs.diff
!vcpkg.json
!vcpkg-configuration.json

# Exclude lock files
*.lock.json
Expand Down
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ include(cmake/BuildCTranslate2.cmake)
include(cmake/BuildSentencepiece.cmake)
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE ct2 sentencepiece)

include(cmake/FindOpenSSL.cmake)

set(USE_SYSTEM_ONNXRUNTIME
OFF
CACHE STRING "Use system ONNX Runtime")
Expand Down Expand Up @@ -100,6 +102,7 @@ target_sources(
src/whisper-utils/whisper-model-utils.cpp
src/whisper-utils/silero-vad-onnx.cpp
src/whisper-utils/token-buffer-thread.cpp
src/timed-metadata/timed-metadata-utils.cpp
src/translation/language_codes.cpp
src/translation/translation.cpp
src/translation/translation-utils.cpp
Expand Down
2 changes: 1 addition & 1 deletion buildspec.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
},
"name": "obs-localvocal",
"displayName": "OBS Localvocal",
"version": "0.3.2",
"version": "0.3.3",
"author": "Roy Shilkrot",
"website": "https://github.com/occ-ai/obs-localvocal",
"email": "[email protected]",
Expand Down
30 changes: 30 additions & 0 deletions cmake/FindOpenSSL.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
if(WIN32)
set(OPENSSL_ROOT_DIR
"${CMAKE_CURRENT_SOURCE_DIR}/vcpkg_installed/x64-windows"
CACHE STRING "Path to OpenSSL")
elseif(APPLE)
include(FetchContent)

FetchContent_Declare(
openssl-macos-fetch
URL "https://github.com/occ-ai/occ-ai-dep-openssl/releases/download/0.0.1/openssl-3.3.1-macos.tar.gz"
URL_HASH SHA256=d578921b7168e21451f0b6e4ac4cb989c17abc6829c8c43f32136c1c2544ffde)

FetchContent_MakeAvailable(openssl-macos-fetch)

set(OPENSSL_ROOT_DIR
"${openssl-macos-fetch_SOURCE_DIR}"
CACHE STRING "Path to OpenSSL")
endif()

find_package(OpenSSL REQUIRED)
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE OpenSSL::SSL)
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE OpenSSL::Crypto)

# copy the openssl dlls to the release directory
if(WIN32)
set(OpenSS_LIB_NAMES "libcrypto-3-x64" "libssl-3-x64")
foreach(lib_name IN LISTS OpenSS_LIB_NAMES)
install(FILES ${OPENSSL_ROOT_DIR}/bin/${lib_name}.dll DESTINATION "obs-plugins/64bit")
endforeach()
endif()
5 changes: 5 additions & 0 deletions data/locale/en-US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ buffer_num_lines="Number of lines"
buffer_num_chars_per_line="Amount per line"
buffer_output_type="Output type"
open_filter_ui="Setup Filter and Replace"
amazon_ivs_parameters="Amazon IVS Integration"
amazon_ivs_channel_arn="Amazon IVS Channel ARN"
aws_access_key="AWS Access Key"
aws_secret_key="AWS Secret Key"
aws_region="AWS Region"
advanced_settings_mode="Mode"
simple_mode="Simple"
advanced_mode="Advanced"
Expand Down
25 changes: 21 additions & 4 deletions src/model-utils/model-find-utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,28 @@ std::string find_file_in_folder_by_name(const std::string &folder_path,
std::string find_file_in_folder_by_regex_expression(const std::string &folder_path,
const std::string &file_name_regex)
{
for (const auto &entry : std::filesystem::directory_iterator(folder_path)) {
if (std::regex_match(entry.path().filename().string(),
std::regex(file_name_regex))) {
return entry.path().string();
if (!std::filesystem::exists(folder_path)) {
obs_log(LOG_ERROR, "Folder does not exist: %s", folder_path.c_str());
return "";
}
if (!std::filesystem::is_directory(folder_path)) {
obs_log(LOG_ERROR, "Path is not a folder: %s", folder_path.c_str());
return "";
}
if (file_name_regex.empty()) {
obs_log(LOG_ERROR, "Empty file name regex");
return "";
}
try {
for (const auto &entry : std::filesystem::directory_iterator(folder_path)) {
if (std::regex_match(entry.path().filename().string(),
std::regex(file_name_regex))) {
return entry.path().string();
}
}
} catch (const std::exception &e) {
obs_log(LOG_ERROR, "Error finding file in folder by regex expression: %s",
e.what());
}
return "";
}
Expand Down
Loading
Loading