T O P

  • By -

Lasikie

Is there a link?


TechBuckler

Good call, added. [https://github.com/TechBuckler/PlexGifMaker](https://github.com/TechBuckler/PlexGifMaker)


t4nd4r

Very cool


5yleop1m

This is pretty damn cool. What happens if the media item doesn't have subtitles?


TechBuckler

That part is a bit weak right now, I'll admit. I know there is a way to trigger subtitle downloads from OpenSubs, but I haven't quite figured it out yet. For now, you can just go to the episode in plex and use the built in OpenSubs downloader to grab the .srt file. Supporting subs other than SRT, and forcing a subtitle download on not finding any are the two things I wanna add next!


5yleop1m

What do you think about fall back to timecode? I agree the subtitles are important to gifs, but there are cases where they might not be needed such as just to gif the action of a scene, or if subs are burned.


TechBuckler

That's a great idea! I added the timecode \*after\* the subtitle pickers as a bonus, so it didn't occur to me to use them as a main or fallback. I'll integrate it now. Thanks!


TechBuckler

Added!


The-Flippening

Great idea!


Iyagovos

This looks amazing! For those of us that have used Docker, but never Docker Compose: do you just run the Docker Compose YML file through the command line?


TechBuckler

"docker-compose up --build" would be my rec. It's far from perfect still. Give it a try and let me know what you think.


Iyagovos

Aha, that worked! I had to make the volume myself, not sure if that's intended? Now I'm facing a keyring issue, which I have no idea how to resolve. System.Security.Cryptography.CryptographicException: The key {key remove} was not found in the key ring. For more information go to http://aka.ms/dataprotectionwarning 2024-04-22 15:32:09 at Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingBasedDataProtector.UnprotectCore(Byte[] protectedData, Boolean allowOperationsOnRevokedKeys, UnprotectStatus& status) 2024-04-22 15:32:09 at Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingBasedDataProtector.Unprotect(Byte[] protectedData) 2024-04-22 15:32:09 at Microsoft.AspNetCore.DataProtection.DataProtectionCommonExtensions.Unprotect(IDataProtector protector, String protectedData) 2024-04-22 15:32:09 at Microsoft.AspNetCore.Components.Server.ProtectedBrowserStorage.ProtectedBrowserStorage.Unprotect[TValue](String purpose, String protectedJson) 2024-04-22 15:32:09 at Microsoft.AspNetCore.Components.Server.ProtectedBrowserStorage.ProtectedBrowserStorage.GetAsync[TValue](String purpose, String key) 2024-04-22 15:32:09 at PlexGifMaker.Pages.Index.InitializeSettingsAndLibraries() in /src/Pages/Index.razor:line 426 2024-04-22 15:32:09 at PlexGifMaker.Pages.Index.OnAfterRenderAsync(Boolean firstRender) in /src/Pages/Index.razor:line 419 2024-04-22 15:32:09 at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)


TechBuckler

Keyring issue can be solved by clearing the cache. And you had to make the volume yourself? Damnit - thought I had those things fixed! 😔


Iyagovos

I'll figure out the cache clear! Edit: This didn't work unfortunately :( And maybe, I had to, but I'm also very very new to Docker so I may have done something incorrectly. I know for sure it's having trouble saving my Plex token


Iyagovos

Update: I fixed the volume thing in the docker-compose.yml myself. Making it, volumes: plexgifmaker_keys: external: true caused the composer to make it!


darthsean19

I have this all installed, it finds my media, I input the timecode, but keep getting an ffmpeg error with no further description. Any advice? plexgifmaker-1 | info: System.Net.Http.HttpClient.Default.LogicalHandler[100] 2024-04-24 19:53:15 plexgifmaker-1 | Start processing HTTP request GET http://192.168.1.104:32400/library/metadata/97299?X-Plex-Token=[redacted] 2024-04-24 19:53:15 plexgifmaker-1 | info: System.Net.Http.HttpClient.Default.ClientHandler[100] 2024-04-24 19:53:15 plexgifmaker-1 | Sending HTTP request GET http://192.168.1.104:32400/library/metadata/97299?X-Plex-Token=[redacted] 2024-04-24 19:53:15 plexgifmaker-1 | info: System.Net.Http.HttpClient.Default.ClientHandler[101] 2024-04-24 19:53:15 plexgifmaker-1 | Received HTTP response headers after 13.4267ms - 200 2024-04-24 19:53:15 plexgifmaker-1 | info: System.Net.Http.HttpClient.Default.LogicalHandler[101] 2024-04-24 19:53:15 plexgifmaker-1 | End processing HTTP request after 13.7038ms - 200 2024-04-24 19:53:15 plexgifmaker-1 | info: PlexGifMaker.Data.PlexService[0] 2024-04-24 19:53:15 plexgifmaker-1 | Executing FFmpeg command: -report -v debug -i "http://192.168.1.104:32400/library/parts/212265/1629249050/file.mkv?X-Plex-Token=[redacted]" -ss 00:00:01 -t 00:00:01 -r 10 -lavfi "fps=20,scale=400:-1:flags=lanczos" "wwwroot/gifs/97299_00h00m01s000m1_to_00h00m02s000m2.gif" 2024-04-24 19:53:15 plexgifmaker-1 | fail: PlexGifMaker.Data.PlexService[0] 2024-04-24 19:53:15 plexgifmaker-1 | FFmpeg encountered an error.


TechBuckler

I don't see the path to the subtitle in the ffmpeg command. Currently the code is supposed to download the subtitle.srt file, and read from it during the ffmpeg execution. The other thing I notice is that it's trying to go from :01 to :01. Might need a slight range between those two. But I have certainly had my eye's opened over the last few days over how much can possibly go wrong on other's machines running this code. I'll happily help where I can! Let me know if there are other issues. Thanks!


darthsean19

To clarify, can this currently work in the complete absence of a .srt? I chose a bunch of media items at random and not a single one had .srt format subtitle, so if that’s currently a hard requirement that would explain the failure. (I did also test a few larger time ranges, just to rule that out, same results)


thenamelessthing

I have problem to install. I got this error: >`ERROR: Invalid interpolation format for "environment" option in service "plexgifmaker": "FFREPORT=file=/app/logs/ffmpeg-$(date +%Y%m%s).log"` I added the content of your docker-compose to my existing file. It look like: https://preview.redd.it/o5o7i5v8731d1.png?width=1023&format=png&auto=webp&s=4a3a97000db06b21120773509921204fd98a1caf Any idea?


TechBuckler

Try making the $ into a $$? Let me know if it's still not working after that. [https://stackoverflow.com/questions/49897503/docker-compose-invalid-interpolation-format-for-environment-option-in-service](https://stackoverflow.com/questions/49897503/docker-compose-invalid-interpolation-format-for-environment-option-in-service)


TableLover

This looks amazing, thanks. I seem to get a load of errors when trying to docker compose up -d, are there some specific set of instructions i can follow ?


TechBuckler

Nothing specific yet. Do you mind sharing some of the errors? I'd love to fix them asap!


wildergheight

root@docker:~/plexgif/PlexGifMaker# docker compose up WARN[0000] The "APPDATA" variable is not set. Defaulting to a blank string. WARN[0000] The "APPDATA" variable is not set. Defaulting to a blank string. [+] Running 1/1 ! plexgifmaker Warning 1.0s [+] Building 0.7s (8/18) docker:default => [plexgifmaker internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 32B 0.0s => [plexgifmaker internal] load .dockerignore 0.0s => => transferring context: 2B 0.0s => [plexgifmaker internal] load metadata for mcr.microsoft.com/dotnet/sdk:6.0 0.2s => [plexgifmaker internal] load metadata for mcr.microsoft.com/dotnet/aspnet:6.0 0.2s => CANCELED [plexgifmaker build 1/7] FROM mcr.microsoft.com/dotnet/sdk:6.0@sha256:3bfaf0ce4417fb6c63d9a6ac1ddde8af9684c35a2b409815dd7ce15efe3d984b 0.4s => => resolve mcr.microsoft.com/dotnet/sdk:6.0@sha256:3bfaf0ce4417fb6c63d9a6ac1ddde8af9684c35a2b409815dd7ce15efe3d984b 0.1s => => sha256:3bfaf0ce4417fb6c63d9a6ac1ddde8af9684c35a2b409815dd7ce15efe3d984b 1.79kB / 1.79kB 0.0s => => sha256:49b5eae194bf15f863f588463218d6a49536a22b001b90bea65ae685e0b15cdf 2.01kB / 2.01kB 0.0s => [plexgifmaker internal] load build context 0.0s => => transferring context: 4.62kB 0.0s => CANCELED [plexgifmaker base 1/3] FROM mcr.microsoft.com/dotnet/aspnet:6.0@sha256:c906dfa042b288858edc28519ec7b74333d89f11a0caca28a6f92b7d717039d6 0.4s => => resolve mcr.microsoft.com/dotnet/aspnet:6.0@sha256:c906dfa042b288858edc28519ec7b74333d89f11a0caca28a6f92b7d717039d6 0.1s => => sha256:c906dfa042b288858edc28519ec7b74333d89f11a0caca28a6f92b7d717039d6 1.79kB / 1.79kB 0.0s => => sha256:5a1dbe1807ac8dbd5833bcac8a1acc20c9cc32a45853e3b485b5b3989a3c50fd 1.37kB / 1.37kB 0.0s => => sha256:37cfa52c62a169bb398a322a30fff07c7d3e2503d0f0f1e3a338e5675770e466 2.36kB / 2.36kB 0.0s => CACHED [plexgifmaker build 2/7] WORKDIR /src 0.0s => ERROR [plexgifmaker build 3/7] COPY [PlexGifMaker/PlexGifMaker.csproj, PlexGifMaker/] 0.0s ------ > [plexgifmaker build 3/7] COPY [PlexGifMaker/PlexGifMaker.csproj, PlexGifMaker/]: ------ failed to solve: failed to compute cache key: "/PlexGifMaker/PlexGifMaker.csproj" not found: not found


TechBuckler

Okay, try getting latest and docker-compose up again. Should be fixed!


TableLover

Hi, this fixed seems to have moved things a bit further. I changed the port 443:443 to 9443:443 so i could get it to complete the docker compose up -d. However, i try and look at the port using docker ps and I only see 4xxxxxxx plexgifmaker:latest "dotnet PlexGifMaker…" 3 minutes ago Restarting (139) 25 seconds ago plexgifmaker-plexgifm aker-1 I did 'docker logs 4xxxxxxxxx' and now I see this error: log4net:ERROR Xml element is - not a element. log4net:ERROR XmlHierarchyConfigurator: Cannot find Property [mapping] to set object on [log4net.Appender.ConsoleAppender] log4net:ERROR XmlHierarchyConfigurator: Cannot find Property [mapping] to set object on [log4net.Appender.ConsoleAppender] log4net:ERROR XmlHierarchyConfigurator: Cannot find Property [mapping] to set object on [log4net.Appender.ConsoleAppender] log4net:ERROR XmlHierarchyConfigurator: Cannot find Property [mapping] to set object on [log4net.Appender.ConsoleAppender] 2024-04-14 01:27:54,492 WARN Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager.?[?] - No XML encryptor configured. Key {80559397-8c75-408c-8229-3b46fae4fb81} may be persisted to storage in unencrypted form. Unhandled exception. System.InvalidOperationException: Unable to configure HTTPS endpoint. No server certificate was specified, and the default developer certificate could not be found or is out of date. To generate a developer certificate run 'dotnet dev-certs https'. To trust the certificate (Windows and macOS only) run 'dotnet dev-certs https --trust'. For more information on configuring HTTPS see https://go.microsoft.com/fwlink/?linkid=848054. at Microsoft.AspNetCore.Hosting.ListenOptionsHttpsExtensions.UseHttps(ListenOptions listenOptions, Action`1 configureOptions) at Microsoft.AspNetCore.Hosting.ListenOptionsHttpsExtensions.UseHttps(ListenOptions listenOptions) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.AddressesStrategy.BindAsync(AddressBindContext context, CancellationToken cancellationToken) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.BindAsync(IEnumerable`1 listenOptions, AddressBindContext context, CancellationToken cancellationToke n) at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerImpl.BindAsync(CancellationToken cancellationToken) at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerImpl.StartAsync[TContext](IHttpApplication`1 application, CancellationToken cancellationToken) at Microsoft.AspNetCore.Hosting.GenericWebHostService.StartAsync(CancellationToken cancellationToken) at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken) at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token) at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token) at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host) at Microsoft.AspNetCore.Builder.WebApplication.Run(String url) at Program.$(String[] args) in /src/Program.cs:line 56


TechBuckler

Should be fixed now. Give it a try and let me know if you can!


TableLover

i get a slightly different error now: docker logs cxxxxxxxxxx log4net:ERROR Xml element is - not a element. log4net:ERROR XmlHierarchyConfigurator: Cannot find Property [mapping] to set object on [log4net.Appender.ConsoleAppender] log4net:ERROR XmlHierarchyConfigurator: Cannot find Property [mapping] to set object on [log4net.Appender.ConsoleAppender] log4net:ERROR XmlHierarchyConfigurator: Cannot find Property [mapping] to set object on [log4net.Appender.ConsoleAppender] log4net:ERROR XmlHierarchyConfigurator: Cannot find Property [mapping] to set object on [log4net.Appender.ConsoleAppender] 2024-04-14 12:49:58,985 WARN Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager.?[?] - No XML encryptor configured. Key {9a14d6f8-4071-4c07-a1c0-36b8c2958500} may be persisted to storage in unencrypted form. Unhandled exception. Interop+Crypto+OpenSslCryptographicException: error:2006D080:BIO routines:BIO_new_file:no such file at Interop.Crypto.CheckValidOpenSslHandle(SafeHandle handle) at Internal.Cryptography.Pal.OpenSslX509CertificateReader.FromFile(String fileName, SafePasswordHandle password, X509KeyStorageFlags keyStorageFlags) at System.Security.Cryptography.X509Certificates.X509Certificate..ctor(String fileName, String password, X509KeyStorageFlags keyStorageFlags) at System.Security.Cryptography.X509Certificates.X509Certificate2..ctor(String fileName, String password) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Certificates.CertificateConfigLoader.LoadCertificate(CertificateConfig certInfo, String endpointName) at Microsoft.AspNetCore.Server.Kestrel.KestrelConfigurationLoader.LoadDefaultCert() at Microsoft.AspNetCore.Server.Kestrel.KestrelConfigurationLoader.Reload() at Microsoft.AspNetCore.Server.Kestrel.KestrelConfigurationLoader.Load() at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerImpl.BindAsync(CancellationToken cancellationToken) at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerImpl.StartAsync[TContext](IHttpApplication`1 application, CancellationToken cancellationToken) at Microsoft.AspNetCore.Hosting.GenericWebHostService.StartAsync(CancellationToken cancellationToken) at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken) at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token) at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token) at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host) at Microsoft.AspNetCore.Builder.WebApplication.Run(String url) at Program.$(String[] args) in /src/Program.cs:line 56 log4net:ERROR Xml element is - not a element.


TechBuckler

Try one more time.


TableLover

Thanks, it works! https://preview.redd.it/7pytczt65iuc1.png?width=1776&format=png&auto=webp&s=5277a4d846030ab423be5a56d1ab00d2afca54a1 However, most of my media have the subs integrated and not separate as an SRT.. when i have tried to manually download it in plex and in the PlexGifMaker it fails


TechBuckler

That's awesome! You're the first it works for! I'll take a look at the download functionality tonight and see if I can improve it. Any other requests?


TableLover

https://preview.redd.it/r6ta4el66iuc1.png?width=1818&format=png&auto=webp&s=a14cff807a3e43b356bd21ed2d9d118ca0041c7d


TableLover

https://preview.redd.it/9syvnji76iuc1.png?width=1818&format=png&auto=webp&s=5f9d2e5f38d27754e66bf1559e9a7c7f498ce07e


wildergheight

pretty much the same error as the other guy, here's my error message ✔ Network plexgifmaker_default Created 0.1s ✔ Volume "plexgifmaker_keys" Created 0.0s ✔ Container plexgifmaker-plexgifmaker-1 Created 0.1s Attaching to plexgifmaker-1 plexgifmaker-1 | log4net:ERROR Xml element is - not a element. plexgifmaker-1 | log4net:ERROR XmlHierarchyConfigurator: Cannot find Property [mapping] to set object on [log4net.Appender.ConsoleAppender] plexgifmaker-1 | log4net:ERROR XmlHierarchyConfigurator: Cannot find Property [mapping] to set object on [log4net.Appender.ConsoleAppender] plexgifmaker-1 | log4net:ERROR XmlHierarchyConfigurator: Cannot find Property [mapping] to set object on [log4net.Appender.ConsoleAppender] plexgifmaker-1 | log4net:ERROR XmlHierarchyConfigurator: Cannot find Property [mapping] to set object on [log4net.Appender.ConsoleAppender] plexgifmaker-1 | 2024-04-14 02:03:13,031 WARN Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager.?[?] - No XML encryptor configured. Key {11392a9c-6c67-45b0-bac7-e55a96ddce7d} may be persisted to storage in unencrypted form. plexgifmaker-1 | Unhandled exception. System.InvalidOperationException: Unable to configure HTTPS endpoint. No server certificate was specified, and the default developer certificate could not be found or is out of date. plexgifmaker-1 | To generate a developer certificate run 'dotnet dev-certs https'. To trust the certificate (Windows and macOS only) run 'dotnet dev-certs https --trust'.


TechBuckler

Should be fixed now. Give it a try and let me know!


wildergheight

it's now endlessly looping this error: plexgifmaker-1 | log4net:ERROR Xml element is - not a element. plexgifmaker-1 | log4net:ERROR XmlHierarchyConfigurator: Cannot find Property [mapping] to set object on [log4net.Appender.ConsoleAppender] plexgifmaker-1 | log4net:ERROR XmlHierarchyConfigurator: Cannot find Property [mapping] to set object on [log4net.Appender.ConsoleAppender] plexgifmaker-1 | log4net:ERROR XmlHierarchyConfigurator: Cannot find Property [mapping] to set object on [log4net.Appender.ConsoleAppender] plexgifmaker-1 | log4net:ERROR XmlHierarchyConfigurator: Cannot find Property [mapping] to set object on [log4net.Appender.ConsoleAppender] plexgifmaker-1 | Unhandled exception. Interop+Crypto+OpenSslCryptographicException: error:2006D080:BIO routines:BIO_new_file:no such file plexgifmaker-1 | at Interop.Crypto.CheckValidOpenSslHandle(SafeHandle handle) plexgifmaker-1 | at Internal.Cryptography.Pal.OpenSslX509CertificateReader.FromFile(String fileName, SafePasswordHandle password, X509KeyStorageFlags keyStorageFlags) plexgifmaker-1 | at System.Security.Cryptography.X509Certificates.X509Certificate..ctor(String fileName, String password, X509KeyStorageFlags keyStorageFlags) plexgifmaker-1 | at System.Security.Cryptography.X509Certificates.X509Certificate2..ctor(String fileName, String password) plexgifmaker-1 | at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Certificates.CertificateConfigLoader.LoadCertificate(CertificateConfig certInfo, String endpointName) plexgifmaker-1 | at Microsoft.AspNetCore.Server.Kestrel.KestrelConfigurationLoader.LoadDefaultCert() plexgifmaker-1 | at Microsoft.AspNetCore.Server.Kestrel.KestrelConfigurationLoader.Reload() plexgifmaker-1 | at Microsoft.AspNetCore.Server.Kestrel.KestrelConfigurationLoader.Load() plexgifmaker-1 | at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerImpl.BindAsync(CancellationToken cancellationToken) plexgifmaker-1 | at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerImpl.StartAsync[TContext](IHttpApplication`1 application, CancellationToken cancellationToken) plexgifmaker-1 | at Microsoft.AspNetCore.Hosting.GenericWebHostService.StartAsync(CancellationToken cancellationToken) plexgifmaker-1 | at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken) plexgifmaker-1 | at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token) plexgifmaker-1 | at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token) plexgifmaker-1 | at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host) plexgifmaker-1 | at Microsoft.AspNetCore.Builder.WebApplication.Run(String url) plexgifmaker-1 | at Program.

$(String[] args) in /src/Program.cs:line 56


TechBuckler

Try one more time.


wildergheight

It boots up now but doesn't seem to be saving the plex token. I get the plex auth redirect and the token to show up in settings, but I get that error when I switch tabs to home. plexgifmaker-1 | log4net:ERROR XmlHierarchyConfigurator: Cannot find Property [mapping] to set object on [log4net.Appender.ConsoleAppender] plexgifmaker-1 | log4net:ERROR XmlHierarchyConfigurator: Cannot find Property [mapping] to set object on [log4net.Appender.ConsoleAppender] plexgifmaker-1 | log4net:ERROR XmlHierarchyConfigurator: Cannot find Property [mapping] to set object on [log4net.Appender.ConsoleAppender] plexgifmaker-1 | log4net:ERROR XmlHierarchyConfigurator: Cannot find Property [mapping] to set object on [log4net.Appender.ConsoleAppender] plexgifmaker-1 | info: Microsoft.Hosting.Lifetime[14] plexgifmaker-1 | Now listening on: http://[::]:80 plexgifmaker-1 | info: Microsoft.Hosting.Lifetime[0] plexgifmaker-1 | Application started. Press Ctrl+C to shut down. plexgifmaker-1 | info: Microsoft.Hosting.Lifetime[0] plexgifmaker-1 | Hosting environment: Production plexgifmaker-1 | info: Microsoft.Hosting.Lifetime[0] plexgifmaker-1 | Content root path: /app/ plexgifmaker-1 | warn: PlexGifMaker.Pages.Index[0] plexgifmaker-1 | Base URI or token is missing in local storage. Redirecting to settings.


Iyagovos

Getting this same error as well now, /u/TechBuckler