Shield tv don't hw transcode

Bug started when do_new_extradata_copy was removed.

@tmm1 Thanks for that info. It was helpful. The devs are looking into this.

1 Like

This should restore functionality:

--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -1153,12 +1153,27 @@ const AVPacket *ff_interleaved_peek(AVFormatContext *s, int stream)
     return NULL;
 }

+static int do_new_extradata_copy(AVCodecParameters *par, AVPacket *pkt) {
+    int side_size;
+    uint8_t *side = av_packet_get_side_data(pkt, AV_PKT_DATA_NEW_EXTRADATA, &side_size);
+    if (side) {
+        uint8_t *new_extra = av_mallocz(side_size + AV_INPUT_BUFFER_PADDING_SIZE);
+        if (!new_extra)
+            return AVERROR(ENOMEM);
+        memcpy(new_extra, side, side_size);
+        av_free(par->extradata);
+        par->extradata = new_extra;
+        par->extradata_size = side_size;
+    }
+    return 1;
+}
+
 static int check_bitstream(AVFormatContext *s, FFStream *sti, AVPacket *pkt)
 {
     int ret;

     if (!(s->flags & AVFMT_FLAG_AUTO_BSF))
-        return 1;
+        return do_new_extradata_copy(st->codecpar, pkt);

     if (s->oformat->check_bitstream) {
         if (!sti->bitstream_checked) {
@@ -1169,6 +1184,9 @@ static int check_bitstream(AVFormatContext *s, FFStream *sti, AVPacket *pkt)
         }
     }

+    if (!st->internal->bsfc)
+        return do_new_extradata_copy(st->codecpar, pkt);
+
     return 1;
 }

Not sure if related, but I created a post on the forum where transcoding to any of my android devices (including the shield itself hosting PMS) is not working. Well it seems to be working (the buffer is filling up and the files are created on the shield) but the video is never playing. It plays just fine with the same transcoding settings on the same devices if I use the web player.

you know what i have noticed lately since april

if " Use hardware-accelerated video encoding" is enabled i regualrly get the black screen no video plays
if i play original version option the video plays
if i mark " Use hardware-accelerated video encoding" disabled the video plays

A real good hint though is tried to use Optimize option to pre encode the videos.
Shockingly if " Use hardware-accelerated video encoding" is ON
the mp4 file generated has a video stream but is totally broken cannot play in vlc or even be imported to Handbrake.

" Use hardware-accelerated video encoding" OFF the optimized file works in VLC plex and handbrake

the " Use hardware-accelerated video encoding" option in Nvidia Shield is real F’D up

1 Like

definitely fits my experience with latest update HW transcoding bug Nvidia Shield Pro

doesn’t seem to matter of the file is 720p 1080p 2060p 264 265 mkv or mp4 the HW transcoder spits out jumble that the plex client cannot play and optimized files that nothing can play

Plex client will spin forever on a nvidia shield mediaserver source,
the windows mediaserver seems to play correctly.
Original stream no transcode will play in all cases.

for me it actually started when i used the move plex database file to USB harddrive option after internal crashed as full.

I cannot say definitively if upgrade/update caused it or there is a bug in transcoder if and only if the datastore is not on android internal storage

I can give logs if there is still a need for some?

1 Like

Hi! Do you have any news regarding this issue? Is an update planned to fix it?

Can you elaborate on how to make this code work?

I’m seeing the same as well. Hope it gets fixed soon.

1 Like

Been a while since I checked this thread.

I’ve got a Shield Pro and USB SSD for the DB/metadata. Seems hit or miss if it will transcode h.265. Some files it just spins and does nothing. Others it transcodes without issue. If no transcoding is needed (local play), it always works.

I made the Shield my PMS because the idle electricity consumption is so low, and even at full tilt it’s lower than a PC. That said, if PC doesn’t have as many transcode issues, I might move back in that direction. Love the Shield when it works correctly.

Hello, do you have any updates regarding this bug? It’s been a while since the issue appeared, many updates have been released since, but the problem doesn’t seem to be resolved. This concerns one of the most important features of the Plex server on the Shield…

Regards,

The original Plex employee looking into this appears was let go. Likely MovieFan… So… :confused:

Hello Plex Community,

I hope this message finds you well. I would like to request an official response from a Plex employee regarding a persistent issue that has been affecting users since May 21st.

Many community members have dedicated their time and effort to provide extensive information, including logs and test results, in an attempt to resolve this issue.

Some users have even proposed code modifications as potential solutions. It appears that the bug has also been successfully reproduced by plex team.

We understand that resolving complex issues can take time, but it would greatly benefit the community to receive an official update on the status of this problem and any potential plans for addressing it.

Your insights and expertise are highly valued, and we look forward to hearing from a Plex team member soon.

Thank you for your attention to this matter.

Best regards,

2 Likes

My understanding is that the employees who worked on this part of the code were let go in the recent layoffs.

It seems the priority going forward is more on ad-revenue from free streaming channels.

My feeling too, to be honest. Disappointing as I purchased both the Shield and lifelong Plex membership specifically for this functionality.

1 Like

Im a newbie Nvidia shield user and Im experiencing this too - I feel disapointed that the plex website that mentions support for this hardward doesnt mention that hardware transcoding isnt working.

In my own tests - video files are HW decoded but then it errors when trying to HW encode… if I disable HW encoding - then Software encoding starts and everything works, but its slow and limited and I bought this device specifically for HW transcoding -

Are plex actively working on this? How do I roll back a client version of Plex server in the android app store?

1 Like

me too.

I give up on the crappy Nvidia Device

Going back to a real option
a QNAP NAS with hardware encoding in built Intel, or with PCIe expansion option

@anon18523487 - is there an update on fixing transcoding in Experience 9?

1 Like

it’s a pity for the equipment, you have to look for something economical for transcoding