If you have not already, we suggest setting your Plex username to something else rather than email which is displayed on your posts in forum. You can change the username at https://app.plex.tv/desktop#!/account
Welcome to our forums! Please take a few moments to read through our Community Guidelines (also conveniently linked in the header at the top of each page). There, you'll find guidelines on conduct, tips on getting the help you may be searching for, and more!

Strange behavior with transcoding on n Apple TV 4K (and iPad pro)

fsl2014fsl2014 Posts: 62Members, Plex Pass Plex Pass

Hi,

I recently update my plex environment:

New powerful Server and new client which is now Apple TV 4K.

Server is a Intel Skylake CPU i7500T (quad core with latest QSV features), transcoding is enabled and is working well. Server version is 1.9.4.4325

Here my findings and problems:

1) I have plenty of ts files recored from satellite TV. These files are ts container which include h264 streams 1080i50 at bandwidths between 5-15 MB/s in average.

So once I moved the ts files to the plex server I discovered the ATV 4K to behave like this: I start the playback with Audio is on but no video coming through, in other words only a black screen with audio. From my previous experiences I remembered that ts files are tricky since they have some not video related overhead information inside (that happened to me few years ago with a Raspberry PI setup). So I re-coded (using mkvmerge) the ts files to mkv files (with slightly smaller file size in result).

Same thing happens, no change in behavior compared to the original ts file.

It is important to mention that mkv files from makemkv are not problematic, they start to play just as normal as expected (with transcoding).

2) I took my older iPad Air 1 and played the same files as above. And surprise: No issue playing this files, so both mkv and the original ts file play well. Transcoding I noticed is set to 4MBs 720p. So with the older iPad not being so powerful this is a thing which understandable. Pushing it manually to a higher bandwidth is not working for all bandwidths, 8 MBs 1080p seems to be possible (it is not a network bandwidth thing, as later turned out when playing the iPad pro in parallel).

3) With knowing that I returned to the ATV 4K. First step was to modify the bandwidth manually and it turned out to be a successful step. Playback starts with audio and video. I repeated it also with ts and mkv file, both behave the same (means actually now with newer versions of plex server and client there is no issue with ts files).

I started with lower bandwidth but on the ATV 4K it seems to be possible even at 20MBs 1080p settings. What is not possible to use the „automatic convert“ setting or the „direct stream“.

One interesting thing is also: Once playing the from scratch with Audio and black screen even to enter the bandwidth setting and just select to the already checked marked 20 MBs 1080p setting is sufficient to „tweak“ the client on ATV 4k to play.

4) iPad pro (2015 9.8“) experience: I did all the same experiments as I did with the ATV 4K and the results are the same. It surprised me as it behaved different to the iPad Air 1.

Conclusion: My setup has a problem with ts or corresponding mkv files with more powerful clients and is confused somehow by the transcoding settings, assuming that it selected by intention the 20MBs 1080p setting. Re-Confirming the settings simply solve the problem, but cause a „bad user experience“.

The setup has not problems with mkv files in general, since other files play. Maybe this is related to higher bandwidth or something else different (profile of the decoding or something).

I tried to workaround with the settings in the client app:

a) modify the automatic quality between on and off
b) Play smaller files at original quality (only ATV 4K)

No success. Anybody ideas?

It is no bandwidth issue or server not powerful enough issue since at he end 3 streams ran in parallel, two via wifi and one over ethernet.

Finally I must say that it would be desirable to just direct play the file on apple devices. And the Infuse App demonstrates that this is possible (at least for the ATV 4K). I accept transcoding or even understand the need of transcoding for mobile devices via wifi but not for a wired (network) player.

Many thanks for reading this long text.

Best regards,
Frank

Comments

  • fsl2014fsl2014 Posts: 62Members, Plex Pass Plex Pass

    Update:

    The status when information on the server when playing the files is for video "direct play" which I think is a bug.

    For the iPad pro the workaround is to set the quality settings to 1080p 12MBs rather than the standard setting 1080p 20MBs. Than it will transcode as expected. That contradicts with the workaround which I described earlier by setting the quality per individual movie to the 1080p 20 MBs setting. So I think this kind of confirms that in with that setting something strange and buggy is going on, so direct play is not what is desired by that setting to my understanding.

    For the iPad the setting is OK, since there is no visible quality difference between 20MBs and 12MBs.

    Question: Where can I put this bug?

    Frank

  • fsl2014fsl2014 Posts: 62Members, Plex Pass Plex Pass

    Update 2:

    Same status ("direct play") for client Apple TV 4k.

    Same workaround is possible (12 MBs 1080p) but it is not acceptable in this case, since the differences are visible.

    20MBs 1080p manual set for the file is still possible.

    One thing I recognized: one setting "Player smaller files at original quality" is always set to on. Once I overwrite this setting to off the app obviously does overwrite this setting to on. I don't fully understand the meaning of this setting, but if I interpret in my way than exactly this setting would solve the problem if could be set to off.

    Btw. I do not see a similar setting in the iPad App.

    Frank

  • fsl2014fsl2014 Posts: 62Members, Plex Pass Plex Pass

    Logs attached.

    Dear Plex teams,

    I think this is a bug on IOS or TVOS if there is a "powerfull" client attached. Instead of transcoding a "direct play" for video is selected. This can be fixed manually per video with the quality settings, even just re-confirming the already checked marked 1080p 20MBs kicks the client to play the file properly. It cannot be fixed with the general settings other than selecting the lower bandwithes (for me works 1080p 12MBs e.g.).

    Please check the logfiles. It includes two attempts to play a) a mkv file and b) a ts file.

    Thanks,

    Frank

  • Cleaner_2000Cleaner_2000 Posts: 129Members, Plex Pass Plex Pass
    edited October 15

    This problem I reported months ago and also a sample file made available to the mods. I got never an answer or a solution. I dealt with shots of sky Germany in 1080i.

    Here we go:
    https://forums.plex.tv/discussion/264968/more-things-transcoding-video-audio-with-appletv-4-lately/p4

    You see the thread ended for months. I send a file to @chrisallen, but I never got a reply.

  • fsl2014fsl2014 Posts: 62Members, Plex Pass Plex Pass

    Hi,

    thanks for pointing me there.

    Reading this I recognize there are two things here identified as a problem:

    1) files play with sound only, they direct play for some reason
    2) files do not direct play, but transcode, which has been different before and isn't working with a low performance NAS e.g.

    I have identified one more thread with the number 1) problem:

    https://forums.plex.tv/discussion/291620/enabling-convert-automatically

    I understand the bitterness that nothing happens here. That is the reason I will drive this further.

    Question: In between I learned that there is on the server is a config file called tvos.xml which kind of gives guidance what content to transcode or the other way round to control what can be "direct play". So question to the experts, is that a way to tackle my problem? I hadn't have a look the file on my server but will do that soon. So for me personally I don't care about transcoding, as long it does it on the highest level (20MBit).

    To be honest: None of my contents direct plays on the Apple devices. And Plex in general has the attitude to prefer transcoding. So I am following this way.

    Cheers,
    Frank

  • fsl2014fsl2014 Posts: 62Members, Plex Pass Plex Pass

    Update:

    From the web I got this as the latest tvos.xml. There is a section:

    <DirectPlayProfiles>
     ...
     <VideoProfile protocol="hls" container="mpegts" codec="h264" audioCodec="aac" />
     ...
     </DirectPlayProfiles>
    

    Is this the problematic line?

    And does it contradcit with that line:

    <TranscodeTargets>
    <VideoProfile protocol="hls" container="mpegts" codec="h264" audioCodec="aac,eac3,ac3,mp3" context="streaming" />
    </TranscodeTargets>
    

    maybe I need some more background hows this technically works.

    Best regrads,
    Frank

       > <?xml version="1.0" encoding="utf-8"?>
        > <Client name="tvOS">
        >   <!-- Author: Plex Inc. -->
        >   <!-- This profile is used by A8-based tvOS devices -->
        >   <Settings>
        >     <Setting name="DirectPlayStreamSelection" value="true" />
        >     <Setting name="StreamUnselectedIncompatibleAudioStreams" value="true" />
        >   </Settings>
        >   <TranscodeTargets>
        >     <VideoProfile protocol="hls" container="mpegts" codec="h264" audioCodec="aac,eac3,ac3,mp3" context="streaming" />
        >     <MusicProfile container="mp3" codec="mp3" />
        >     <PhotoProfile container="jpeg" />
        >     <SubtitleProfile protocol="hls" container="webvtt" subtitleCodec="webvtt"/>
        >   </TranscodeTargets>
        >   <DirectPlayProfiles>
        >     <VideoProfile container="mp4" codec="h264,mpeg4" audioCodec="aac,ac3,eac3" subtitleCodec="mov_text,tx3g,ttxt,text" />
        >   
        >     <VideoProfile container="mov" codec="h264,mpeg4" audioCodec="aac,ac3" subtitleCodec="mov_text,tx3g,ttxt,text" />
        >     <!-- Allow Direct Play of HLS content  -->
        >     <VideoProfile protocol="hls" container="mpegts" codec="h264" audioCodec="aac" />
        >     <MusicProfile container="mp3" codec="mp3" />
        >     <MusicProfile container="mp4" codec="aac" />
        >     <PhotoProfile container="jpeg" />
        >   </DirectPlayProfiles>
        >   <CodecProfiles>
        >     <VideoCodec name="h264">
        >       <Limitations>
        >         <UpperBound name="video.width" value="1920" isRequired="true" />
        >         <UpperBound name="video.height" value="1080" isRequired="true" />
        >         <UpperBound name="video.bitDepth" value="8" />
        >       </Limitations>
        >     </VideoCodec>
        >     <VideoAudioCodec name="aac">
        >       <Limitations>
        >         <UpperBound name="audio.channels" value="2" />
        >       </Limitations>
        >     </VideoAudioCodec>
        >   </CodecProfiles>
        > </Client>
    
  • fsl2014fsl2014 Posts: 62Members, Plex Pass Plex Pass

    Update:

    No success in trying things out just by guessing. So please give me guidance on what is possible with tvOS.xml.

    As you read this is a profile for A8 based tvOS, maybe an update for A10 based tvOS is needed? The same is true for h265 profiles as I read in such threads, can you please check on that?

    Best regards,
    Frank

  • j_r0ddj_r0dd Posts: 31Members, Plex Pass Plex Pass

    All my 4k HEVC encoded material transcodes to h264 on the apple tv. These files should at least direct stream since the 4k apple tv supports hevc. This is quite irritating since I replaced my Roku Ultra which played these movies fine. I played around with the tvos.xml with settings I found somewhere else in the forum and it still transcodes. The tvos.xml needs to be updated and the app on the apple tv might need to as well.

  • phiredropphiredrop Posts: 8Members, Plex Pass Plex Pass

    I too am seeing similar behavior on my iPad Pro with encoded .ts recordings. If I don't run my postprocessing script that transcodes to mp4, the original .ts files play fine. However after encoding them with handbrake to mp4, then renaming back to .ts for it to get placed in the Library, the iPad won't even play the file.

    However, I can get the file to play if I do one of two things:

    1. Change the Home Streaming quality on the iPad Plex app so anything lower than 1080p 20Mbps
    2. Change the video's file extension to .mp4
  • amadiganamadigan Posts: 6Members, Plex Pass Plex Pass

    I meant to post this a while ago, but it is possible to get Plex to stop transcoding HEVC.

    /usr/lib/plexmediaserver/Resources/profiles

    <?xml version="1.0" encoding="utf-8"?>
    <Client name="tvOS">
      <!-- Author: Plex Inc. -->
      <!-- This profile is used by A8-based tvOS devices -->
      <Settings>
        <Setting name="DirectPlayStreamSelection" value="true" />
        <Setting name="StreamUnselectedIncompatibleAudioStreams" value="true" />
      </Settings>
      <TranscodeTargets>
        <VideoProfile protocol="hls" container="mpegts" codec="h264" audioCodec="aac,eac3,ac3,mp3" context="streaming" />
        <MusicProfile container="mp3" codec="mp3" />
        <PhotoProfile container="jpeg" />
        <SubtitleProfile protocol="hls" container="webvtt" subtitleCodec="webvtt"/>
      </TranscodeTargets>
      <DirectPlayProfiles>
        <VideoProfile container="mp4" codec="h264,mpeg4,hevc" audioCodec="aac,ac3,eac3" subtitleCodec="mov_text,tx3g,ttxt,text" />
        <!-- Since tvOS may have issues direct playing mov/*/eac3 it has its own profile  -->
        <VideoProfile container="mov" codec="h264,mpeg4,hevc" audioCodec="aac,ac3" subtitleCodec="mov_text,tx3g,ttxt,text" />
        <!-- Allow Direct Play of HLS content  -->
        <VideoProfile protocol="hls" container="mpegts" codec="h264,hevc" audioCodec="aac" />
        <MusicProfile container="mp3" codec="mp3" />
        <MusicProfile container="mp4" codec="aac" />
        <PhotoProfile container="jpeg" />
      </DirectPlayProfiles>
      <CodecProfiles>
        <VideoCodec name="h264,hevc">
          <Limitations>
            <UpperBound name="video.width" value="1920" isRequired="true" />
            <UpperBound name="video.height" value="1080" isRequired="true" />
            <UpperBound name="video.bitDepth" value="8" />
          </Limitations>
        </VideoCodec>
        <VideoAudioCodec name="aac">
          <Limitations>
            <UpperBound name="audio.channels" value="2" />
          </Limitations>
        </VideoAudioCodec>
      </CodecProfiles>
    </Client>
    

    Basically, just add ,hevc after every instances of h264 (s/h264/h264,hevc/). However, Apple has a restriction on HEVC: the codec_tag_name must be hvc1, but some tools (like ffmpeg) default to hev1.

    Here's the command I used to re-tag the files:

    ffmpeg -i yourinput.mp4 -tag:v:0 hvc1 -hide_banner -max_muxing_queue_size 40960 -movflags faststart -write_tmcd on -vcodec copy -scodec copy -acodec copy -map 0 youroutput.mp4

    Poof! Plex Web reports 'Direct Play' when watching an H265 file on the Apple TV. Applying the same change in iOS.xml also allows Direct Play to iPhone and iPad. I haven't been able to get web playback in Safari, though.

    Honestly, I'm not sure why Plex hasn't done this. I figured I was late to the game because I only figured this out after the tvOS beta ended, but I've had this working for weeks now. It is a bit annoying that each Plex server update overwrites my changes to these files. I guess the codec_tag_name is a bit of a sticking point, but a very light change to the metadata before the file is sent to the Apple TV should fix that.

    Note: Apple TV 4K is not required.

  • fsl2014fsl2014 Posts: 62Members, Plex Pass Plex Pass

    @phiredrop said:
    I too am seeing similar behavior on my iPad Pro with encoded .ts recordings. If I don't run my postprocessing script that transcodes to mp4, the original .ts files play fine. However after encoding them with handbrake to mp4, then renaming back to .ts for it to get placed in the Library, the iPad won't even play the file.

    However, I can get the file to play if I do one of two things:

    1. Change the Home Streaming quality on the iPad Plex app so anything lower than 1080p 20Mbps
    2. Change the video's file extension to .mp4
    1. I can confirm
    2. does not work for me as a fix, same behavior as before

    Frank

Sign In or Register to comment.