Browse Source

music video template contrib (#1081)

* add another music video template

* add more music video credit templates
pull/1083/head
Jason Dove 4 years ago committed by GitHub
parent
commit
6e49ea78ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      ErsatzTV/ErsatzTV.csproj
  2. 0
      ErsatzTV/Resources/Fonts/OPTIKabel-Heavy.otf
  3. 0
      ErsatzTV/Resources/Fonts/Roboto-Regular.ttf
  4. 46
      ErsatzTV/Resources/Templates/_ArtistTitleAlbum_CenterTop.sbntxt
  5. 44
      ErsatzTV/Resources/Templates/_ArtistTitle_LeftMiddle.sbntxt
  6. 14
      ErsatzTV/Services/RunOnce/ResourceExtractorService.cs

6
ErsatzTV/ErsatzTV.csproj

@ -98,6 +98,8 @@ @@ -98,6 +98,8 @@
<ItemGroup>
<EmbeddedResource Include="Resources\background.png" />
<EmbeddedResource Include="Resources\Fonts\OPTIKabel-Heavy.otf" />
<EmbeddedResource Include="Resources\Fonts\Roboto-Regular.ttf" />
<EmbeddedResource Include="Resources\Scripts\_threePartEpisodes.js" />
<EmbeddedResource Include="Resources\Scripts\_episode.js" />
<EmbeddedResource Include="Resources\Scripts\_movie.js" />
@ -105,10 +107,10 @@ @@ -105,10 +107,10 @@
<EmbeddedResource Include="Resources\song_background_2.png" />
<EmbeddedResource Include="Resources\song_background_3.png" />
<EmbeddedResource Include="Resources\ErsatzTV.png" />
<EmbeddedResource Include="Resources\Roboto-Regular.ttf" />
<EmbeddedResource Include="Resources\OPTIKabel-Heavy.otf" />
<EmbeddedResource Include="Resources\ISO-639-2_utf-8.txt" />
<EmbeddedResource Include="Resources\Templates\_default.ass.sbntxt" />
<EmbeddedResource Include="Resources\Templates\_ArtistTitle_LeftMiddle.sbntxt" />
<EmbeddedResource Include="Resources\Templates\_ArtistTitleAlbum_CenterTop.sbntxt" />
</ItemGroup>
<ItemGroup>

0
ErsatzTV/Resources/OPTIKabel-Heavy.otf → ErsatzTV/Resources/Fonts/OPTIKabel-Heavy.otf

0
ErsatzTV/Resources/Roboto-Regular.ttf → ErsatzTV/Resources/Fonts/Roboto-Regular.ttf

46
ErsatzTV/Resources/Templates/_ArtistTitleAlbum_CenterTop.sbntxt

@ -0,0 +1,46 @@ @@ -0,0 +1,46 @@
[Script Info]
ScriptType: v4.00+
WrapStyle: 0
ScaledBorderAndShadow: yes
YCbCr Matrix: None
PlayResX: {{ resolution.width }}
PlayResY: {{ resolution.height }}
[V4+ Styles]
Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding
Style: RoboR,Roboto-Regular.ttf,{{ resolution.height // 20.0 }},&HFFFFFF,&HFFFFFF,&H444444,&H00000000,0,0,0,0,70,100,0,0,1,1,3,8,10,10,10,1
[Events]
{{~ _margin3_p = resolution.width * 0.03 | math.round ~}}
{{~ _margin5_p = resolution.height * 0.05 | math.round ~}}
{{~ _seek_s = stream_seek.total_seconds | math.round ~}}
{{~ _duration_s = duration.total_seconds | math.round ~}}
{{~ _min_interval_s = 60 ~}}
{{~ if (_duration_s | math.minus _seek_s) > _min_interval_s ~}}
{{~ _first_start_ts = timespan.from_seconds (_seek_s | math.plus 9) ~}}
{{~ _first_end_ts = timespan.from_seconds (_seek_s | math.plus 16) ~}}
{{~ end ~}}
{{~ _last_start_ts = timespan.from_seconds (_duration_s | math.minus 16) ~}}
{{~ _last_end_ts = timespan.from_seconds (_duration_s | math.minus 9) ~}}
{{~ if all_artists | array.size == 0 ~}}
{{~ capture _artists_t ~}}{{~ artist ~}}{{~ end ~}}
{{ else }}
{{~ capture _artists_t ~}}{{~ all_artists | array.join " | " ~}}{{~ end ~}}
{{~ end ~}}
{{~ capture _fancy_title_t ~}}{%{{\b1}{\fscy150}{\1c&HC2C1BF&}}%}{{~ title ~}}{{~ end ~}}
Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
Dialogue: 0,{{ _first_start_ts }}.00,{{ _first_end_ts }}.00,RoboR,,{{ _margin3_p }},{{ _margin3_p }},{{ _margin5_p }},,{\fad(1200, 1200)}{{ _artists_t }}
Dialogue: 0,{{ _first_start_ts }}.00,{{ _first_end_ts }}.00,RoboR,,{{ _margin3_p }},{{ _margin3_p }},{{ _margin5_p }},,{\fad(1200, 1200)}{{ _fancy_title_t }}
Dialogue: 0,{{ _first_start_ts }}.00,{{ _first_end_ts }}.00,RoboR,,{{ _margin3_p }},{{ _margin3_p }},{{ _margin5_p }},,{\fad(1200, 1200)}{{ album }}
{{~ _interval_s = 300 ~}}
{{~ _display_time_s = 7 ~}}
{{~ i = (_seek_s | math.plus _interval_s) ~}}
{{~ while i < (_duration_s | math.minus _min_interval_s) ~}}
{{~ _start_ts = timespan.from_seconds i ~}}
{{~ _end_ts = timespan.from_seconds (i | math.plus _display_time_s) ~}}
Dialogue: 0,{{ _start_ts }}.00,{{ _end_ts }}.00,RoboR,,{{ _margin3_p }},{{ _margin3_p }},{{ _margin5_p }},,{\fad(1200, 1200)}{{ _artists_t }}\N{{ title }}\N{{ album }}
{{~ i += _interval_s ~}}
{{~ end ~}}
Dialogue: 0,{{ _last_start_ts }}.00,{{ _last_end_ts }}.00,RoboR,,{{ _margin3_p }},{{ _margin3_p }},{{ _margin5_p }},,{\fad(1200, 1200)}{{ _artists_t }}
Dialogue: 0,{{ _last_start_ts }}.00,{{ _last_end_ts }}.00,RoboR,,{{ _margin3_p }},{{ _margin3_p }},{{ _margin5_p }},,{\fad(1200, 1200)}{{ _fancy_title_t }}
Dialogue: 0,{{ _last_start_ts }}.00,{{ _last_end_ts }}.00,RoboR,,{{ _margin3_p }},{{ _margin3_p }},{{ _margin5_p }},,{\fad(1200, 1200)}{{ album }}

44
ErsatzTV/Resources/Templates/_ArtistTitle_LeftMiddle.sbntxt

@ -0,0 +1,44 @@ @@ -0,0 +1,44 @@
[Script Info]
ScriptType: v4.00+
WrapStyle: 0
ScaledBorderAndShadow: yes
YCbCr Matrix: None
PlayResX: {{ resolution.width }}
PlayResY: {{ resolution.height }}
[V4+ Styles]
Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding
Style: RoboR,Roboto-Regular.ttf,{{ resolution.height // 20.0 }},&HFFFFFF,&HFFFFFF,&H444444,&H00000000,0,0,0,0,70,100,0,0,1,1,3,4,10,10,10,1
[Events]
{{~ _margin3_p = resolution.width * 0.03 | math.round ~}}
{{~ _margin5_p = resolution.height * 0.05 | math.round ~}}
{{~ _seek_s = stream_seek.total_seconds | math.round ~}}
{{~ _duration_s = duration.total_seconds | math.round ~}}
{{~ _min_interval_s = 60 ~}}
{{~ if (_duration_s | math.minus _seek_s) > _min_interval_s ~}}
{{~ _first_start_ts = timespan.from_seconds (_seek_s | math.plus 9) ~}}
{{~ _first_end_ts = timespan.from_seconds (_seek_s | math.plus 16) ~}}
{{~ end ~}}
{{~ _last_start_ts = timespan.from_seconds (_duration_s | math.minus 16) ~}}
{{~ _last_end_ts = timespan.from_seconds (_duration_s | math.minus 9) ~}}
{{~ if all_artists | array.size == 0 ~}}
{{~ capture _artists_t ~}}{{~ artist ~}}{{~ end ~}}
{{~ else ~}}
{{~ capture _artists_t ~}}{{~ all_artists | array.join " | " ~}}{{~ end ~}}
{{~ end ~}}
{{~ capture _fancy_title_t ~}}{%{{\b1}{\fscy150}{\1c&HC2C1BF&}}%}{{~ title ~}}{{~ end ~}}
Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
Dialogue: 0,{{ _first_start_ts }}.00,{{ _first_end_ts }}.00,RoboR,,{{ _margin3_p }},{{ _margin3_p }},{{ _margin5_p }},,{\fad(1800, 1200)}{{ _fancy_title_t }}
Dialogue: 0,{{ _first_start_ts }}.00,{{ _first_end_ts }}.00,RoboR,,{{ _margin3_p }},{{ _margin3_p }},{{ _margin5_p }},,{\fad(1200, 1800)}{{ _artists_t }}
{{~ _interval_s = 300 ~}}
{{~ _display_time_s = 7 ~}}
{{~ i = (_seek_s | math.plus _interval_s) ~}}
{{~ while i < (_duration_s | math.minus _min_interval_s) ~}}
{{~ _start_ts = timespan.from_seconds i ~}}
{{~ _end_ts = timespan.from_seconds (i | math.plus _display_time_s) ~}}
Dialogue: 0,{{ _start_ts }}.00,{{ _end_ts }}.00,RoboR,,{{ _margin3_p }},{{ _margin3_p }},{{ _margin5_p }},,{\fad(1200, 1200)}{{ _artists_t }}\N{{ title }}
{{~ i += _interval_s ~}}
{{~ end ~}}
Dialogue: 0,{{ _last_start_ts }}.00,{{ _last_end_ts }}.00,RoboR,,{{ _margin3_p }},{{ _margin3_p }},{{ _margin5_p }},,{\fad(1800, 1200)}{{ _fancy_title_t }}
Dialogue: 0,{{ _last_start_ts }}.00,{{ _last_end_ts }}.00,RoboR,,{{ _margin3_p }},{{ _margin3_p }},{{ _margin5_p }},,{\fad(1200, 1800)}{{ _artists_t }}

14
ErsatzTV/Services/RunOnce/ResourceExtractorService.cs

@ -29,6 +29,18 @@ public class ResourceExtractorService : IHostedService @@ -29,6 +29,18 @@ public class ResourceExtractorService : IHostedService
FileSystemLayout.MusicVideoCreditsTemplatesFolder,
cancellationToken);
await ExtractTemplateResource(
assembly,
"_ArtistTitle_LeftMiddle.sbntxt",
FileSystemLayout.MusicVideoCreditsTemplatesFolder,
cancellationToken);
await ExtractTemplateResource(
assembly,
"_ArtistTitleAlbum_CenterTop.sbntxt",
FileSystemLayout.MusicVideoCreditsTemplatesFolder,
cancellationToken);
await ExtractScriptResource(
assembly,
"_threePartEpisodes.js",
@ -62,7 +74,7 @@ public class ResourceExtractorService : IHostedService @@ -62,7 +74,7 @@ public class ResourceExtractorService : IHostedService
private static async Task ExtractFontResource(Assembly assembly, string name, CancellationToken cancellationToken)
{
await using Stream resource = assembly.GetManifestResourceStream($"ErsatzTV.Resources.{name}");
await using Stream resource = assembly.GetManifestResourceStream($"ErsatzTV.Resources.Fonts.{name}");
if (resource != null)
{
await using FileStream fs = File.Create(Path.Combine(FileSystemLayout.ResourcesCacheFolder, name));

Loading…
Cancel
Save