View Full Version : NTSC DVD with BT470BG colorspace?
knuxyl
2nd June 2022, 20:09
I have a lot of anime DVD series I am backing up.
2 of them are flagged as BT601 (smpte170m), Dragon Ball Z and Inuyasha.
The rest have no flags and DGIndex reports them as BT470BG. Is this accurate? All of my DVDs are NTSC.
I am putting these into a MKV container and would like to properly flag the trace, space, and primaries but I'm not sure how DVDs handled color space and such.
Could NTSC DVD players display PAL colorspace, and vice versa? How should I flag these BT470BG files?
Thanks!
FranceBB
2nd June 2022, 20:49
I live in PAL land and PAL DVDs have
-color_primaries bt470bg -color_trc gamma28 -colorspace bt470bg
however if the distributor didn't put the info in and the DVDs are NTSC, I would put the NTSC matrix, regardless of what DGIndex says.
Could NTSC DVD players display PAL colorspace, and vice versa? How should I flag these BT470BG files?
Technically yes but in practice no.
Just flag NTSC DVDs with:
-color_primaries smpte170m -color_trc smpte170m -colorspace smpte170m
and you're gonna be fine.
Keep in mind that even if they have no flags, players will assume it from the resolution, so for 720x480 they'll assume smpte170m (BT601 NTSC) and for 720x576 they'll assume bt470bg (BT601 PAL). ;)
knuxyl
2nd June 2022, 20:54
@FranceBB
Well the automatic detection from a player does not apply for me because I'm converting to progressive and with a resolution of 640x480 with no flags VLC seems to apply some arbitrary colorspace, definitely not BT601. I'm assuming it's using BT470BG. That led me to a lot of frustration and opening a bug report on VLC.
And I don't use ffmpeg to flag the MKV file because ffmpeg outputs a Matroska V2 file and those flags are not compliant with that spec, so when ran against mkclean to optimize the file (cues in front), the flags are dropped. I use this for smpte170m and then a mkclean. I believe mkvmerge creates a V4 MKV by default. I also had to compile mkclean from source to change the doc_read_type to V2 for the V4 matroska (--doctype 6) because nothing seems to support V4 doc_read_type.
mkvmerge.exe --colour-range 0:1 --colour-transfer-characteristics 0:6 --colour-primaries 0:6 --colour-matrix-coefficients 0:6 -o OUTPUT INPUT
Thank you for the clarification on the colors. I'll just flag all of them as BT601/smpte170m.
Balling
10th June 2022, 02:47
All of DVD was using BT.601 matrix. What you are talking about is the two other: transfer and primaries. The transfer is the same as BT.709. Primaries for digital video can be one of the two in BT.601 spec: SMPTE-C and PAL, last one is the same as in analog video spec BT.470 BG. BT.470 System M did change to SMPTE-C though, it was chromatically adapted from Illuminant C in System M to D65.
FranceBB
10th June 2022, 12:32
All of DVD was using BT.601 matrix. What you are talking about is the two other: transfer and primaries.
Although this is technically true, it isn't in practice.
I know what you mean: BT601 is BT601, no matter what, and then you have the correspondent transfer characteristics and primaries that change according to whether it's the PAL version or the NTSC version, BUT the "sad" thing is that even the matrix has different definition. What I mean is that even if the coefficients are the same, you can't specify BT601 as a matrix when you encode 'cause you have the correspondent entries in the header of the container and in the video track and they MUST be specific to PAL or NTSC. TL;DR there's isn't one BT601 that fits them all.
I know you like FFMpeg and you spend a lot of time lurking in the FFMpeg bugtracker 'cause I saw you there several times and even in FFMpeg, for PAL you have to use:
ffmpeg.exe -i "A:\MEDIA\temp\Test.avs" -an -pix_fmt yuv420p -vcodec mpeg2video -s 720:576 -aspect 16:9 -vf setfield=tff -flags +ildct+ilme+cgop -b_strategy 0 -mpv_flags +strict_gop -r 25 -sc_threshold 1000000000 -b:v 12000k -minrate 12000k -maxrate 12000k -g 15 -bf 2 -profile:v 4 -level:v 8 -color_range 1 -color_primaries bt470bg -color_trc gamma28 -colorspace bt470bg -map_metadata -1 -y "raw_video.mxf"
and for NTSC you have to use:
ffmpeg.exe -i "A:\MEDIA\temp\Test.avs" -an -pix_fmt yuv420p -vcodec mpeg2video -s 720:480 -aspect 16:9 -vf setfield=tff -flags +ildct+ilme+cgop -b_strategy 0 -mpv_flags +strict_gop -r 29.970 -sc_threshold 1000000000 -b:v 12000k -minrate 12000k -maxrate 12000k -g 15 -bf 2 -profile:v 4 -level:v 8 -color_range 1 -color_primaries smpte170m -color_trc smpte170m -colorspace smpte170m -map_metadata -1 -y "raw_video.mxf"
The same is true for literally anything else like x262, x264 etc which need this for PAL:
--colormatrix bt470bg --transfer bt470bg --colorprim bt470bg
but yeah from a mathematical point of view, what we're interested in are the primaries, in particular you can find the PAL ones and the NTSC ones below which - as you can see - are really close to one another:
https://i.imgur.com/NeYSIT8.png
https://i.imgur.com/c0Aj8Yu.png
Balling
17th June 2022, 15:53
there's isn't one BT601 that fits them all.
This is false, MatrixCoefficients 5 is functionally the same as 6. See H.273.
As for the primaries, I dunno what your graph is trying to prove. Use this instead (you need to put PAL into custom):
http://drag.wootest.net/misc/palgen.html
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.