Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > High Efficiency Video Coding (HEVC)

Reply
 
Thread Tools Search this Thread Display Modes
Old 13th October 2019, 21:56   #1  |  Link
Blue_MiSfit
Derek Prestegard IRL
 
Blue_MiSfit's Avatar
 
Join Date: Nov 2003
Location: Los Angeles
Posts: 5,528
HEIC / HEIF encoding for iOS

Hey gang!

I'd like to mess around with encoding some wide gamut HEVC images for iOS.

I'm an amateur photographer for fun, and have a nice DSLR so I have some images with big fat gamut. Lightroom works natively in ProPhoto and can export TIFF as Display P3 which is the native space of modern iDevices

I can encode these into HEVC with ffmpeg / x265 without too much trouble, but I'm not sure I'm doing the RGB -> YCbCr in such a way that I preserve the full range and color space.

I think I want to take 16 bpc full range RGB using Display P3 (so P3 primaries and matrix and sRGB transfer), and make full range YCbCr again using P3 primaries and matrix and sRGB transfer. I think 4:4:4 10 bit is ideal. Maybe this should be limited range YCbCr too? Not sure. I think JPEGs use full range YCbCr usually so I'd imagine that's fine in this case too.

The problem is, I don't see P3 as one of the options in x265 for primaries and matrix.

Aside from that I have to do the fMP4 muxing with HEIF compliance. I looked into the nokia open source project but it's pretty low level. I'll dig into that when I get there.

Any suggestions on the encoding?

Last edited by Blue_MiSfit; 13th October 2019 at 23:30.
Blue_MiSfit is offline   Reply With Quote
Old 14th October 2019, 00:02   #2  |  Link
Blue_MiSfit
Derek Prestegard IRL
 
Blue_MiSfit's Avatar
 
Join Date: Nov 2003
Location: Los Angeles
Posts: 5,528
Looks like mp4box can write HEIF, so that's cool

https://gpac.wp.imt.fr/2017/06/09/gp...port-for-heif/

Still wondering how to tag the image correctly so it will render in Display P3 on the iDevice
Blue_MiSfit is offline   Reply With Quote
Old 14th October 2019, 17:55   #3  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 2,951
Quote:
Originally Posted by Blue_MiSfit View Post
I'd like to mess around with encoding some wide gamut HEVC images for iOS.

I'm an amateur photographer for fun, and have a nice DSLR so I have some images with big fat gamut. Lightroom works natively in ProPhoto and can export TIFF as Display P3 which is the native space of modern iDevices

I can encode these into HEVC with ffmpeg / x265 without too much trouble, but I'm not sure I'm doing the RGB -> YCbCr in such a way that I preserve the full range and color space.

I think I want to take 16 bpc full range RGB using Display P3 (so P3 primaries and matrix and sRGB transfer), and make full range YCbCr again using P3 primaries and matrix and sRGB transfer. I think 4:4:4 10 bit is ideal. Maybe this should be limited range YCbCr too? Not sure. I think JPEGs use full range YCbCr usually so I'd imagine that's fine in this case too.

The problem is, I don't see P3 as one of the options in x265 for primaries and matrix.

Aside from that I have to do the fMP4 muxing with HEIF compliance. I looked into the nokia open source project but it's pretty low level. I'll dig into that when I get there.

Any suggestions on the encoding?
Very cool! The most compatible thing would be to make a 10-bit limited range 4:2:0 stream with the SMPTE 2100 color (PQ, 2020 primaries). That's good old HDR-10, which is supported by anything that could display HDR images. If you get that working, you can experiment with other options. I think PQ + P3 primaries is likely to work on at least some devices.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 14th October 2019, 18:25   #4  |  Link
Blue_MiSfit
Derek Prestegard IRL
 
Blue_MiSfit's Avatar
 
Join Date: Nov 2003
Location: Los Angeles
Posts: 5,528
That's kind of what I was thinking too.

Outstanding questions:

- How to convert my images into Rec2020 (since they are natively ProPhoto and Lightroom can export in sRGB or Display P3)
- How to make them PQ (since all the export options from Lightroom use the sRGB gamma curve)

I also had the thought of making Dolby Vision using Resolve + Dolby Encoding Engine, but I quickly got lost scratching my head on grading the images into PQ in Resolve in a way that looked good.
Blue_MiSfit is offline   Reply With Quote
Old 15th October 2019, 00:21   #5  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 2,951
Quote:
Originally Posted by Blue_MiSfit View Post
That's kind of what I was thinking too.

Outstanding questions:

- How to convert my images into Rec2020 (since they are natively ProPhoto and Lightroom can export in sRGB or Display P3)
- How to make them PQ (since all the export options from Lightroom use the sRGB gamma curve)
After Effects and Premiere Pro can take in whatever .psd file or whatever and convert it into a frame of 2100. You could even export a 1 sec long 1 fps .mp4 using Adobe Media Encoder.

Quote:
I also had the thought of making Dolby Vision using Resolve + Dolby Encoding Engine, but I quickly got lost scratching my head on grading the images into PQ in Resolve in a way that looked good.
I've never heard of anyone trying to use DoVi as an image format. It might "just work" on some devices.

HDR10+ metadata should work fine for images, however.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 22:30.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.