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. |
![]() |
#5601 | Link |
Registered User
Join Date: Apr 2017
Posts: 33
|
Re-encode UHD
Good day,
my first post, although I follow this thread for a long time now, so first things first: I'd like to thank you for your work. It's amazing how much effort you put into such a great and free ! solution. Really appriciated! I'd like to re-encode some UHD material but while I found quite a bit about Quality Tuning, I'm lost when it comes to just re-encoding it, using less bandwidth, but keeping everything else the same. In particular the HDR Parameters. Examples: Color range : Limited Color primaries : BT.2020 Transfer characteristics : SMPTE ST 2084 Matrix coefficients : BT.2020 non-constant Mastering display color primaries : R: x=0.680000 y=0.320000, G: x=0.265000 y=0.690000, B: x=0.150000 y=0.060000, White point: x=0.312680 y=0.329000 Mastering display luminance : min: 0.0050 cd/m2, max: 1000.0000 cd/m2 Maximum Content Light Level : 1000 cd/m2 Maximum Frame-Average Light Level : 96 cd/m2 Color range : Limited Color primaries : BT.2020 Transfer characteristics : SMPTE ST 2084 Matrix coefficients : BT.2020 non-constant Mastering display color primaries : R: x=0.680000 y=0.320000, G: x=0.265000 y=0.690000, B: x=0.150000 y=0.060000, White point: x=0.312700 y=0.329000 Mastering display luminance : min: 0.0000 cd/m2, max: 1000.0000 cd/m2 Color range : Limited Color primaries : BT.2020 Transfer characteristics : SMPTE ST 2084 Matrix coefficients : BT.2020 non-constant Mastering display color primaries : R: x=0.680000 y=0.320000, G: x=0.265000 y=0.690000, B: x=0.150000 y=0.060000, White point: x=0.312680 y=0.329000 Mastering display luminance : min: 0.0050 cd/m2, max: 1000.0000 cd/m2 they all have a bit different Parameters. How would I re-encode those, while preserving all those values for each file? I guess there is no "take those Parameters from the source file and re-use them in the target file" Option and I have to provide them manually for every file? Can you provide an example on how to re-encode an mkv (I use ffmpeg and pipe), maybe with some good tunning tips included? thanks!! |
![]() |
![]() |
![]() |
#5602 | Link |
Registered User
Join Date: Dec 2002
Posts: 5,570
|
Example for your first file:
ffmpeg -i "input.mkv" -pix_fmt yuv420p10 -strict -1 -f yuv4mpegpipe - | x265 - --y4m --output-depth 10 --colorprim 9 --transfer 16 --colormatrix 9 --range limited --chromaloc 2 --max-cll "1000,96" --master-display "G(13250,34500)B(7500,3000)R(34000,16000)WP(15634,16450)L(10000000,50)" -o "output.265" (--chromalog 2 is usually used for 4K HDR so I have set it. But MediaInfo doesn't show this about your source.) remux with audio/subs from source: mkvmerge -o "output.mkv" "output.265" --no-video "input.mkv" You can find some more examples/discussion here: https://forum.doom9.org/showthread.php?t=174491 http://x265.readthedocs.io/en/defaul...mation-options Last edited by sneaker_ger; 14th September 2017 at 12:55. Reason: edited colorprim/transer/matrix to int values because of x265 cli change |
![]() |
![]() |
![]() |
#5604 | Link |
Registered User
Join Date: Dec 2002
Posts: 5,570
|
|
![]() |
![]() |
![]() |
#5605 | Link | |
Registered User
Join Date: Apr 2017
Posts: 33
|
Quote:
![]() so basically only --max-cll changes accordingly to the source? Is there a need/benefit using any of the uhd/hdr Options like "--hdr-opt"? You have some advice on the remaining regular settings for UHD? (preset, CRF value)? thanks! |
|
![]() |
![]() |
![]() |
#5606 | Link | |
Registered User
Join Date: Dec 2002
Posts: 5,570
|
Other parameters might change as well but it seems most of the sources floating around use the same parameters, mostly. It's your job to check.
Also, some sources have parameters that don't make much sense. Like your second file which has "Mastering display luminance : min: 0.0000 cd/m2, max: 1000.0000 cd/m2". Minimum luminance of 0? I don't think such a display is on the market. Quote:
--hdr-opt is supposed to increase compression for HDR but I haven't actually tested it nor see other comparisons. I suggest you read the thread I linked and look around a bit around the forum. It's subjective. Preset: as slow as you are willing to wait CRF: as low as you are willing to sacrifice HDD space |
|
![]() |
![]() |
![]() |
#5608 | Link |
Registered User
Join Date: Dec 2002
Posts: 5,570
|
The integers should be the integers as they are stored in the bitstream, i.e. taken right out of the HEVC specs. I assume .. well .. hope they will never change. In this case I just chose them so it works with old and new x265 version.
|
![]() |
![]() |
![]() |
#5609 | Link |
Registered User
Join Date: Jun 2002
Location: On thin ice
Posts: 6,660
|
I think if you compare with the console and online help you'll probably find more then one issue.
Code:
static const char * const x265_source_csp_names[] = { "i400", "i420", "i422", "i444", "nv12", "nv16", 0 }; static const char * const x265_video_format_names[] = { "component", "pal", "ntsc", "secam", "mac", "unknown", 0 }; static const char * const x265_fullrange_names[] = { "limited", "full", 0 }; static const char * const x265_colorprim_names[] = { "reserved", "bt709", "unknown", "reserved", "bt470m", "bt470bg", "smpte170m", "smpte240m", "film", "bt2020", "smpte428", "smpte431", "smpte432", 0 }; static const char * const x265_transfer_names[] = { "reserved", "bt709", "unknown", "reserved", "bt470m", "bt470bg", "smpte170m", "smpte240m", "linear", "log100", "log316", "iec61966-2-4", "bt1361e", "iec61966-2-1", "bt2020-10", "bt2020-12", "smpte2084", "smpte428", "arib-std-b67", 0 }; static const char * const x265_colmatrix_names[] = { "gbr", "bt709", "unknown", "", "fcc", "bt470bg", "smpte170m", "smpte240m", "ycgco", "bt2020nc", "bt2020c", "smpte2085", "chroma-derived-nc", "chroma-derived-c", "ictcp", 0 }; |
![]() |
![]() |
![]() |
#5613 | Link | |
.
Join Date: Dec 2006
Posts: 173
|
Quote:
Besides there are over several dozen of ways to remove noise and artifacts depending on the source. |
|
![]() |
![]() |
![]() |
#5614 | Link |
Pig on the wing
Join Date: Mar 2002
Location: Hollola, Finland
Posts: 4,991
|
There are the --nr-intra and --nr-inter options available. Also the dreaded --sao a.k.a. Smooth All Objects could be helpful in your case.
__________________
And if the band you're in starts playing different tunes I'll see you on the dark side of the Moon... |
![]() |
![]() |
![]() |
#5618 | Link |
Registered User
Join Date: Feb 2007
Location: Sweden
Posts: 364
|
x265 v2.5+20-0967d0add97e (GCC 7.2.0, 32 & 64-bit 8/10/12bit Multilib Windows Binaries)
x265 [info]: HEVC encoder version 2.5+20-0967d0add97e x265 [info]: build info [Windows][GCC 7.2.0][32/64 bit] 8bit+10bit+12bit x265 [info]: using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2 Code:
https://bitbucket.org/multicoreware/x265/commits/branch/default |
![]() |
![]() |
![]() |
#5619 | Link |
German doom9/Gleitz SuMo
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,348
|
x265 2.5+22-8db95a1da9f8 (MSYS/MinGW, GCC 7.1.0) ... does XhmikosR still update?
Fixes for analysis load, WPP, bitstream payload size, VBV hanging; new (internal?) parameter for disabling lookahead; Windows DLL will export x265_encoder_ctu_info() |
![]() |
![]() |
![]() |
#5620 | Link | |
Moderator
![]() Join Date: Jan 2006
Location: Portland, OR
Posts: 3,536
|
Quote:
Of course it can also lose detail in moving areas as well. |
|
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|