Stream personal iTunes content in 4K

Discussion in 'Apple TV and Home Theater' started by Jespertje93, Dec 30, 2017.

  1. Jespertje93 macrumors newbie

    Joined:
    Mar 2, 2015
    #1
    Is it possible to stream your own home-made video’s (edited in iMovie) in iTunes to the Apple TV 4K in 4K? Or does it downscale them to 1080p when streaming?

    Thanks in advance!
     
  2. priitv8, Dec 30, 2017
    Last edited: Dec 30, 2017

    priitv8 macrumors 68030

    Joined:
    Jan 13, 2011
    Location:
    Estonia
    #2
    It is totally possible and they will not be downscaled.
    Just for performance reasons (same PQ at lesser file size and bitrate) you’d want to encode them 4K movies into HEVC.
    If you plan to venture into HDR-land, then 10-bit HEVC encode becomes a must.
    A screenshot of my iTunes streaming (very last screenshot) in this post:
    https://forums.macrumors.com/thread...elivering-4k-hdr.2073222/page-3#post-25152229
     
  3. Michelasso macrumors regular

    Michelasso

    Joined:
    Feb 20, 2012
    Location:
    Treviso, Italy
    #3
    Do you have the ffmpeg parameters to convert into 10-bit HEVC with HDR? Because I asked in superuser few days ago and I have got no answer.
     
  4. priitv8 macrumors 68030

    Joined:
    Jan 13, 2011
    Location:
    Estonia
    #4
    Yes I do. But the main trick is to get your clip color-graded with PQ-gamma, otherwise your picture levels will be way off. Today there are just two accessible tools to do that: DaVinci Resolve Studio (not the free version!) and the very recent FCPX version 10.4.
    Google for a Handbrake build that has 10-bit x265 encoder, that one will create proper 10-bit HEVC-encoded video. Just pass the right parameters to it for metadata.
     
  5. Michelasso, Jan 1, 2018
    Last edited: Jan 1, 2018

    Michelasso macrumors regular

    Michelasso

    Joined:
    Feb 20, 2012
    Location:
    Treviso, Italy
    #5
    @priitv8 So Handbrake, then? I'll look around. I have seen something about HB and HEVC in the past, but it was for Windows, I think.

    PS: I tried, it doesn't recognise vp9.2 (YouTube HDR) videos..
    PPS: Happy New Year!! :D
     
  6. priitv8 macrumors 68030

    Joined:
    Jan 13, 2011
    Location:
    Estonia
    #6
    How do I get a vp9.2 encoded video? I’d give it a try myself.
    Happy new year!
     
  7. Michelasso macrumors regular

    Michelasso

    Joined:
    Feb 20, 2012
    Location:
    Treviso, Italy
    #7
    Usually: youtube-dl -f 337[+audio] <youtube video URL/tag>

    337 may be different depending of the frame rate.
     
  8. priitv8, Jan 2, 2018
    Last edited: Jan 3, 2018

    priitv8 macrumors 68030

    Joined:
    Jan 13, 2011
    Location:
    Estonia
    #8
    Well, epic fail! None of the tools in my possession does understand the VP9.2 codec. Except IINA, but this one is only good for playback.
    Normally, to encode PQ/HDR10 video in HandBrake 10-bit, I add the following to the Additional Options field on the Video tab:
    Code:
    uhd-bd:colorprim=bt2020:transfer=smpte2084:colormatrix=bt2020nc:master-display=G(13250,34500)B(7500,3000)R(34000,16000)WP(15635,16450)L(10000000,1):max-cll=1000,400
    This will create metadata for 1000nit MaxCLL and 400nit MaxFALL. Mastering Display's primaries and white point are actually not mandatory to make the telly switch to HDR mode. transfer=smpte2084 is the main ingredient.

    EDIT: Still, there is a way! You need to re-encode the movie from vp9.2 into HEVC Main10 profile, to be able to display it on aTV 4K in HDR10. And the multitalent ffmpeg can do this!
    You'd need a late version of ffmpeg that supports high bit-depth HEVC encoding, like v3.4.1 here:
    Code:
    ffmpeg -i <infile> -c:v libx265 -tag:v hvc1 -crf 22 -pix_fmt yuv420p10le -x265-params "colorprim=bt2020:transfer=smpte2084:colormatrix=bt2020nc:master-display=G(13250,34500)B(7500,3000)R(34000,16000)WP(15635,16450)L(10000000,10):max-cll=1000,400" <outfile>.m4v
    PS: as <infile> you can give the webm downloaded from YT, like this "Real 4K HDR 60fps - OLED Art in HDR-yuaRV9hCI8A.webm"
    -crf 22 may produce too low bitrate for your taste.
    By specifying outfile extension m4v, ffmpeg seems to understand to wrap the output into mp4 container without any special command line option!
    -tag:v hvc1 is crucial for QuickTime/macOS/iOS/tvOS to accept the file as HEVC. Without it, you would need to edit the fourCC inside the mov atom yourself!
    I completely omitted audio here, as I found using Subler to add the m4a AAC-encoded stereo track, from youtube-dl will be quicker and simpler.
    But as any H.265 encode, this will take time and CPU cycles ;)

    PPS: Totally forgot the 60fps-incompatibility issue for the example clip named above ("Real 4K HDR 60fps - OLED Art in HDR-yuaRV9hCI8A.webm")
    Adding -r 30 to ffmpeg arguments should solve that as well.
     
  9. priitv8 macrumors 68030

    Joined:
    Jan 13, 2011
    Location:
    Estonia
    #9
    Re-encoding the 60fps YT clip into 30fps HDR10 clip plays back on aTV 4K as any HDR10 clip should.
    Did also a side-by-side comparison to the original (playing it back via built-in YT app on UBP-X800) and I have to say, they look similar, but not exactly the same. The re-encoded HDR10 version looks to my eyes as more colorful, more saturated.
    Hard to tell now, if it's because of the encode with x265 or are the players also rendering differently.
    Have to admit, the SDR rendering I can enjoy here in my Safari, looks color-wise closer to the UBP playback, than aTV HDR10 playback.
     
  10. Michelasso macrumors regular

    Michelasso

    Joined:
    Feb 20, 2012
    Location:
    Treviso, Italy
    #10
    Thanks! Great findings! I will first try with mkv files (I have Infuse Pro anyway, and it works). 60fps shouldn;t really be an issue, and then I want to see the big deal. I'll check later, I have stuff to do this morning (still on holiday, though! :D). And then it takes 50 minutes for a 2 minutes video with the i5 in the MBP. Zero HW acceleration (vp9.2 decoding isn't supported by the GPU, nor HEVC encoding..).

    The only way I managed (until now) to play HDR YouTube videos has been via Plex on the Android TV. But that must miss something, because they do not play as BT.2020. Changing to BT.2020 the colours looked from good to great to me, depending on the video.

    You may want to try with this video: Venice Carnival in 4K HDR 60P (UHD). It's the one that gave me most issues in terms of colours, usually too washed even in HDR. Does your UBP-X800 play YouTube videos in HDR?

    PS: If I'll make it working I'll quote your post (with credits) to give the solution in superuser. Is that all right?
    PPS: @Jespertje93 Sorry for hijacking your thread!!
     
  11. priitv8 macrumors 68030

    Joined:
    Jan 13, 2011
    Location:
    Estonia
    #11
    Yes, the Sony UHD bluray-player can play YT videos in 4K and HDR, the Android TV player can not. However weird that sounds.
    Sure, absolutely fine with me.

    PS Will check your suggested clip later after I'm back home.
     
  12. Michelasso macrumors regular

    Michelasso

    Joined:
    Feb 20, 2012
    Location:
    Treviso, Italy
    #12
    It seems to be due to either the HDR or VP9.2 APIs in Android 7.0 for Bravia, which are broken. Something Mediatek must fix (and knowing Mediatek, good luck with it!). Because, as I wrote, in my tests Plex does manage to play them automatically in HDR. With the wrong colour range, though. Also I can play them in Video, forcing the HDR and BT.2020. Maybe it has something to do with the tag you mentioned, but for VP9.2.

    Anyway... I launched the conversion before leaving, it's finished and.. It works indeed!!! The colours on the video I suggested seem a bit off, though. I share your feelings. Hmm.. No, it depends on the Picture mode in the TV, as well. I changed it to "Sport" and it does look like Venice to me. Also the costume are great looking. The good news is that seen from Video with HDR/BT.2020 enabled, the VP9.2 and HEVC version look just the same.

    Ok, thanks! Now I'd just need a super computer to convert few stuff! :D
     
  13. priitv8, Jan 3, 2018
    Last edited: Jan 3, 2018

    priitv8 macrumors 68030

    Joined:
    Jan 13, 2011
    Location:
    Estonia
    #13
  14. Michelasso macrumors regular

    Michelasso

    Joined:
    Feb 20, 2012
    Location:
    Treviso, Italy
    #14
    Yeah, I had read about it. But it still needs to decode VP9.2 by CPU, I think (like the ATV 4K). Unless that's much faster.
     
  15. priitv8 macrumors 68030

    Joined:
    Jan 13, 2011
    Location:
    Estonia
    #15
    Time for new iMac Pro, I guess :confused:
     
  16. Michelasso macrumors regular

    Michelasso

    Joined:
    Feb 20, 2012
    Location:
    Treviso, Italy
    #16
    Sure!! I had already pre-ordered it! Together with my new Lamborghini! :D
     

Share This Page