Plex Server Setup Notes

We have a collection of DVDs and music CDs that we would like to be able to watch and listen to, but storing them takes space.  Rather than keep the discs around where they are cluttering the room, I am working on loading them into a Plex Media Server.  That way, we can watch the DVDs through the Chromecast attached to our TV and the music, either through the Chromecast on the TV or the Chromecast Audio in the kitchen.

Basic Plan

The Plex_Server holds all the media and streams it do devices or Chromecast.  Chromecast is connected to the projector.  Projector is connected to the stereo for audio.

Media Controller can be the Plex client app running on a cell phone.  We might want to get a dedicated tablet to run the client as a controller so that the boys or guests can control the video without having to use one or our phones or to grant Plex access specifically to them.  Configuration and control also happen through a web app running on the server.

For now, the Plex server will be in the room with us, but I plan to eventually move it somewhere else.  As long as both the Chromcast and the Plex Server have good connections,  they need not be in the same room.  That is, the server can be noisy and
have fans with no need to worry about fan noise disrupting movie watching.

How to Configure

The server will be running headless and unattended, so I am not installing a GUI on it.  Here is what I have done so far starting with a base Ubuntu 16.04 server (no GUI):

  1. Install Plex Server on the server.  I used the [Plex PPA](https://launchpad.net/~plexapp/+archive/ubuntu/plexht) to install the `plexmediaserver` package.
  2. Copy some content to the server in an obvious place.  I had the MP-3 files I previously ripped and loaded onto my MP-3 player to start with.  More on converting content later.
  3. Configure the Plex server through the web interface, http://host:32400/manage/index.html, where host is the hostname or IP address of the Plex Server.
    1. Look for the “Library” configuration item and add a library.
    2. Assign the folder with content to the library.  Plex likes to have is particular about how files are named and where they go.  Every movie that does not follow the naming convention seems to get labeled as Madagascar 3 (at least for me).
    3. See that the content appears in the web browser.
  4. Run the Plex client on a phone/tablet.  See that content is present.
  5. Install MakeMKV using the online instructions for MakeMKV.
  6. Install Handbrake using the online instructions for Handbrake. (Basically, use the Handbrake PPA.)

How to Load DVD Content

Plex can play back content, but does not load it from external media.  We have about 100 DVDs when you count all the “complete collections” of X Files, Monty Python, Firefly, etc.

This method seems to work manually, and needs to be automated to make loading all those DVDs easier.  Also, consider running handbrake on a different computer than Plex Media Server to improve performance (not bogging down the server, and a machine with a
GPU and/or more cores might go faster).  Ideally, a batch queuing system could schedule transcoding jobs as processors come available.

I am not sure if transcoding is worthwhile at this point.  At the highest quality preset, I still see a lot of compression artifacts playing back SD DVDs on an HD monitor.  The highest quality H.264 video is about half the size of the original, and takes over 5 hours to transcode.

Here is my basic manual procedure

0. Make sure the directory exists somewhere and Plex Media Server points to it,
assuming you are processing a movie.  For TV shows, do the same, but put them in the TV directory instead of the Movie directory.  I don’t know where exercise videos go. They are probably more like TV than Movies.

  1. Insert DVD into Plex Server
  2. Make a directory for the content called “Movie Title (Year)“, where Movie Title is the title of the movie and Year is the year in which it is released.  If unsure look for the movie on imdb.com.  That is what Plex will look for to find artwork for the movie.
  3. Load the DVD into Movie Title (Year) with makemkvcon mkv disc:0 all "Movie Title (Year)".
  4. Transcode files in Movie Title (Year) withHandBrakeCLI -Z "Super HQ 1080p30 Surround" -O -i title00.mkv -o Movies/"Movie Title (Year)".mp4
    There might be more than one “title”, especially for TV shows. In that case, repeat running Handbrake for each title.

    The above preset is for high quality, but is very slow.

I still have not worked out the best way to store the DVD “extras” (interviews, clips, cut scenes, etc.) The Plex documentation gives a naming convention for all the extra content, but MakeMKV just dumps the content into files called title00.mkv, title01.mkv, etc. That is, no title or description is readily apparent for each .mkv file.

Resources

Plex Documentation on Loading
Content

MakeMKV Documentation

Handbrake Documentation

Next ToDos

  • Watch movies and make sure quality is OK, usability is OK, etc.
  • Buy Plex Pass (assuming Laura likes it)
  • Are exercise videos more like TV Shows or Movies?
  • Automate DVD ripping. One script to run MakeMKV, assign a sensible name,
    and transcode into the movies directory. Use nice.
  • Figure out CD ripping (manual)
  • Automate CD ripping

Maybe Later

  • Batch queuing for transcoding (cross servers)
  • Containerize ripping/transcoding and/or Plex Media Server for better
    CPU limiting (anything like HTB qdisc available?)
  • Insert disk and server automatically determines kind (CD, DVD Movie, DVD
    TV), rips, transcodes, and deposits the result in the right library.
  • Photos
  • SMB share for media (to allow easier uploading of content)
  • OpenID authentication for friends
Advertisements

Slow Cooker Chicken with Spinach and Kale

This recipe is based on Slow Cooker Chicken Saag Curry.  I have modified it to better match the packaging sizes available in local grocery stores.  Mainly, the spinach, kale, and chicken amounts are increased.  I left the spice amounts at the original values, because we were trying to feed this to our son who was around 2 years old at the time.  You might prefer it with more spice.  After my modifications, it is far enough from any Chicken Saag I have ever had at a restaurant that I translated the name to English to avoid unmet expectations.

I am still experimenting to get the right balance of spinach, kale, and yogurt, but posting here, in case the scrap of paper I wrote the recipe on gets lost.

Ingredients

1 Tbsp Ghee or Oil
1 Red Onion, Chopped
3 Cloves Garlic, Crushed and Chopped
1 Tbsp Grated Ginger
1 tsp Chili Powder
2 tsp Coriander
1 tsp Turmeric
Salt to Taste
1 tsp Garam Masala
1 Cup Crushed Tomatoes
1.25 lb (roughly) Chopped Chicken Breasts (about 6)
16 oz Frozen Spinach (1 bag)
8 oz Frozen Kale (1/2 bag)
(optional) 1 Cup Plain Yogurt

Directions

  1. Brown onion, garlic, and ginger in ghee or oil.  Thaw greens in microwave.
  2. Add spices, except garam masala.  Stir fry several for several minutes.
  3. Add tomatoes and bring to a boil.
  4. Add garam masala.
  5. Add greens.  They need not be fully thawed, but should not be completely frozen.  If they have been thawing since you started Step 1, above, they should be fine.  Stir to mix.
  6. Pour spinach mixture into slow cooker, or refrigerate over night.
  7. Add chopped chicken to slow cooker and combine.
  8. Cook on low 6-7 hours.
  9. Add garam masala to taste 30 minutes before end of cooking.
  10. (optional) 30 minutes or less before serving remove from heat and mix in yogurt.  If the yogurt gets too hot or too hot to fast, it will curdle.  Try adding gradually adding a small amount of liquid at a time from the pot to the yogurt to bring it up to temperature, then pour the yogurt into the pot.  If you plan to reheat some later, keep the saved part separate and add yogurt to it after reheating.  (The yogurt will tolerate some time in the microwave, but not too much.)  Experimentation is required to determine precise limits for this step.
  11. Serve with rice, poppadoms, or naan.

Fisher-Price Swing Repair

My son sleeps exclusively in a Fisher-Price Cradle ‘n Swing.  The swing stopped swinging during the night last night, so I took it apart to see if I could fix it before tonight.  The swing is still in pretty good shape, though it is an older model we bought second hand from Once Upon a Child.

When I got the top open, I could smell the odor of burnt electronics.  Fortunately, the bad transistor did me the favor of leaving a scorch mark to let me know what needed replacing.  The scorch marks are a little hard to see in the first picture, but pretty obvious with the transistor clipped off.

Fisher-Price swing control PCB with fried transistor Fisher-Price swing control PCB with fried transistor removed to show scorch marks

The markings on the part indicate that it is most likely an ON Semiconductor MJE171G PNP transistor.  Since we needed the swing tonight, I headed out to the local Radio Shack to see what they have on hand.

There I found a $2 Tip 42 PNP transistor with comparable specs.  The only spec that is not up to the original MJE171G is the maximum emitter-base voltage — 7.0 V for the MJE171G, but only 5.0 V for the Tip 42.  When I probed the drive circuit without a transistor installed, the maximum emitter-base voltage was less than 4.3V for any setting of the motor speed dial, so the Tip 42 will hopefully be fine.  The picture below shows the Tip 42 installed in place of the MJE171G.

Fisher-Price swing control PCB with replacement Tip 42 transistor     Fisher-Price swing control PCB with replacement transistor

The motor still spins when power is applied, but needed a little push to get going.  Rather than to save a second trip to the store for a motor, I also got a replacement motor while I was out.

A helpful Instructables page called Repair your FisherPrice cradle swing describes how to re-purpose the motor from an Air Wick air freshener as a replacement for the Fisher-Price swing motor.  The local Meijer store had one for $5.

It is interesting that the control PCB pictured in the Instructables article has a TO-220 transistor with a big heat sink prominently mounted on a PCB.  It looks like our, apparently older, swing must have had enough transistors blow out that the redesigned with a beefier transistor and better cooling.  Had I read the article all the way through and seen the size of the heat sink on the newer model, I would have bought a heat sink, too.

After replacing the transistor and motor, the swing is back in working order.  I am sure I could have bought the parts online from Digikey or Mouser for much less, but shipping would have eaten up the difference.  Even more importantly, the total price was low enough that getting all the parts fast enough to repair the swing before bedtime was more worthwhile than saving a few dollars.