Option to have DVR record as mp4 or avi and not as ts (HDHomeRun tuner)

It looks like when the Plex DVR record a tv show being streamed from HDHomeRun (Extend Canadian version) the recordings are in .ts format. Though this seems to be a very lightweight of recording ( I see this when I “top” or “vmstat”) the issue is I now have to use cpu resource everytime during playback. Is there an option to have Plex do transcoding when recording so that transcoding can be avoided during playback? I looked around but I don’t see one.

1 Like

YES, if you have a server with a CPU that can transcode you can turn on transcoding in Plex and get h.264 versions of the video which are both direct playable and take up lots less disc space.

Carlo

Yes. Using the web UI, go to Settings/Server/Live TV & DVR, and hit the little gear icon next to your tuner. Under Convert Video while Recording, select “Transcode” from the drop-down. I’m not entirely clear on why Plex doesn’t natively encode to h.264 - but that’ll do the trick, assuming your CPU has enough headroom.

I have Plex Version 1.9.4.4325. I followed your instructions but its now shown exactly as “Convert Video while Recording”. All it says is Transcoder Quality, with smaller text underneath “The quality of the transcoding used when recording. Selecting original format may result in very large files.” I have it set to “Highest Quality”, and not “Original Format”. So if my CPU doesn’t have the guts to get it done, will it not transcode at all, or will it transcode and the video be just yucky. I do know when a recording is in progress, “top” will show a transcoding process, but its cpu consumption is around 2% which makes me think its not actually transcoding at all.

@cayars said:
YES, if you have a server with a CPU that can transcode you can turn on transcoding in Plex and get h.264 versions of the video which are both direct playable and take up lots less disc space.

Carlo

It does transcode to h264, but it’s still stored in a mpeg2TS container. Which is kind of annoying. But there must be a reason.

@CrazyDiamond698 said:
It looks like when the Plex DVR record a tv show being streamed from HDHomeRun (Extend Canadian version) the recordings are in .ts format. Though this seems to be a very lightweight of recording ( I see this when I “top” or “vmstat”) the issue is I now have to use cpu resource everytime during playback. Is there an option to have Plex do transcoding when recording so that transcoding can be avoided during playback? I looked around but I don’t see one.

Check the Device Settings (the little gear icon) for the HDHR Extend in the DVR portion of the Settings for the Plex Media Server. I bought the Extend over the Connect because it’s capable of transcoding to h.264 before sending the stream to the Plex Media Server. Reduced the load on the PMS and saved disk space. As I remember, Original will send mpeg2. All other settings will transcode in the Extend before sending to the PMS.

Here’s a screenshot of the Plex Media Server 1.6.1 Device Settings I have:

@KarlDag yes the recording is still in a ts container. You can use a Post Processing script to remux the container from ts to mp4 or mkv if that is a better container for your clients. The remux should only take a few seconds since it is not actually changing the internal video (h264) format.

I was going to suggest the same as John just did. In a nutshell the post processing script will run nearly as fast as you can read/write the complete stream. It’s pretty fast.

This will also allow Plex to note the file name change and it will handle it correctly.

@cayars said:
I was going to suggest the same as John just did. In a nutshell the post processing script will run nearly as fast as you can read/write the complete stream. It’s pretty fast.

This will also allow Plex to note the file name change and it will handle it correctly.

Yeah but most people, me first, don’t have the first clue as to how to write such a script. It would be much easier if Plex included the option. If there’s a big reason why files should absolutely be in a ts container, then I’d love to know why.

If people were to write such a script and share it, I’d use it :wink:

@KarlDag Search the forums for scripts for the Operating System you are using. I know I have seen Windows, Mac OS, and Linux threads discussing post processing scripts.

I have not used it but I have seen many references to this: http://www.mcebuddy2x.com/ - it seems to be pretty easy to use and I have also seen tutorials on setting it up with Plex.

As to why ts? I know that there is more than just video in there - for example a teletext stream. Perhaps this is why they use the ts container. AFAIK mp4 containers only hold the video.

@ChrisAWallace “As I remember, Original will send mpeg2. All other settings will transcode in the Extend before sending to the PMS.”

That is great information; where did you get it? I, along with many others, have been confused about how to make sure the HDHR Extend is doing the transcoding, rather than the PMS.

@geoland1st Silicon Dust explains some of the settings on their end in their HDHomeRun HTTP Development Guide at the bottom of page 2 under Transcode Profiles: http://www.silicondust.com/hdhomerun/hdhomerun_http_development.pdf. Basically any setting other than Original transcodes the incoming stream to h264 before sending it to Plex.

There is also a blog post by another Plex user that explains how they have setup their Extend: https://ultramookie.com/2016/2016-12-20-making-hdhr-work-my-way.html.

I have an HDHR connect and I have set the tuner option to TRANSCODE. 1 hour videos are still consuming 5GB of disk space.

I have an I7 processor, so performance shouldn’t be an issue.

1 Like

@geoland1st said:
That is great information; where did you get it? I, along with many others, have been confused about how to make sure the HDHR Extend is doing the transcoding, rather than the PMS.

Been lurking in the forums for quite awhile. Johnm_ColaSC’s links are great resources though.

@johnm_ColaSC said:
@KarlDag yes the recording is still in a ts container. You can use a Post Processing script to remux the container from ts to mp4 or mkv if that is a better container for your clients. The remux should only take a few seconds since it is not actually changing the internal video (h264) format.

Thanks for answering that. I was trying to use ffmpeg to remux it, but it surely does not take a few seconds, nor does it hit the cpu lightly. But I’m hoping I was using the wrong flag options. I got a bunch of ‘unable to decode audio’ messages so I was assuming I was doing it wrong. Need more time to figure it out, or someone to show me what command string they use with ffmpeg. As for Post Processing scripts I’ll leave that up to the coding geeks at Plex to sort through. Either build in the option, or I’ll use ffmpeg as soon as I can figure it out.

Or maybe my CPU is simply too old. :o I’ve already starting looking into buying/building a new server.

dmesg | grep Core
CPU: Intel(R) Core™2 CPU 6400 @ 2.13GHz (2128.05-MHz K8-class CPU)

I use mcebuddy since I am running on Windows. Looking through one of the mcebuddy log files for a recent conversion it appears that the arguments used for ffmpeg were:
-hide_banner -probesize 100M -analyzeduration 300M -threads 0 -y -i “G:\mceBuddy\working0\Rizzoli & Isles (2010) - S05E02 - … Goodbye.ts” -ss 3 -vcodec copy -sn -acodec copy “G:\mceBuddy\working0\Rizzoli & Isles (2010) - S05E02 - … Goodbye-converted.mp4”

Hopefully that will give you a good start on figuring out what to use for your ffmpeg command. My log shows the remux starting at 3:12:09 this morning and was done from what I can tell at 3:12:20. So roughly 11 seconds to remux the file.

@KarlDag said:
Yeah but most people, me first, don’t have the first clue as to how to write such a script. It would be much easier if Plex included the option. If there’s a big reason why files should absolutely be in a ts container, then I’d love to know why.

If people were to write such a script and share it, I’d use it :wink:

TS is ideal for Live TV or situations when you don’t have the complete file available. MP4 has MOOV atoms and as such make for a bad format for Live TV. You certainly can’t “web optimize” it until you have a finished recording.

Keep in mind a person with a Prime using Cable could receive MPEG2 streams or H.264 depending on channel. Comcast for example uses MPEG2 for the main broadcast channels and will usually broadcast them in 1080i while the secondary channels are compressed to 720p/H.264.

So ideally, you want a bit of an advanced script that can de-interlace when needed, convert from Mpeg2 to H.264 when needed, throw out audio channels you don’t need, create SRT subtitles from closed captions if wanted, create AAC audio if broadcast is 5.1, etc… Then package all this in the MP4 with the moov atom at the start of the data (web optimized).

You could try to use Plex’s built in experimental transcoding during recording but I wouldn’t want it to transcode every channel since many of mine will already be H.264 so that would just degrade quality plus take a lot longer than needed. This option would be great for OTA since that’s usually just mpeg2 streams.

So as you can see it’s not always just a simple remux unless you don’t care about the internals and just want an MKV or MP4 file container but that won’t really help much.

This is why I run everything through the scripts I have in my thread linked in my sig.

@johnm_ColaSC said:
I use mcebuddy since I am running on Windows. Looking through one of the mcebuddy log files for a recent conversion it appears that the arguments used for ffmpeg were:
-hide_banner -probesize 100M -analyzeduration 300M -threads 0 -y -i “G:\mceBuddy\working0\Rizzoli & Isles (2010) - S05E02 - … Goodbye.ts” -ss 3 -vcodec copy -sn -acodec copy “G:\mceBuddy\working0\Rizzoli & Isles (2010) - S05E02 - … Goodbye-converted.mp4”

Hopefully that will give you a good start on figuring out what to use for your ffmpeg command. My log shows the remux starting at 3:12:09 this morning and was done from what I can tell at 3:12:20. So roughly 11 seconds to remux the file.

… do you have a hint where i could get the mcebuddy to try it on my pkex server? I try to convert the huge .ts files down to a lower size (like .mp4 or .mkv) and ideally remove ads… but ads is not the most important part for me… format of the file is more important… but i don’t know at all jow to script and keep searching the forums here for a easy way to convert files once they are recorded to another format and placed in the right directory automatically … any infos?