So I'm trying to upload a 2 minute video from DVD to youtube, but youtube makes the video way too dark, as it doesn't handle the colorspace of my DVD (BT601 + BT470) correctly.
How to properly encode the video with:
a) convert colorspace so that youtube keeps the brightness the same
b) crop the borders
c) upscale to 4K, otherwise youtube uses too low bitrate and the quality suffers a lot
d) deinterlace (bob)
with a single ffmpeg command if possible.
Should be easier to do steps b+c with avisynth though.
1 second clip (remuxed to mkv) for testing: https://file.kiwi/be4011dc#xFN_FfS3qeU-0MhilMSv3g
If I convert to BT709 or BT601 with Handbrake the video brightness is much better after uploaded to youtube, but still a bit darker than the original (e.g. if BT.601 EBU (=PAL) is selected in Handbrake, mediainfo reports: Color primaries : BT.601 PAL Transfer characteristics : BT.709 Matrix coefficients : BT.601).
I also tried with Handbrake colorspace custom format with the following valuers, which gets the correct brightness in youtube:
primaries="bt601-6-525":transfer="bt709":matrix="bt601-6-525"
For the resulting file Mediainfo only reports: Transfer characteristics : BT.709" and omits color primaries and matrix coefficients.
The problem with this custom colorspace is that it doesn't work when upscaling is enabled. For some reason it also shifts the image a few pixels rightwards.
Mediainfo for the original clip (remux from DVD):
Mediainfo:
Code:General Unique ID : 223809982403398840198480831573644245518 (0xA8603C150F55CC35DF691D67C2337A0E) Complete name : clip.mkv Format : Matroska Format version : Version 4 File size : 934 KiB Duration : 1 s 344 ms Overall bit rate mode : Constant Overall bit rate : 5 693 kb/s Frame rate : 51 119.792 FPS Writing application : Lavf62.13.102 Writing library : Lavf62.13.102 ErrorDetectionType : Per level 1 Video ID : 1 ID in the original source m : 224 (0xE0) Format : MPEG Video Format version : Version 2 Format profile : Main@Main Format settings : BVOP Format settings, BVOP : Yes Format settings, Matrix : Default Format settings, picture st : Frame Codec ID : V_MPEG2 Codec ID/Info : MPEG 1 or 2 Video Duration : 1 s 344 ms Bit rate mode : Constant Bit rate : 5 600 kb/s Width : 720 pixels Height : 576 pixels Display aspect ratio : 4:3 Frame rate mode : Variable Frame rate : 51 119.792 FPS Original frame rate : 25.000 FPS Standard : PAL Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Scan type : Interlaced Scan type, store method : Separated fields (2 fields per block) Scan order : Top Field First Compression mode : Lossy Bits/(Pixel*Frame) : 0.000 Time code of first frame : 00:38:38:01 Time code source : Group of pictures header Stream size : 1.79 GiB Language : English Default : No Forced : No Color range : Limited Color primaries : BT.601 PAL Transfer characteristics : BT.470 System B/G Matrix coefficients : BT.470 System B/G Original source medium : DVD-Video Audio ID : 2 ID in the original source m : 189 (0xBD)128 (0x80) Format : AC-3 Format/Info : Audio Coding 3 Commercial name : Dolby Digital Codec ID : A_AC3 Duration : 1 s 248 ms Bit rate mode : Constant Bit rate : 192 kb/s Channel(s) : 2 channels Channel layout : L R Sampling rate : 48.0 kHz Frame rate : 31.250 FPS (1536 SPF) Bit depth : 32 bits Compression mode : Lossy Delay relative to video : -24 ms Stream size : 62.9 MiB Title : Stereo Language : Finnish Service kind : Complete Main Default : Yes Forced : No Original source medium : DVD-Video Dialog Normalization : -27 dB compr : 1.02 dB dynrng : 0.78 dB dialnorm_Average : -27 dB dialnorm_Minimum : -27 dB dialnorm_Maximum : -27 dB Menu 00:00:00.000 : Chapter 16 00:01:53.940 : Chapter 17 00:08:10.940 : Chapter 18
+ Reply to Thread
Results 1 to 16 of 16
-
Last edited by Danic; 2nd May 2026 at 04:39.
-
OK I solved this by:
first encode the original file with Handbrake with:
deinterlace (yadif, bob)
colourspace custom: primaries="bt601-6-525":transfer="bt709":matrix="bt601-6-525"
x264 50fps RF 16, encoder profile high
cropping and upscaling disabled
then a second run with:
autocropping and upscaling to 4K enabled, original framerate, x264 RF16, encoder profile high, encoder level 5.2
-> no visible quality loss when uploaded to youtube compared to the original file and has the original gamma/brightness
Any suggestions welcome if this isn't the best way to upload to youtube
Mediainfo of the final file which was uploaded to youtube:
Code:General Complete name : final.mp4 Format : MPEG-4 Format profile : Base Media / Version 2 Codec ID : mp42 (mp42/dby1/iso2/avc1/mp41) File size : 631 MiB Duration : 2 min 1 s Overall bit rate : 43.4 Mb/s Frame rate : 48.947 FPS Encoded date : 2026-05-02 10:41:17 UTC Tagged date : 2026-05-02 10:41:17 UTC Writing application : HandBrake 1.11.1 2026032200 Video ID : 1 Format : AVC Format/Info : Advanced Video Codec Format profile : High@L5.2 Format settings : CABAC / 5 Ref Frames Format settings, CABAC : Yes Format settings, Reference : 5 frames Codec ID : avc1 Codec ID/Info : Advanced Video Coding Duration : 2 min 1 s Source duration : 2 min 1 s Bit rate : 43.2 Mb/s Width : 3 840 pixels Height : 2 160 pixels Display aspect ratio : 4:3 Original display aspect rat : 4:3 Frame rate mode : Variable Frame rate : 48.947 FPS Minimum frame rate : 23.395 FPS Maximum frame rate : 50.000 FPS Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Scan type : Progressive Bits/(Pixel*Frame) : 0.106 Stream size : 628 MiB (100%) Source stream size : 628 MiB (100%) Writing library : x264 core 165 r3222 b35605ac Encoding settings : cabac=1 / ref=5 / deblock=1:0:0 / analyse=0x3:0x133 / me=umh / subme=10 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=24 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=24 / lookahead_threads=4 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=8 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=490 / keyint_min=49 / scenecut=40 / intra_refresh=0 / rc_lookahead=60 / rc=crf / mbtree=1 / crf=16.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / vbv_maxrate=300000 / vbv_bufsize=300000 / crf_max=0.0 / nal_hrd=none / filler=0 / ip_ratio=1.40 / aq=1:1.00 Encoded date : 2026-05-02 10:41:17 UTC Tagged date : 2026-05-02 10:41:17 UTC Color range : Limited Color primaries : BT.601 NTSC Transfer characteristics : BT.709 Matrix coefficients : BT.601 mdhd_Duration : 121860 Codec configuration box : avcC Audio ID : 2 Format : AC-3 Format/Info : Audio Coding 3 Commercial name : Dolby Digital Codec ID : ac-3 Duration : 2 min 1 s Bit rate mode : Constant Bit rate : 192 kb/s Channel(s) : 2 channels Channel layout : L R Sampling rate : 48.0 kHz Frame rate : 31.250 FPS (1536 SPF) Compression mode : Lossy Stream size : 2.79 MiB (0%) Language : Finnish Service kind : Complete Main Default : Yes Alternate group : 1 Encoded date : 2026-05-02 10:41:17 UTC Tagged date : 2026-05-02 10:41:17 UTC Dialog Normalization : -27 dB compr : -2.14 dB dynrng : 0.78 dB dialnorm_Average : -27 dB dialnorm_Minimum : -27 dB dialnorm_Maximum : -27 dB
Last edited by Danic; 2nd May 2026 at 05:55.
-
This what I tried:
AVS
QTGMC
SplineResize 3840x2880
That AVS Into VDub2
CamcorderColorDenoise for stamps
Crop in 4:3 ratio
Resize 3840x2880
X264 8 bit Pixel format Colour Space 709
and it came out like this (A tad brighter than the original):
https://www.youtube.com/watch?v=m3ggZRb-RAI -
Thank you, that's great, it's sharper than my encode with Handbrake:
https://twinlens.app/compare?share=69359ab24615
You crop a little bit too much though.
Can you share the avs script and settings for vdub2? I don't see CamcorderColorDenoise in vdub2. -
Here you go:
EdiThreads = 1/2 the number of cores shown in Task manager>Performance tabCode:v=LWLibavVideoSource("H:\Videohelp\Danic\clip.mpg") a=LWLibavAudioSource("H:\Videohelp\Danic\clip.mpg") AudioDub(v,a) ConvertToYV12(interlaced=true) AssumeTFF() QTGMC(preset="Fast", EdiThreads=8) Spline64Resize(3840, 2880) Prefetch(24)
PreFetch=Number of logical processors you have (may need to be reduced if you have issues)
In VDub2:
Open the AVS
Video filters:
-I add CamcorderColorDenoise at maximum
-Crop as desired (I am a renowned cropaholic
)
(-Resize if desired after cropping)
-Audio Menu: Full Processing mode (for AAC encoding)
"Save Video..."
Save as type MP4 Faststart
Video Compression x264 8bit
Configure: Rate control as desired
Pixel Format Color Space Rec 709
Audio Compression FFMpeg AAC
Configure as desired
Save. -
-
-
-
-
nnedi3_rpow2, https://github.com/Alexkral/AviSynthAiUpscale
-
Fair enough. I can't see how I can use nnedi3 to achieve a frame size of that. An rfactor of 4 gives a frame 2304 high, not 2160.Originally Posted by rgr
Similar Threads
-
Fixing interlacing(?) in Youtube video
By corecore in forum Newbie / General discussionsReplies: 0Last Post: 6th Jul 2024, 21:32 -
Fixing broken sub menu options, DVD.
By Sirrah in forum SubtitleReplies: 2Last Post: 5th Aug 2023, 13:43 -
How to colorspace conversion Vegas-->Avisynth?
By Amaze in forum Video ConversionReplies: 13Last Post: 29th May 2023, 09:51 -
Extract Y/C in YUV Colorspace in AviSynth?
By musmodtos in forum Newbie / General discussionsReplies: 7Last Post: 26th May 2023, 18:47 -
Avidemux 2.8.0 colorspace
By tugatomsk in forum Video ConversionReplies: 5Last Post: 5th Apr 2022, 16:15


Quote
