Log in

View Full Version : About HDR to SDR Quality, part 2


jay123210599
15th May 2025, 03:52
I want to use this script in this page for my 4K HDR video to convert to 4K SDR, but I need to make some adjustments in order for it to work. What should I change in this script?

https://forum.doom9.org/showthread.php?p=2013487#post2013487

microchip8
15th May 2025, 06:21
The [...] part?

GeoffreyA
15th May 2025, 10:09
I want to use this script in this page for my 4K HDR video to convert to 4K SDR, but I need to make some adjustments in order for it to work. What should I change in this script?

https://forum.doom9.org/showthread.php?p=2013487#post2013487

In place of the [...], you could use:

-preset slower -crf 18

Depending on whether it's live action or anime, you could tune it further with -x265-params. Or even change the encoder to x264 with -c:v libx264. Note that -map 0:v:0 means that only the first video stream will be processed. If you want to process all streams, including audio, change that to -map 0 and add, for example, -c:a copy later in the command, or whatever the desired result may be. One may wish to downmix multichannel audio to stereo with -ac 2. Achieving better results with audio is beyond the scope of this question, but I use two passes of the loudnorm filter coupled with downmixing, piping the result to qaac. If the source has subtitles, you may wish to copy them over with -c:s copy. MKV should be the destination.

jay123210599
16th May 2025, 03:19
In place of the [...], you could use:

-preset slower -crf 18

Depending on whether it's live action or anime, you could tune it further with -x265-params. Or even change the encoder to x264 with -c:v libx264. Note that -map 0:v:0 means that only the first video stream will be processed. If you want to process all streams, including audio, change that to -map 0 and add, for example, -c:a copy later in the command, or whatever the desired result may be. One may wish to downmix multichannel audio to stereo with -ac 2. Achieving better results with audio is beyond the scope of this question, but I use two passes of the loudnorm filter coupled with downmixing, piping the result to qaac. If the source has subtitles, you may wish to copy them over with -c:s copy. MKV should be the destination.

I made the adjustments but then I got this error:

[in#0 @ 0000015629f978c0] Error opening input: No such file or directory
Error opening input file INPUT.
Error opening input files: No such file or directory

GeoffreyA
16th May 2025, 07:06
Change INPUT to the source file with extension. Or use "%1" and drag and drop the file onto the BAT. Make sure to set OUTPUT as well.

jay123210599
16th May 2025, 11:23
Change INPUT to the source file with extension. Or use "%1" and drag and drop the file onto the BAT. Make sure to set OUTPUT as well.

I did it, now I got this error:

[AVFormatContext @ 000002665c9eec00] Unable to choose an output format for 'crop=1920:804:0:138:exact=true,sidedata=delete'; use a standard extension for the filename or specify the format manually.
[out#0 @ 000002665c9eb840] Error initializing the muxer for crop=1920:804:0:138:exact=true,sidedata=delete: Invalid argument
Error opening output file crop=1920:804:0:138:exact=true,sidedata=delete.
Error opening output files: Invalid argument

GeoffreyA
16th May 2025, 11:53
The entire command should be on one line; I separated it, in that previous post, for clarity. Then, make sure that each comma is touching the previous filter: no spaces. To use spaces, enclose the -vf in double quotes:

-vf "filter1, filter2, filter3"

microchip8
16th May 2025, 12:15
Did you add -vf before the filter chain?