Cayars - Setup walk through and some tips and tricks

Just a random thought but could this also be an answer to the multiple streams per user issues people have asked for support on?

Send the user id as a part of the transcode request in some manner.  The "new" transcoder takes that and either transcodes the intended file, or if it's a multi-stream, instead of the original file it sends out a pre-transcoded error message notifying the user he/she has exceeded the allotted streams for that user ID.  And maybe some info on who to email for a request to get a new user ID.  (Or more streams/day, etc.)

Of course, this is also going to require some log file diving, I'm sure.  I wonder if it's doable?

And I know, Carlo, we are spending your time before you even have the time to start working on it, but this is EXCITING!  And we know the developer is going to look at some of the options as he's going along...  Because he's wanting a lot of the same things!  :)

Throwing out some lateral thinking. 

Would there be any benifit to having cayars transcoders run in a docker container? That way you could use a lot of resources that already exist for docker with automatically spinning up containers and stopping them whenever needed.

I don't think so. For starters you're not going to eek out any extra performance from running in a docker and the whole idea of waking up something would be to wake up a far more power-hungry computer that doesn't necessarily need to be running at all times. 

Docker would just get in the way. It’s for “lazy” programmers or those who don’t know how to do it. :slight_smile:

Reverse proxies aren’t going to work well with Plex and won’t really buy you much if you do get it working. Here’s one thread on it:
https://forums.plex.tv/topic/38746-pms-behind-apache-proxy/

I can't access your ftp server to get your mp4 conversion script. Is it down and/or can you host it somewhere else?

Sorry about that. Was playing with something to watch for multiple connections and dynamically add them to the firewall for X amount of time and forgot to open up ports for FTP.

Try it again now and you should be ok.

Carlo

Got it. Running a film through now!

To get a better idea for it, try running different media through it such as an MKV already in 264 format (remux), an MP4 that’s using mpeg4 instead of 264 (transcode), etc.

You’ll see it’s smart enough to know when to remux vs transcode for best quality.

Let me know if you have any questions or ideas for new features.

Carlo

Here is a set of scripts that you can use to automate mp4 creation of files.

I'd recommend running your files through FileBot first to rename them correctly before running them through this script.  It can pull SRT files so everything ends up with proper names this way.

Carlos,

I am not very media file savvy and so before I run my many files through the script, I have a couple of questions I hope you can answer:

Most of my files are pulled using Handbrake with the settings set to the High Profile setting (I am attaching screen shots in case I changed something on accident).  With these settings, what should I see from running the script?  Will the files be smaller?  Quality better? More optimized for Plex? etc.?  I do have some files that I pulled from my TiVo that are all MPG files and so those I am thinking of running it through or I will just run them through Handbrake.

Any advice you (or anyone else) can give would be appreciated.

You will like the settings I have better than what you are currently using via Handbrake mainly because of your 2nd screen shot.
Here you DO NOT have the Web Optimize checked. If using HB you MOST CERTAINLY want this checked.

My script compared to the first screen shot uses the same CQ (constant quality of 20). However, I’ve made a couple changes for compatibiltiy. Instead of using H264 level of 4.1 I went with 4.0 as it’s compatible with more devices. I use the same equiv of High profile but we diff on the Preset. Your using Medium and I’m using Slow.

Slow takes a bit more time (not a lot) than Medium but it does a better job with compression and gives you a better picture byte for byte used. I also tried Very Slow but the trade off in time compared to Slow isn’t worth it for most people. The difference from Medium to Slow is worth it.

What you will also see as a difference is in the Audio Tab. By default HB won’t do anything special here. The script I provided will check compatiblity of the first audio track and if it’s not AAC 2 channel at 256K or less it will create one for you from a higher “resolution” track in the media file you are converting.

It also does the other things I originally mentioned like removing subtitles from the media and creating SRT subtitle files from them (keep or remove them as your preference) and removes languages you aren’t interested in from the media (config in ini file).

But the script will create a file more “compatible” for Plex use then your present settings. Also keep in mind if you original file already have video in h.264 the file can be remuxed instead of transcoded which is quicker and loss-less.

If you have any specific questions let me know,
Carlo

Carlo,

Tried to send you a PM, says it can't be sent...  (Box is full maybe?)

Messed with your conversion scripts some, to try getting an automation process going for conversions on my NAS.  It WORKED!  After I got a working ffmpeg installation and editing a bit of your code to reflect the paths.

I would like your permission to post my edits in the Asustor forums and the steps to make all of this work for these NASes.

Sorry Mike, traveling for business.

I cleared a few PMs out. Try again with the PM.

If possible let me know what you changed. Maybe we can clean things up a bit more then they already are and then you can post it. (use your own judgement).

Carlo

Guys, just wanted to give you a heads up on my time lately.

Had a big issue come up at work and they threw some cash my way to “fix it” as a team of people working for a couple of months didn’t get it done. I started from scratch and got it done. It’s going live tomorrow so once I’m past this I’ll be putting some time into a few Plex things.

Probably the order:
1) Refinement to the scripts used for “Virtual Library/Recommended” scripts in message #131
2) Couple slight changes to the MP4 autoconversion scripts #145
3) Release of a couple small scripts used for info puposes
4) Get to working on the Distributed Transcoding project I had just announced when I got the “work project” thrown at me that derailed things.

1-3 won’t take more than a day so I want to get them out to make time for number 4 which I’m anxious to get working on!

Carlo

Number 4.

cP6DsV4.gif

Tried your conversion script! Very nice. Been looking for this a while. I have one question/request though. Is it possible to return the file to the original folder when the conversion are done, or a subfolder to the original. Been thinking to schedule a job to process the whole library. Thats why I would prefer the file to remain so my folder structure are intact. But thanks for the nice script!!!

Try setting the output directory empty in the ini file and see if this does the trick.

Try it on a COPY of a folder or two and not your live data just in case it deletes the original without doing the replacement. :slight_smile:
But I think this should work.

Carlo

Try setting the output directory empty in the ini file and see if this does the trick.Try it on a COPY of a folder or two and not your live data just in case it deletes the original without doing the replacement. :)But I think this should work.Carlo


Wewen, I hope you report back on the success/failure of this. I had the exact same question. I would like to run this script on my whole collection, but I don't have the space to keep two copies.

Cayars, what is the extension of the output file? Just curious.

Success! Worked very nice indeed.  Have one more question in autoProcess.ini is says that you can auto download subtitles. Enabled this flag but its complaining about not having subliminal installed. Is it something we might have in the next version of the script? Cheers!

Success! Worked very nice indeed.  Have one more question in autoProcess.ini is says that you can auto download subtitles. Enabled this flag but its complaining about not having subliminal installed. Is it something we might have in the next version of the script? Cheers!


It was in there but I removed it. Plex itself can pull down the subtitle files on demand as needed.

While there is no issue running this multiple times on the same files I’d suggest if you want to run this against your whole collection you do it in sections feeding in the proper high level directory. The only reason I mention this is because it would suck to get say 75% done and have an issue that causes you to reboot and start over!

Carlo