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. |
|
![]() |
|
Thread Tools | Search this Thread | Display Modes |
![]() |
#1 | Link |
Registered User
Join Date: Jun 2022
Posts: 10
|
How do I get Avisynth to treat a file as a full range?
I have a file encoded with UTVideo codec (lossless, YUV, full range colors).
I load it with the command: ffms2("file.avi") 1. There is no color range information in the header and AviSynth treats it as a limited range. How can I make AviSynth treat this file as full range? 2. How can I make AviSynth generate the output file as full range color? MPC-HE assumes that the file is in the range 16-235 when played back. |
![]() |
![]() |
![]() |
#2 | Link |
Broadcast Encoder
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,723
|
To populate frame properties correctly inside Avisynth, you can use:
Code:
propSet("_ColorRange", 0) If you're encoding the output, make sure to flag it correctly. For instance, if you're re-encoding to H.265 with x265 you can use --range full while if you're using x264 or x262 to encode in H.264 or MPEG-2 you can use --range pc. If you're using FFMpeg to encode to something else (ProRes, DNX, AV1, VP9 etc) you can use -color_range 0 |
![]() |
![]() |
![]() |
#3 | Link |
Registered User
Join Date: Jul 2018
Posts: 1,000
|
AVS do not treat or change the range itself. AVS moves the frames buffers between filters and in/out (using some caching). It is task for each internal filter or external plugin to treat incoming format as having some range mapping (using some hints or internal defaults or some metadata signalling like frame properties of direct user-provided fliter params). So user need to read documentation and understand expected result of each used filter. The range mapping conversion may be done with ConvertBits() with fulls,fulld params.
"How can I make AviSynth treat this file as full range?" Read documentation on the sink filter (used to request data from ffms2() ). "2. How can I make AviSynth generate the output file as full range color?" Make sure final source filter in the script outputs full range. (or the filter to make source for 'return' command if it used). AVS typically not generate file - only serves as a frame source for some sink process. So it is a task of the sink process to treat provided 8 or 16 (or 32) bit samples as having some range mapping. |
![]() |
![]() |
![]() |
#4 | Link | |
Registered User
Join Date: Mar 2011
Posts: 4,781
|
Quote:
If it's full range you can use the V.U.I range argument in the encoder command line and cross your fingers the player pays attention to it. For x264 and full range it's --range pc, but I don't think there's a way to flag the output as full range when opening a script directly with a media player. Levels adjusts the luma and chroma, so from memory the color saturation will change as a result. Sometimes that's a good thing. http://avisynth.nl/index.php/Levels Full to limited range conversion (values for 8 bit video). Levels(0, 1.0, 255, 16, 235, coring=false) Limited to full range. Levels(16, 1.0, 235, 0, 255, coring=false) Alternatively, YLevels only adjust the luma. http://avisynth.nl/index.php/Ylevels Full to limited range. YLevels(0, 1.0, 255, 16, 235) Limited to full range. YLevels(16, 1.0, 235, 0, 255) ColorYUV. http://avisynth.nl/index.php/ColorYUV ColorYUV(Levels="TV->PC") ColorYUV(Levels="PC->TV") Last edited by hello_hello; 24th August 2022 at 21:40. |
|
![]() |
![]() |
![]() |
Tags |
avisynth, full range, limited, utvideo |
Thread Tools | Search this Thread |
Display Modes | |
|
|