From ed080455054d1204477c47f5e576800af8fb39ea Mon Sep 17 00:00:00 2001 From: Maximo Piva Date: Tue, 22 Dec 2020 19:17:03 -0300 Subject: [PATCH 1/7] Initial commit --- LICENSE | 21 +++++++++++++++++++++ README.md | 2 ++ 2 files changed, 23 insertions(+) create mode 100644 LICENSE create mode 100644 README.md diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..21b7c2d --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Maximo Piva + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..acc0ded --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# Sushi.Net +Automatic Audio & Subtitle Shifter From 9f9c51edc3666c235d412db0582a2d288cf88070 Mon Sep 17 00:00:00 2001 From: Maximo Piva Date: Tue, 22 Dec 2020 20:39:09 -0300 Subject: [PATCH 2/7] Update README.md --- README.md | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 67 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index acc0ded..87a5ceb 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,67 @@ -# Sushi.Net -Automatic Audio & Subtitle Shifter +## v0.9 Beta + +This work is based on [Sushi](https://github.com/tp7/Sushi) and the command syntax is pretty similar, the only real difference is that the output parameter is a path, not a subtitle. +I heavy recommend following the original Sushi [Wiki](https://github.com/tp7/Sushi/wiki) before using this program. + +## Additionaly Sushi.Net supports: + +* Automatic Audio Shifting from different audio languages. +* Multiple Subtitles +* Support Resizing the subtitles (ass,ssa) to the destination video +* Third-party embedding with a standalone library + +## Downloads + +Windows x86, x64, Ubuntu x64 & OSX x64 binaries can be downloaded from releases. + +## Build & Third Party Usage + +**Sushi.Net** uses .NET 5 and is a wrapper around **Sushi.Net.Library**. + +Binaries builds are published with .NET 5 self-contained and trimmed, any native libraries (Open CV) are included in the build. + +**Sushi.Net.Library** can be used in other programs, and it will be uploaded in nuget.org when **Sushi.Net** becomes final. + +## How Audio Shifting Works. + +Basically, **Sushi.net** will normalize the destination audio stream, then find the silences in the stream, and mark the destination stream into chunks. After that, it will apply a band filter to attenuate the vocals and load both streams into memory. Those chunks will be matched against the source stream. Then the source stream will be reconstructed matching the destination stream chunks positions and saved. + +Of course, it can also shift subtitles in the same way original [Sushi](https://github.com/tp7/Sushi) does, and it supports multiple external subtitles as input (space separated) or it can get the subtitles from the --src stream if its a container. (mkv, mp4, etc). + +## Example Usage + +```sushi.net --type audio --src english.mkv --dst japanese.mkv``` + +## Requirements + +[FFMpeg](http://www.ffmpeg.org/download.html) For Audio Extraction & Manipulation. + +## Optional Requirements + +[MKVExtract](http://www.bunkus.org/videotools/mkvtoolnix/downloads.html) for timecode extraction. + +SCXvid for keyframe creation. [Windows](https://github.com/soyokaze/SCXvid-standalone/releases) Version. [Linux](https://eyalmazuz.github.io/Linux_Keyframes/) Version. [Mac](https://eyalmazuz.github.io/Linux_Keyframes/) Version. (Follow the Linux Guide replacing apt with [brew](https://brew.sh/)) + +## Sushi.Net internally uses the following third party libraries. + +[CliWrap](https://github.com/Tyrrrz/CliWrap) - Amazing and Simple way to spawn and manage executables. + +[NAudio](https://github.com/naudio/NAudio) - It manages all our wave needs. + +[NumPyDotNet](https://github.com/Quansight-Labs/numpy.net) - Is in charge of doing the calculations. + +[OpenCvSharp](https://github.com/shimat/opencvsharp) - Gives us the avenue to use Open CV. + +[OpenCV](https://opencv.org/) - Matches and compares the audio streams. + +[Thinktecture.Logging.Configuration](https://github.com/PawelGerr/Thinktecture.Logging.Configuration) - Enables us to change the loglevel on the fly. + +## Notice + +We used a custom build native version of OpenCV-OpenCVSharp, removing all the parts we don't use (Open CV compiled only with core and imgproc modules), reducing the executable in near 80 Mbytes. + +## Future + +* Currently the only native dependency is Open CV, and we only use MatchTemplate from it, I'm up to change to a .net replacement in the future. +* Better matcher, better parameters sweet spot, and better vocal filtering. + From dd1a71aaf31fb2944b0be535e8ef01a5398887f6 Mon Sep 17 00:00:00 2001 From: Maximo Piva Date: Tue, 22 Dec 2020 20:48:36 -0300 Subject: [PATCH 3/7] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 87a5ceb..a52a4a2 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,8 @@ SCXvid for keyframe creation. [Windows](https://github.com/soyokaze/SCXvid-stand We used a custom build native version of OpenCV-OpenCVSharp, removing all the parts we don't use (Open CV compiled only with core and imgproc modules), reducing the executable in near 80 Mbytes. +There are some retouched scripts and code from the original [OpenCvSharp](https://github.com/shimat/opencvsharp) distribution in the Extras directories, if you want to create the smaller native library version for other linux distributions or maybe the new M1 Macs. Just make sure, you make a pull request ;) + ## Future * Currently the only native dependency is Open CV, and we only use MatchTemplate from it, I'm up to change to a .net replacement in the future. From 6203a2a65b6c3b849797810563995c9ef999edd9 Mon Sep 17 00:00:00 2001 From: Maximo Piva Date: Wed, 23 Dec 2020 01:57:13 -0300 Subject: [PATCH 4/7] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index a52a4a2..a9b6644 100644 --- a/README.md +++ b/README.md @@ -65,5 +65,7 @@ There are some retouched scripts and code from the original [OpenCvSharp](https: ## Future * Currently the only native dependency is Open CV, and we only use MatchTemplate from it, I'm up to change to a .net replacement in the future. +* Remove NumPy dependency, and internalize required math methods. +* Revamp the whole array management using ArrayPools and Spans. * Better matcher, better parameters sweet spot, and better vocal filtering. From 37f106fdf75f833988f1670b42def95759d0eee7 Mon Sep 17 00:00:00 2001 From: Maximo Piva Date: Wed, 23 Dec 2020 09:22:32 -0300 Subject: [PATCH 5/7] Update README.md --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a9b6644..cdc4265 100644 --- a/README.md +++ b/README.md @@ -30,8 +30,12 @@ Of course, it can also shift subtitles in the same way original [Sushi](https:// ## Example Usage +Beign english.mkv and japanese.mkv to different releases from the same show/movie. + ```sushi.net --type audio --src english.mkv --dst japanese.mkv``` +Will match and english audio stream against a japanese one, the result will a new english stream that is shifted/synced for the japanese one. + ## Requirements [FFMpeg](http://www.ffmpeg.org/download.html) For Audio Extraction & Manipulation. @@ -52,7 +56,7 @@ SCXvid for keyframe creation. [Windows](https://github.com/soyokaze/SCXvid-stand [OpenCvSharp](https://github.com/shimat/opencvsharp) - Gives us the avenue to use Open CV. -[OpenCV](https://opencv.org/) - Matches and compares the audio streams. +[OpenCV](https://opencv.org/) - Matches the audio streams. [Thinktecture.Logging.Configuration](https://github.com/PawelGerr/Thinktecture.Logging.Configuration) - Enables us to change the loglevel on the fly. From 5b63edbd1a2a1fef0ace4cc30aa7b5c311836156 Mon Sep 17 00:00:00 2001 From: Maximo Piva Date: Wed, 23 Dec 2020 09:24:56 -0300 Subject: [PATCH 6/7] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cdc4265..e702571 100644 --- a/README.md +++ b/README.md @@ -30,11 +30,11 @@ Of course, it can also shift subtitles in the same way original [Sushi](https:// ## Example Usage -Beign english.mkv and japanese.mkv to different releases from the same show/movie. +Being english.mkv and japanese.mkv to different releases from the same show/movie. ```sushi.net --type audio --src english.mkv --dst japanese.mkv``` -Will match and english audio stream against a japanese one, the result will a new english stream that is shifted/synced for the japanese one. +Will match and English audio stream against a Japanese one, the result will a new English stream that is shifted/synced for the Japanese one. ## Requirements From 5a05ab5f1753e0c8e4dd9481147dc4b48857960a Mon Sep 17 00:00:00 2001 From: Maximo Piva Date: Fri, 25 Dec 2020 13:41:59 -0300 Subject: [PATCH 7/7] Update README.md --- README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/README.md b/README.md index e702571..68bca71 100644 --- a/README.md +++ b/README.md @@ -52,8 +52,6 @@ SCXvid for keyframe creation. [Windows](https://github.com/soyokaze/SCXvid-stand [NAudio](https://github.com/naudio/NAudio) - It manages all our wave needs. -[NumPyDotNet](https://github.com/Quansight-Labs/numpy.net) - Is in charge of doing the calculations. - [OpenCvSharp](https://github.com/shimat/opencvsharp) - Gives us the avenue to use Open CV. [OpenCV](https://opencv.org/) - Matches the audio streams. @@ -69,7 +67,5 @@ There are some retouched scripts and code from the original [OpenCvSharp](https: ## Future * Currently the only native dependency is Open CV, and we only use MatchTemplate from it, I'm up to change to a .net replacement in the future. -* Remove NumPy dependency, and internalize required math methods. -* Revamp the whole array management using ArrayPools and Spans. * Better matcher, better parameters sweet spot, and better vocal filtering.