New smartphones like Samsung Galaxy S10 and S10+ can record videos in HDR10+, a new standard in HDR, which redefine the concept of Higher Dynamic Range (HDR). Watch this video to learn how to record videos in HDR10+, otherwise, continue reading the post…
Differences with HDR and how HDR10+ works…
The standard HDR technology adds up the static metadata to the content (*.MP4 video). This will mean that the parameters are applied at the beginning itself and continue throughout. This causes the bright scenes in a movie look too bright and lose detail, while the dark scenes would continue to look dim. In HDR10+ the brightness boundaries of the video clip is configured and changed in a frame by frame manner, the full-color range is added to every scene dynamically no matter whether it contains only dark or only light scenes.
In other words, HDR10+ ensures that you will end up getting the best details in your videos and images.
How an HDR10+ video is viewed on supported and non-HDR devices
There is a problem, when viewing an HDR10+ video on a device that does not support the HDR10+ standard, the video will be displayed as in the following image on the left (with washed-out colors), while on a Galaxy S10 smartphone or TV that supports HDR10+ you will see it as in the image on the right
So, to view an HDR10+ video on an unsupported device, we must first convert it to a video in SDR (standard dynamic range) which however must retains the same depth and intensity of colors, without washed-out colors, as the original HDR10+ video.
How to convert HDR10+ video to SDR on PC
To make the video conversion from HDR10+ to SDR is very simple on a Samsung Galaxy S10 smartphone, but in this article I will explain how to convert it on PC (otherwise, if you want to know how to convert it on Galaxy S10, read this from Samsung).
First of all, you need the ffmpeg software, a free command-line tool that converts audio or video formats; from this link http://ffmpeg.org/download.html look for “Get packages & executable files”, and download the compiled version for your OS (Linux, Windows or Mac).
Step 1 : Extract FFMPEG to a folder
Extract the contents of the zip file to a new folder in “C:\ffmpeg\” (this is a windows path, but you can change it at your convenience).
Step 2 : Create a Batch file and copy your HDR10+ video to convert
Create a new file named “convert.bat” in “C:\ffmpeg\bin” with the following code
C:\ffmpeg\bin\ffmpeg.exe -i video-input.mp4 -vf zscale=t=linear:npl=100,format=gbrpf32le,zscale=p=bt709,tonemap=tonemap=hable:desat=0,zscale=t=bt709:m=bt709:r=tv,format=yuv420p -c:v libx265 -crf 22 -preset medium -tune fastdecode video-output.mp4
Then, copy your HDR10+ video in “C:\ffmpeg\bin” and rename it in “video-input.mp4”
Step 3 : Open a command prompt and execute the batch
Now, press Windows button+R to open the “Run” box. Type “cmd” and click “OK” to open a regular Command Prompt. Finally, type “C:\ffmpeg\bin\convert.bat” to start the conversion from HDR10+ video to a new SDR video named “video-output.mp4”.
Conversion completed!
At the end of the conversion, you will find the new converted file in the “C:\ffmpeg\bin\” folder.
The new SDR file “video-output.mp4” can be viewed on all non-HDR devices, but with the same brightful colors as the original HDR10+ video.
Have fun converting your movies! 😀
Frank
Hi – Just stumbled upon on this and what a great deal of info here! Two quesitons:
1. Would the same code work for converting a HDR10 (not 10+) MKV (not MP4) file?
2. Will the file maintain the same file size or will it be bigger/smaller?
Thank you and I am looking forward to try this!
Max
Hi Frank! the code works also for MKV files and you can play with the ffmpeg “-crf” option to get bigger/smaller filesize; this is an example of the commands to use in the batch file for a “Lossless H.264” conversion:
C:\ffmpeg\bin\ffmpeg.exe -i video-input.mkv -vf zscale=t=linear:npl=100,format=gbrpf32le,zscale=p=bt709,tonemap=tonemap=hable:desat=0,zscale=t=bt709:m=bt709:r=tv,format=yuv420p -c:v libx264 -crf 0 -preset ultrafast -tune fastdecode video-output.mkv
For more commands to use with FFmpeg take a look at https://trac.ffmpeg.org/wiki/Encode/H.264
Enjoy! 🙂
Chris the 1 Gamer (@ChrisThe1Gamer)
Hi, i always get the error: video-input.mp4: No such file or directory
But the file is in the bin folder. What is the issue?
Max
I suppose You have to check the right file path in the batch file
Anoymous
Instead of typing what the author says to type in CMD, type the following:
1–> cd C:\ffmpeg\bin\
2–> convert.bat
This will do the trick.
Mr. Confused Person Who Wants to Edit Their Video
Hello!
Great article. I have recorded an entire project (~100 videos) in HDR10+ only to discover that I can’t edit it in this form. No knowledge of coding so I have a couple (probably extremely basic) problems:
1: I keep running into the problem that the convert.bat file is not executable. How do I make it a proper file that can be operable?
2: Is there a way to modify this command so that it will work with multiple videos? This is above and beyond, I can do this with 100 files if I NEED to.
Thanks very much in advance!
Stephen Price
Hello! Great article. I have a couple problems, though:
1: How do I actually create an executable file? I was able to follow along to that point. Whenever I open cmd.exe, it finds the convert.bat file, but can’t operate it. Do I need some other software or something?
2: This is above and beyond, but I have ~100 videos I need to convert so that I can edit them for a project. Is there a way to alter the code so that I can convert multiple at once?
Thanks in advance for any help.
Martin Ferenc
Could you please adjust this instructions for mac os? I’ve been trying hard, no success. (Don’t know how to proceed with the batch file, I’m probably typing code incorrectly, etc.) Thanks a lot, it’d be a huge help.
Ken
Hi in response to your code above this this is baseline video profile. How set the video profile to high at 4.1?
Draven
Doesn’t work for me, either. I get an error saying no such directory, which isn’t true. Everything is set up exactly as per this guide.
Alexander Ezorsky-Lie
When I play my unconverted clips in VLC they are oversaturated and constrasty (not blown out). But as a filmmaker I would much prefer the flat unsaturated “RAW” look you have on the left. Do you know of any way to use ffmpeg to conved HDR to SDR and keep that flat log picture profile? Thanks a million!
Jorge Herrera
is there a way to do the oposite if i have some 4k SDR movies and i wanted as HDR, its possible?
soLucky
thank you. i am looking very long for this 🙂 sad, that samsung cant do that on an 1200 Euro Smartphone. THANKS
calezc
Sharing for those that want to convert all files in a folder in this manner:
Create “convert.bat” file with the following text:
C:\ffmpeg\bin\ffmpeg.exe -i %1.mp4 -vf zscale=t=linear:npl=100,format=gbrpf32le,zscale=p=bt709,tonemap=tonemap=hable:desat=0,zscale=t=bt709:m=bt709:r=tv,format=yuv420p -c:v libx265 -crf 18 -preset medium -tune fastdecode “%1 (Converted)”.mp4
Create a second batch file (I called mine “LoopConvert.bat”) in the same directory with the following text:
for %%f in (.\*) do convert.bat %%~nf
Place all videos to be converted in the directory and run LoopConvert.bat.