# Support H.264 constrained baseline for hw-decoding when transcoding

**URL:** https://forums.plex.tv/t/support-h-264-constrained-baseline-for-hw-decoding-when-transcoding/740459
**Category:** Plex Media Server
**Tags:** server-linux
**Created:** [September 1, 2021, 3:57pm UTC](https://forums.plex.tv/t/support-h-264-constrained-baseline-for-hw-decoding-when-transcoding/740459 "2021-09-01T15:57:31Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Mitzsch](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/mitzsch/32/308163_2.png) [@Mitzsch](https://forums.plex.tv/u/Mitzsch)
#### Post date: [September 1, 2021, 3:57pm UTC](https://forums.plex.tv/t/support-h-264-constrained-baseline-for-hw-decoding-when-transcoding/740459/1 "2021-09-01T15:57:31Z")

</div>

Server Version#: 1.24.1.4931

Hi,

I just found out, when transcoding a video that was encoded in an uncommon h.264 profile (like “constrained baseline” in my case), hardware decoding is not used even though the hardware is more than capable of decoding such video. Plex is not even trying to use the gpu. (if the gpu is not able to decode it would fallback to the cpu - but -hwaccel is mssing so its not even trying…)  
I have tried it on an intel igpu system as well on a nvidia gpu (tesla t4) with the same result - no gpu decode. However, encoding was done on the gpu.

 ![Bildschirmfoto vom 2021-09-01 10-35-00](https://global.discourse-cdn.com/plex/original/3X/f/1/f1ac72f66b2e26e466d546d4e7eaccc002cbed18.png)

**Mod-Edit:** removed file-sharing link

---

<div class="post-metadata">

### Author: ![tom80H](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/tom80h/32/19753_2.png) [@tom80H](https://forums.plex.tv/u/tom80H)
#### Post date: [September 1, 2021, 8:08pm UTC](https://forums.plex.tv/t/support-h-264-constrained-baseline-for-hw-decoding-when-transcoding/740459/2 "2021-09-01T20:08:21Z")

</div>

You might want to check out the “Compatible formats and limitations” section in the related support article. In the end only the [server logs](https://support.plex.tv/articles/200250417-plex-media-server-log-files/) will show why Plex won’t use hw-decoding for that video.

> **[Using Hardware-Accelerated Streaming | Plex Support](https://support.plex.tv/articles/115002178853-using-hardware-accelerated-streaming/#toc-3)**
>
> Tip!: Hardware-accelerated streaming is a premium feature and requires an active Plex Pass subscription. To play your video smoothly and...

---

<div class="post-metadata">

### Author: ![Mitzsch](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/mitzsch/32/308163_2.png) [@Mitzsch](https://forums.plex.tv/u/Mitzsch)
#### Post date: [September 2, 2021, 11:55am UTC](https://forums.plex.tv/t/support-h-264-constrained-baseline-for-hw-decoding-when-transcoding/740459/3 "2021-09-02T11:55:28Z")

</div>

Thanks for your answer, but the article just mentions “h.264” and no profile.

> Video files with H.264, HEVC, MPEG-2, and VC-1 encoded video can take advantage of hardware-accelerated decoding.

I just looked through the logs and i found that the transcoder is checking for a profile  
#example of a normal encoded file = h.264 high profile

```auto
Sep 02, 2021 13:19:56.045 [0x7f4dbbd48b38] DEBUG - [Transcode] Codecs: Testing with profile 'High'

```

followed by

```auto
Sep 02, 2021 13:19:56.077 [0x7f4dbbd48b38] DEBUG - [Transcode] TPU: hardware transcoding: using hardware decode accelerator nvdec
Sep 02, 2021 13:19:56.077 [0x7f4dbbd48b38] DEBUG - [Transcode] TPU: hardware transcoding: zero-copy support present
Sep 02, 2021 13:19:56.077 [0x7f4dbbd48b38] DEBUG - [Transcode] TPU: hardware transcoding: using zero-copy transcoding
Sep 02, 2021 13:19:56.077 [0x7f4dbbd48b38] DEBUG - [Transcode] TPU: hardware transcoding: final decoder: nvdec, final encoder: nvenc

```

=\> working hw decoding

with the other file =\> h.264 constrained baseline, there is **no**

```auto
DEBUG - [Transcode] Codecs: Testing with profile ´xxx´

```

line. As a result these lines are printed

```auto
Sep 02, 2021 13:16:53.796 [0x7f4dbcc0eb38] DEBUG - [Transcode] TPU: hardware transcoding: enabled, but no hardware decode accelerator found
Sep 02, 2021 13:16:53.796 [0x7f4dbcc0eb38] DEBUG - [Transcode] TPU: hardware transcoding: final decoder: , final encoder: nvenc

```

=\> cpu decode.  
So it´s not implemented that there could be a “constrained baseline” profile that could be decoded in hardware.

The hardware is more than capable…  
vdpauinfo

```auto
Decoder capabilities:

name level macbs width height
----------------------------------------------------
****************many other codecs*****************
H264_CONSTRAINED_BASELINE 51 65536 4096 4096

```

---

<div class="post-metadata">

### Author: ![Mitzsch](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/mitzsch/32/308163_2.png) [@Mitzsch](https://forums.plex.tv/u/Mitzsch)
#### Post date: [September 6, 2021, 4:59pm UTC](https://forums.plex.tv/t/support-h-264-constrained-baseline-for-hw-decoding-when-transcoding/740459/4 "2021-09-06T16:59:34Z")

</div>

Well, after some tinkering with those files and plex I found a method that forces nvdec decoding.

## How to (ubuntu linux):

```auto
1. service plexmediaserver stop
2. cd /usr/lib/plexmediaserver/
3. mv 'Plex Transcoder' 'Plex Transcoder2'
4. touch 'Plex Transcoder'
5. echo #!/bin/bash > 'Plex Transcoder'
6. echo /usr/lib/plexmediaserver/Plex\ Transcoder2 -hwaccel nvdec "$@" >> 'Plex Transcoder'
7. chmod +x 'Plex Transcoder'
8. service plexmediaserver start

```

It works until you update to a new version, then the ‘Plex Transcoder’ gets overridden.

---

<div class="post-metadata">

### Author: ![Mitzsch](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/mitzsch/32/308163_2.png) [@Mitzsch](https://forums.plex.tv/u/Mitzsch)
#### Post date: [November 16, 2021, 8:15am UTC](https://forums.plex.tv/t/support-h-264-constrained-baseline-for-hw-decoding-when-transcoding/740459/5 "2021-11-16T08:15:38Z")

</div>

Consider this one as solved, as the latest beta (1.25.0.5220) has support for hardware transcoding of H.264 Constrained Baseline media. Thanks!

> [@Plex Media Server](https://forums.plex.tv/t/plex-media-server/30447/469):
>
> Plex Media Server 1.25.0.5220 is now available to Plex Pass users in the Beta update channel. NEW: (Metadata) Add Croatian as language option for modern Movie and TV agents (#13119) (Subtitles) New font package and default styles for server-side subtitle rendering (Transcoder) Architectural changes to provide future support for hardware transcoding on additional NAS devices (Transcoder) Architectural changes to provide improved support for remuxing some HDR formats (Transcoder) Support for ha…

> - (Transcoder) Support for hardware transcoding of H.264 Constrained Baseline media

---

<div class="post-metadata">

### Author: ![Robbie\_UK](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/robbie_uk/32/215208_2.png) [@Robbie\_UK](https://forums.plex.tv/u/Robbie_UK)
#### Post date: [November 20, 2021, 11:56am UTC](https://forums.plex.tv/t/support-h-264-constrained-baseline-for-hw-decoding-when-transcoding/740459/6 "2021-11-20T11:56:14Z")

</div>

Have you literally done ‘constrained baseline’ only rather than other h264 types that miss the hw transcoding.

Ever hopeful that TS h264 will be added.

---

<div class="post-metadata">

### Author: ![Mitzsch](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/mitzsch/32/308163_2.png) [@Mitzsch](https://forums.plex.tv/u/Mitzsch)
#### Post date: [November 26, 2021, 7:26pm UTC](https://forums.plex.tv/t/support-h-264-constrained-baseline-for-hw-decoding-when-transcoding/740459/7 "2021-11-26T19:26:20Z")

</div>

I have only tested the h.264 constrained baseline profile, nothing else. All other h264 samples I have were supported.

What did you mean with TS h264? I’m not aware of any h.264 encoding profile called TS. If you mean TS as a container, it should work with plex, although I would recommend to remux those files into the mkv container.

---

<div class="post-metadata">

### Author: ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)
#### Post date: [February 24, 2022, 7:26pm UTC](https://forums.plex.tv/t/support-h-264-constrained-baseline-for-hw-decoding-when-transcoding/740459/8 "2022-02-24T19:26:21Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
