HDHomeRun Extend, Transcoding, Post Process Script (Help Wanted)

I know this has been discussed, but I’m trying to figure out what’s all happening and what’s a good solution. My server runs on a Mac. I have the HDHomeRun Extend. We never watch Live TV. My main player is Apple TV (4th gen) Previously, Plex was set to “high quality” and HDHR to “Heavy” and a 1hr program with commercials is about 1.75GB. I recently changed it to Plex (original) and HDHR (heavy), and will do some recordings tonight.

What’s making me investigate this is the Plex app on the Apple TV has issues on a Direct Stream of 1 show or channel. But if I transcode using Handbrake (Apple Surround 30), I get a much smaller file and it direct plays perfectly. Or the direct play of .TS in Infuse works well too. I believe Handbrake will spit out about the same file size regardless of the Plex/HDHR settings.

Is the .TS container Plex records to an MPEG2 with H264?

I’m thinking a post process script using HandbrakeCLI would do the trick to give me a more comparable and smaller file. But unfortunately, I only have novice command line skills and zero scripting skills. And what transcoding settings I should feed into that (like, is it bad if HDHR transcodes, then Handbrake does it’s thing). Or if it even matters.

Any help is appreciated. My apologies if I got some terminology wrong.

Yeah, there is something odd happening around transcoding in PLEX DVR. I have an HDHomeRun Quattro and tried doing the software-based during-recording transcode. But after all the CPU burned, the resulting file was still a .TS (MPEG2 transport stream) and not a transcoded file. Exactly the same size of recording as I get from same-time recording from DVBLink.

I was wondering if switching to HDHomeRun Extend, which has /hardware/ based transcode to H.264, would allow for H.264 recording by PLEX without the CPU overhead on the PMS host. But your post makes me wonder if this works. :frowning: The Extend has only two tuners, as compared with Quattro’s four. But if PLEX can’t take advantage of the hardware transcode then it’s not worth it.

Plex only outputs recordings using the ts container which can contain mpeg1, mpeg2, mpeg4, as well as other video codecs. In addition to numerous audio codecs. Remember a recording will contain both audio and video and possibly some subtitles or closed captioning streams which must all be packaged in some container format. The experimental transcode feature is intended to transcode the video codec being recorded to h264 when the recording ends. The video/audio and other streams will still be packaged in the ts container. You can use handbrake to remux the ts container to whatever format you prefer as part of a post processing script.

Upon further tests, I do think the HDHR Extend is doing the transcoding, not Plex, no matter the setting. I left Plex at Original and changed the HDHR settings to transcode and the HDHR delivered an original size recording (appx 7GB/1hr). So I believe whatever you set Plex to tell the HDHR to deliver it will. I don’t know what other options Plex offers the other antennas.

I found this article about the EXTEND helpful.

But now to figure out why [FoxProgram].ts DVR recordings stink, transcoded [FoxProgram].m4v is fine, and [ABCProgram].ts is fine. Maybe it has to do with interlaced vs progressive channels?

And since it’s already coming in compressed but if the container is the issue, would remuxing be preferred over transcoding? And where can I find a script to use Handbrake to post process?

Yes, Plex sends whatever transcode setting is set for the Extend in the Plex DVR settings each time it starts a recording or Live TV session using the Extend.
Extend set to Original Quality:

Apr 28, 2018 10:51:36.723 [10276] DEBUG - DVR:Grabber: Going to record for 504 seconds, final URL is http://10.0.1.20:5004/auto/v10.1?transcode=none

Extend set to Highest Quality:

Apr 28, 2018 10:51:21.433 [10276] DEBUG - DVR:Grabber: Going to record for 519 seconds, final URL is http://10.0.1.20:5004/auto/v19.1?transcode=heavy

So irregardless of what setting you have configured on the actual HDHR Extend Plex will override that setting for any recordings or Live TV Sessions.

To determine why one channel of recordings are poor you would probably have to look at the video stream information to see what the differences are. How did you convert the [FoxProgram].ts to [FoxProgram].m4v?

If you are getting a transcoded stream from the HDHR Extend, which it sounds like you are, all you should really need to do is remux the container to mp4 or m4v for your Apple TV to handle it better perhaps. If you were running Windows I would advise you to look at mcebuddy. I use a profile with mcebuddy called MP4 Unprocessed which literally just remuxes the container from ts to mp4, the remux takes approximately 10-15 seconds as part of my post processing.

If you have handbrake and can setup a preset configured with the exact settings you want all recordings and then saved as a Preset with a unique name such as “PlexRecordings” then to use the handbrake command in post processing can be as simple as:

HandBrakeCLI -i "Input File Here" -o "Output File Here" --preset "PlexRecording"

Replacing of course the “Input File Here” and “Output File Here” with the names of the incoming filename and what you want the output file to be named as.

You might want to check around the forums searching for any threads regarding Mac Post Processing to see if there are any other Mac users that have posted some of the scripts they have worked on.

@johnm_ColaSC said:

To determine why one channel of recordings are poor you would probably have to look at the video stream information to see what the differences are. How did you convert the [FoxProgram].ts to [FoxProgram].m4v?

Used Handbrake GUI with Apple 1080p30 Surround preset. Only thing I saved was swapping the audio outputs, so AC3 is 1st, above the AAC track, to make sure it’s picked by the players first.

The issue with [FoxProgram].ts is the video studders/pauses every so often. The audio and picture quality is the same. It’s happened on other Fox programs as well, but not ABC shows. When playing in native Plex app on tvOS or iOS, it shows as Converting/Direct Stream. When playing [FoxProgram].ts on Infuse, it Direct Plays and is fine. After converting [FoxProgram].m4v, it direct plays and is fine on all clients.

For the longest time I thought the video studdering was due to poor signal quality. I’m using an indoor powered antenna in a window, but we’re kind of at the bottom of a hill so signal has never been good until I ran cable across the room to place the antenna by the window. Again, now I’m thinking maybe Fox is an interlaced channel and ABC is progressive.

Man, not only do I need separate comskip.ini files per program (and even that doesn’t always work), we need different transcoder settings per channel as well.

If you have handbrake and can setup a preset configured with the exact settings you want all recordings and then saved as a Preset with a unique name such as “PlexRecordings” then to use the handbrake command in post processing can be as simple as:

HandBrakeCLI -i "Input File Here" -o "Output File Here" --preset "PlexRecording"

I did figure out how to use HandBrakeCLI, but I suppose that doesn’t remux. None of these files are important, so I’m not really worried about quality. Though I don’t remember what I recorded things on, I’m going back to older recordings and transcoding using that decently high Preset and still finding space savings.

I suppose if I want to truly remux, I think using FFMPEG does the trick.

You might want to check around the forums searching for any threads regarding Mac Post Processing to see if there are any other Mac users that have posted some of the scripts they have worked on.

Still searching. Maybe I’ll dig into Plexcomskip.py , which I used in the past, to figure it out.

The difference in the behavior you’re seeing is fully explained in the post that was linked by someone else in this thread: https://ultramookie.com/2016/2016-12-20-making-hdhr-work-my-way.html

A source stream that’s interlaced needs additional reduction in quality so that the output stream isn’t interlaced, or PLEX will need transcode for many devices.

After doing some more digging, I believe my first source for finding how the local stations transmit prime time video was incorrect. In fact, they’re opposite. According to wikipedia, local ABC is 1080i and local FOX is 720p. My latest FOX recording was set to high and was very watchable, aside from a few blips. I bet if I run it through Handbrake it’ll be fine. If anyone has any other theories as to why my Plex clients have issues with FOX recordings, I’m all ears.