{"id":412,"date":"2024-04-27T00:12:54","date_gmt":"2024-04-27T06:12:54","guid":{"rendered":"https:\/\/jimmyhoke.net\/wp\/?p=412"},"modified":"2026-03-21T16:33:00","modified_gmt":"2026-03-21T22:33:00","slug":"iphone-hdr-video-how-the-heck-do-i-work-with-this","status":"publish","type":"post","link":"https:\/\/jimmyhoke.net\/wp\/?p=412","title":{"rendered":"iPhone HDR Video: How the Heck Do I Work With This?"},"content":{"rendered":"\n<details class=\"wp-block-details is-layout-flow wp-block-details-is-layout-flow\"><summary>UPDATE 2026-03-21<\/summary>\n<p><strong>Update 2026-03-21:<\/strong> I&#8217;ve been doing quite a bit more encoding since I write this and have learned a few new tricks. Here is a much better filter chain for tonemapping:<br><code>zscale=t=linear:npl=100,format=gbrpf32le,zscale=p=bt709,tonemap=tonemap=hable:desat=0,zscale=t=bt709:m=bt709:r=tv,format=yuv420p<\/code><br>And if you have FFMPEG with libplacebo and Vulkan setup, you can get a better result using something like this:<br><code>hwupload,libplacebo=tonemapping=bt.2390:colorspace=bt709:color_primaries=bt709:color_trc=bt709:range=tv:format=yuv420p10le,hwdownload,format=yuv420p<\/code><\/p>\n<\/details>\n\n\n\n<p>For a while now, iPhone&#8217;s have shot video in Dolby Vision HDR (High Dynamic Range) by default. This means you have a wider range of color in your videos, as well as a wider range of brightness. HDR is nice because you can have very bright and very dark areas in a single video. Below is a test video I recorded.<\/p>\n\n\n\n<div style=\"width:90%;height:460px;\"><iframe src=\"https:\/\/iframe.mediadelivery.net\/embed\/230614\/1ac006c5-35a2-44ba-ae7a-8653ce0c30a2?autoplay=false&#038;loop=false&#038;muted=false&#038;preload=true&#038;responsive=true\" loading=\"lazy\" style=\"border:0;top:0;height:100%;width:100%;\" allow=\"accelerometer;gyroscope;autoplay;encrypted-media;picture-in-picture;\" allowfullscreen=\"true\"><\/iframe><\/div>\n\n\n\n<p>Unfortunately there are a lot of problems with HDR, especially Dolby Vision. While it is a fantastic technology that looks great in movies, HDR footage is difficult to edit. Additionally, when posted to to platforms like Instagram and TikTok, HDR footage brightens the user&#8217;s screen. I have seen many people on TikTok complaining about this and I personally find that is dramatically harms the viewing experience.<\/p>\n\n\n\n<p>The solution to this is to convert the video to SDR (Standard Definition Range). This is the good old regular video that doesn&#8217;t cause weird issues on social media. While it might not have the color range and contrast of HDR, it results in a much better and more reliable viewing experience.<\/p>\n\n\n\n<p>The problem with this is that the conversion process is a bit complex. Most desktop video editing apps export in SDR by default, but they don&#8217;t always handle HDR footage well. For instance, below is what happens by default when the above video is processed by Kdenlive (a fantastic free video editor).<\/p>\n\n\n\n<div style=\"width:90%;height:460px;\"><iframe src=\"https:\/\/iframe.mediadelivery.net\/embed\/230614\/e924d308-4a19-40fc-9bf0-913c656bb9cc?autoplay=false&#038;loop=false&#038;muted=false&#038;preload=true&#038;responsive=true\" loading=\"lazy\" style=\"border:0;top:0;height:100%;width:100%;\" allow=\"accelerometer;gyroscope;autoplay;encrypted-media;picture-in-picture;\" allowfullscreen=\"true\"><\/iframe><\/div>\n\n\n\n<p>As you might be able to see the video looks very washed out. If you are watching on a device that doesn&#8217;t support HDR, then both videos probably look bad. This is another issue with HDR, and why we will be converting to SDR.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Converting to SDR<\/h2>\n\n\n\n<p>To convert a video to SDR you need to use a process called tonemapping. Tonemapping allows us to convert the iPhone video&#8217;s BT.2020 color space to the BT.709 color space. To do this I used a command-line tool called <a href=\"https:\/\/ffmpeg.org\/\">FFmpeg<\/a>. FFmpeg is a fantastic tool for video editing, transcoding, and other complex video operations. Here is the command i used:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ffmpeg -i IMG_6373.MOV -vf zscale=transfer=linear,tonemap=hable:peak=5,zscale=transfer=bt709,format=yuv420p,colorspace=all=bt709 video.mkv<\/code><\/pre>\n\n\n\n<p>This might seem like a daunting command, but this is what the options mean.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>-i IMG_6373.MOV<\/td><td>This is the name of the input video<\/td><\/tr><tr><td>-vf<\/td><td>This indicated that the next argument will be the video filter options<\/td><\/tr><tr><td>zscale=transfer=linear<\/td><td>This linearizes the video. I don&#8217;t actually know what this means but you have to do it for the tonemap filter to accept the frames.<\/td><\/tr><tr><td>tonemap=hable:peak=5<\/td><td>We are using the Hable algorithm. Hable preserved details while sacrificing color accuracy. If you want to focus on color accuracy use mobius instead. I set the peak to 5 here but you might need to test different values for this to get the right brightness. To preview these options use the ffplay tool like this: ffplay [filename] -vf [filter options]<\/td><\/tr><tr><td>zscale=transfer=bt709<\/td><td>Undo the linear thing and format as BT.709 color<\/td><\/tr><tr><td>format=yuv420p<\/td><td>Format the pixels as YUV 4:2:0. This is a way of storing color information. There are other options but this is the most compatable with browsers and apps.<\/td><\/tr><tr><td>colorspace=all=bt709<\/td><td>Not exactly sure what this does but if you don&#8217;t put it the metadata is all wrong and some players will break. I forgot this one and the video looked fine in VLC but terrible after uploading to TikTok. Don&#8217;t leave this out.<\/td><\/tr><tr><td>video.mkv<\/td><td>This is the video file we will output to. You might want to make it an MP4 file for comparability, but I generally prefer MKV.<\/td><\/tr><\/tbody><\/table><figcaption class=\"wp-element-caption\">The result is this:<\/figcaption><\/figure>\n\n\n\n<div style=\"width:90%;height:460px;\"><iframe src=\"https:\/\/iframe.mediadelivery.net\/embed\/230614\/dedda4c0-55bb-4b09-be9e-6cf81a720618?autoplay=false&#038;loop=false&#038;muted=false&#038;preload=true&#038;responsive=true\" loading=\"lazy\" style=\"border:0;top:0;height:100%;width:100%;\" allow=\"accelerometer;gyroscope;autoplay;encrypted-media;picture-in-picture;\" allowfullscreen=\"true\"><\/iframe><\/div>\n\n\n\n<p>In summary, HDR is annoying and editing it is a pain. Fortunately you can easily convert your HDR videos to fantastic SDR videos.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>For a while now, iPhone&#8217;s have shot video in Dolby Vision HDR (High Dynamic Range) by default. This means you have a wider range of color in your videos, as well as a wider range of brightness. HDR is nice because you can have very bright and very dark areas in a single video. Below [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[22,23,21],"class_list":["post-412","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-ios","tag-iphone","tag-video-editing"],"_links":{"self":[{"href":"https:\/\/jimmyhoke.net\/wp\/index.php?rest_route=\/wp\/v2\/posts\/412","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jimmyhoke.net\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jimmyhoke.net\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jimmyhoke.net\/wp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jimmyhoke.net\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=412"}],"version-history":[{"count":73,"href":"https:\/\/jimmyhoke.net\/wp\/index.php?rest_route=\/wp\/v2\/posts\/412\/revisions"}],"predecessor-version":[{"id":557,"href":"https:\/\/jimmyhoke.net\/wp\/index.php?rest_route=\/wp\/v2\/posts\/412\/revisions\/557"}],"wp:attachment":[{"href":"https:\/\/jimmyhoke.net\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=412"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jimmyhoke.net\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=412"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jimmyhoke.net\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=412"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}