Hi,
I was experiencing a problem, due to the age of my tv and receiver hardware, wherein PMS was transcoding the audio stream from my mp4 movies from AAC5.1-> AAC. The problem was my receiver and TV are too old to properly handle the 5.1 streams (gonna upgrade eventually). In addition, the audio transcode that took place during movie playback was experiencing frequent pauses to allow the transcode to buffer catch up. It was pretty bad – basically one minute of waiting for another minute of playback.
I eventually traced the problem down to my drive. It was not the mp4 drive at fault: the problem was the SD card from which my raspberry pi was booting and using as the system drive. Apparently Plex writes its audio transcode cache to a cache directory on the primary mount drive by default. Over time, the RPi SD card began to wear and write speed reduced. I moved the transcode cache to an external scratch USB HDD (write speeds 20-30MB/s) and the problem was solved. In fact, the drive, despite being somewhat slow by comparison, is able to write the transcode cache at about three times the real-time playback speed (audio transcode of Get Hard took about 30 minutes for the entire 1h 40m movie). So plenty of buffer time available and no more pausing. I also changed the buffer duration to 7200 second (2 hours) to basically turn the transcode process free so it wouldn’t run the risk of encountering a transcode surge (if such a thing exists) and stall again. In effect, between the increased write speed and transcoding the entire playback at once, no more problems.
I did, however, observe a few interesting items. First, the audio transcode process, when converting AAC5.1->AAC, appears to effectively build an entirely new version of the mp4 file as .ts files. The total size of the .ts files in the transcode cache directory is almost exactly equal to the size of the original mp4 file. So it appears the audio transcode basically copies the video, subtitle, and other audio streams, and transcodes the active audio stream, into an entirely new mp4 file (as .ts files). Can anyone confirm if that is what is happening? If it is, why would PMS do it this way? Seems like a lot of extra work that could be avoided by some kind of transcode magic to transcode just the one offending audio stream and leave everything else. Thoughts?
Finally, here is my main question. As part of building workarounds, I have also modified my MKV->MP4 transcode workflow to include transcoding the primary audio stream (usually 7.1, 6.1, or 5.1) into a stereo stream, and keeping all existing audio streams as well. This provides the opportunity for PMS to push the MP4 via DirectPlay for both video and audio to avoid down transcoding due to my old receiver and TV. However, I noticed a caveat. Even when playing the stereo audio stream, and confirming through the Plex dashboard that DirectPlay was in use for both audio and video, the Plex Transcoder is still running and populating the Transcode Cache directory to the tune of the entire movie size (again as .ts files). I had hoped that providing a solution where PMS didn’t need to transcode anything would avoid the overhead of writing so much to any drive during playback, as my drives are not stellar and therefore I am worried this solution will still not scale to many simultaneous playbacks.
Is this expected behavior that all mp4 files are converted into .ts files for every playback? Am I missing some other setting or basic understanding of how playback works?
Thanks in advanced for any help. Cheers.