-
Notifications
You must be signed in to change notification settings - Fork 24
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
Upcoming added features and changes to the code (an open discussion) #22
Comments
Can you share any info on the codec downloader/updater? I see some folks have figured out the paths and setup here https://old.reddit.com/r/PleX/comments/u66k2p/can_i_download_codecs_and_subtitles_to_devices_in/ and am interested in helping add this functionality to this project. |
LOL, that's me! Yeah, I indeed have it all figured out. The version of the script I currently have (but have kinda put on the backburner) works automatically off of your current config (like my syno.plexupdate script). The one thing that it is lacking (that I keep putting off implementing) is passing it variables from the command line so it can be used without being in an online Synology NAS environment. You need to know the following in order to interrogate the Plex API for codecs:
BUT, and this is a big butt, you have to request each codec individually, and you have to know what you are asking for. You cant just request "everything"... You have to request what is applicable to that version of FFmpeg - and to do that, you have to do a codec list dump from the version of FFmpeg that is running with that version of PMS, like:
My script processes the outputted list along with the (4) system-specific system specs, crafts special URLs, and then calls the Plex API to see what is retrievable. Not everything is, but there is a lot. All you can do is essentially throw the entire list at the Plex API and see what it allows you to download. You also can't go crazy with it or Plex will temp ban your IP (HTTP Error 429), but the script can process the entire list without an issue. If you run it too many times within 30 minutes though, you will get temporarily banned. In its current version, it works fully automated on my online Synology NAS, but it would be a multi-step process to work offline. You would need to know very specific info about that offline PMS in order to download properly versioned codecs for it. You can't mismatch it. Some codecs overlap versions while others do not. If you have the wrong version codec, that media will not be playable. So, this is why it's been on my backburner, because I haven't had a driving need to take it any further. I brought it up on Reddit a few times, but no one was interested, so I lost interest as well. This is the report it currently makes: All Codecs Downloaded
Total Codecs: 284 (281 decoders, 3 encoders) |
Any interest in sharing what you have? For avoiding the rate limiting, I would not be surprised by some added waits and / or retry later, where the script checks to see what's currently downloaded and just pick back up on the next run. Not sure though if each codec that ffmpeg list has a corresponding one from PMS. Sounds like it could/should, but maybe they don't feel the need to host or provide all options. Does the temp ban impact logins from plex.tv as well? If so, then I could easily see making an exponential backoff to not temporarily block users entirely in case they change something on their end. TBH, I haven't ran into a scenario where I need this and it doesn't seem like many other are either. I'm just interested in making this option work for the sake of having a "more complete" package, even if it's first solution is bounded by rate limiting and being an explicit opt in with all the appropriate warnings. |
If there is a genuine interest/need to move forward with this, I'm willing to. The use-case is very slim though, but if you can have the codecs preloaded, it makes any new codec-based media playback not have to delay/wait for the codec to download. The amount of time you potentially save is miniscule if even measurable when you are online. I like the idea of building out a complete toolset for Plex-related tasks/etc, This script needs command-line arguments to make it portable, and a written procedure for how to use it. The use procedure is likely to be convoluted and confusing to most people. Are you proficient with bash?
The rate limiting isn't really an issue based on "normal" use from my last rounds of testing. You'd have to run the script 3+ times consecutively (IIRC) to trigger it. I'd otherwise rather not needlessly introduce wasted time per query if its not necessary. Downloading all of the codecs one-at-a-time is already time consuming (takes 15 minutes in my testing ). If you hit the 429, you have to wait for a 30 minute cooldown. I hit the rate limit during my initial development phases, so I wrote in a detection that stops the download when encountered. It could expanded for its own wait/retry loop, but for now it quits with a messages to wait 30 minutes before trying again. I'm not sure if I ever determined what Plex's rate limit police is, But the rate limit reset took 30 minutes when I last tested it.
There isn't. And I haven't been able to figure out a programmatic way to compare, so the script has to try everything that ffmpeg lists.
I don't know. I never saw any issues/errors on my PMS when testing the script, but my login is cached.
The only real use I can see for the script is for those that need to preload all codecs so they can operate completely offline. I mean, its still not a bad thing to do in case of network outages either (I have encountered this on newish installs as well as can force the issue in testing by deleting the contents of the codecs folder). But the likelihood of not already having the common codecs used by the majority of the media in your library is pretty slim. [ahhh, this has reminded me of what my ideas/concepts where when I last worked on this 🤔] So, this has got me thinking back to where I really left off on this project. I was working on a backup/restore function, so that if you rolled-back to an older version of PMS it would roll-back your codec set as well. Like my other scripts, this is all written to Plex on Synology-centric (full automated w/no manual options), but it can certainly be used with other environments if command-line arguments are incorporated. That's where I really left off. That was a lot of rambling. Is any of this something you are still interested in? 😅 |
I was a bit confused at the current 15 minute runtime. It used to be longer- closer to 30 minutes. It looks like the current codec set has dropped to 213 (210 decoders, 3 encoders). |
I agree the use case is very slim. I found the idea fun and you bring up a good point that the amount of time you potentially save is minuscule. I am proficient in bash and am sort of still interested, I just don't think I'll have as much time as I hope and would probably need a few iterations with you to make the bash script work as you intend. I like the rollback idea and can see how this would help in that scenario. The biggest reason for asking to see what you currently have is to help in small ways as I have time, you know, the open source way. I wouldn't be surprised if others could chip in as well. It doesn't look like you keep a dev branch up though, so not sure if you'd be open to sharing incomplete work. |
My current priorities and open projects:
STATUS: Partially completed as
syno.plexcodecpreloader.sh
. Hooks still need to be made into the update script so that this is automatically performed for each update to the PMS. Codec versioning matches PMS versioning, and they need to be updated together if they cannot be updated on-the-flySTATUS: Work in progress
STATUS: Always ongoing
STATUS: Completed.
.log
and.debug
files will automatically be created in the script directoryAs always, I welcome any thoughts or ideas...
The text was updated successfully, but these errors were encountered: