Need help to convert this example, 65mb only if you guys want to try before giving me tips, its on google drive ( tiny.cc/msxr6y ) to h264 without messing with colors and losing quality, this is the original
[Attachment 49062 - Click to enlarge] , this is when converted
[Attachment 49064 - Click to enlarge] , see the difference? i did not change a thing, help me with this pls.
+ Reply to Thread
Results 1 to 19 of 19
-
-
It's HDR video. If you want to convert to non-HDR AVC, then you need to do tone mapping.
-
-
Tell us all details of your current processing chain and tell us your target format. Thank you.
-
-
Well, at least can you say if you use Avisynth or Vapoursynth scripts? And if not, then what? We could answer better.
-
Oy. I think there is a professional version that can do HDR to SDR, but I don't know anything about it. Good luck!
Or maybe Vegas can open Avisynth scripts? Or maybe use a lossless intermediate. I can give you Avisynth/Vapoursynth solutions up the wazoo.
You can apply a 3D cube using DaVinci resolve, etc.Last edited by veresov; 15th May 2019 at 22:25.
-
vegas cant. but the main issue for me here is the color changing, if i could find a way to change the vid to h264 without messing with the colors the rest is easy fix, could you get the vid i posted the link and use what you know to see if it works, i mean if the colors dont change? its only 65mb here is the short link ( tiny.cc/msxr6y ) or here the full ( https://drive.google.com/drive/folders/1yHVWbxHde5Tq3WKTOcxtjZj9866sUGFp ). thank you
-
Frame serve your video using an appropriate source filter under Avisynth/Vapoursynth (I use DGSource).
Apply a HDR->SDR filter in your Avisynth/Vapoursynth script (I use DGHDRtoSDR).
Encode the resulting raw stream to H.264 SDR (any decent encoder app such as mulder's great Simple Launcher).
Multiplex the encoded video into MKV (mkvtoolnix).
Now open the new MKV in Vegas.
Voila!Last edited by veresov; 15th May 2019 at 22:53.
-
-
Sounds good. You definitely need Avisynth+. Then if you have an nVidia card, use DGDecNV; otherwise FFMS2, LSmash, etc. DGDecNV will always be fastest if you have a decent nVidia GPU.
Or you can use Vapoursynth in the same way. Different strokes for different folks.
Onward and upward!Last edited by veresov; 15th May 2019 at 23:12.
-
Try opering the HEVC source file in Mediainfo. If it has 10 bit colour and you're encoding to 8 bt colour AVC the colous are going to look washed out. I'm pretty sure you can encode AVC with 10 bit colour but I haven't done it and I suspect you'd need to use a high profile.
-
How do you go from high to low without losing height? You cannot. And you cannot go from HDR to SDR without losing quality and colors.
But tone mapping process is meant to give you perceptual equivalent in SDR of what you had in HDR, if you do it right, so hopefully you should still be happy with the end result.
I don't know of any tonemapping video process that is cheap, though. Ffmpeg and other tools can do generic & automated conversions, but those could very likely not be appropriate for your material (there are at least 6 or 8 tonemapping methods available so far, IIRC).
Scott -
I experimented with it; I just installed avisynth+ 32 bit and 64 bit, the tonemap and avsresize tools provide
both versions, so for this quick and dirty I got lazy and used the 32 bit system.
I used DG's sample script as is, didn't try hable or adjust the parameters
Here's a tonemap'd encode of the HEVC HDR file which is itself a re-encode of the untouched blu-ray sample, about 250 MB -
I gave it a shot in Vapoursynth, using exactly this script from user age. He tries it for a while to get right colors so I gave it a shot.
Conversion to RGBS -floating point using matrix 2020ncl, transfer st2084, tonemapping and back to YUV BT709
Not sure if colors are correct, this is what came out, its downconverted to 1280x534 , just to see colors -
Or using again Vapoursynth and tonemap.dll , description here.
It is much faster because of dll, had to restrict cache in Vapoursynth , I do not have much RAM and it took some. Exposure could be tuned up, I set it to 10.0, because default value gave dark picture.
Also including the whole Vapoursynth script that also produces final mp4 file.
Code:input=r'C:/hevc HDR to h264 help.mkv' import vapoursynth as vs from vapoursynth import core import subprocess clip = core.ffms2.Source(input) source_peak=1000 matrix_in_s="2020ncl" transfer_in_s="st2084" core.max_cache_size=800 clip=core.resize.Bicubic(clip, format=vs.RGBS, filter_param_a=0, filter_param_b=0.75, matrix_in_s=matrix_in_s,chromaloc_in_s="center",chromaloc_s="center", range_in_s="limited",dither_type="none") clip=core.resize.Bilinear(clip, format=vs.RGBS, transfer_in_s=transfer_in_s, transfer_s="linear",dither_type="none", nominal_luminance=source_peak) clip = core.tonemap.Hable(clip , exposure=10.0, a=0.15, b=0.50, c=0.10, d=0.20, e=0.02, f=0.30, w=11.2) clip=core.resize.Bilinear(clip, format=vs.RGBS, primaries_in_s="2020", primaries_s="709",dither_type="none") clip=core.resize.Bilinear(clip, format=vs.RGBS, transfer_in_s="linear", transfer_s="709",dither_type="none") clip=core.resize.Bicubic(clip, format=vs.YUV420P8,matrix_s="709", filter_param_a=0, filter_param_b=0.75, range_in_s="full",range_s="limited", chromaloc_in_s="center", chromaloc_s="center",dither_type="none") clip= core.resize.Spline36(clip, 1280, 534) import shutil import os output_264 = r'C:/Target/temp.264' output_mp4 = r'C:/Target/HDR to SDR tonemap.mp4' #on linux x264 or mp4box should be in system path, on windows add those to path or put in current directory fot shutil to find it x264 = shutil.which('x264') #mp4box = shutil.which('mp4box') mp4box = r'C:\tools\MP4box-64bit\mp4box.exe' x264_cmd = [x264, '--frames', f'{len(clip)}', '--input-csp', 'i420', '--demuxer', 'raw', '--input-depth', '8', '--input-res', f'{clip.width}x{clip.height}', '--fps', f'{clip.fps_num}/{clip.fps_den}', '--crf', '18', '--colorprim', 'bt709', '--transfer', 'bt709', '--colormatrix', 'bt709', '--output', output_264, '-'] #input process = subprocess.Popen(x264_cmd, stdin=subprocess.PIPE) clip.output(process.stdin) process.communicate() #mp4box does not support stdin mp4box_cmd = [mp4box, '-add' , output_264+':fps=23.976' , '-new', output_mp4] process = subprocess.Popen(mp4box_cmd, stderr=subprocess.PIPE) process.communicate() if os.path.exists(output_264): os.remove(output_264) clip.set_output() #perhaps this line for VSEdit to not throw error
Last edited by _Al_; 18th May 2019 at 23:54.
Similar Threads
-
Convert HEVC to H264 Blu Ray
By luciofulci in forum Video ConversionReplies: 3Last Post: 31st May 2019, 12:14 -
HEVC or H264 GPU vs CPU Another time !!!
By gringito38 in forum Video ConversionReplies: 2Last Post: 23rd Feb 2018, 05:28 -
HEVC and H264 bitrate/quality equivalency
By philvideofilm in forum Video ConversionReplies: 15Last Post: 29th Sep 2017, 18:41 -
Avidemux Nvidia H264 / HEVC settings
By frenksisco in forum Video ConversionReplies: 2Last Post: 19th Dec 2016, 05:51 -
x264 messing with colors
By Colek in forum Video ConversionReplies: 14Last Post: 26th Nov 2015, 09:03