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.

 

Go Back   Doom9's Forum > Announcements and Chat > General Discussion

Reply
 
Thread Tools Search this Thread Display Modes
Old 2nd June 2022, 20:09   #1  |  Link
knuxyl
Registered User
 
Join Date: May 2022
Posts: 2
NTSC DVD with BT470BG colorspace?

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!
knuxyl is offline   Reply With Quote
Old 2nd June 2022, 20:49   #2  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,883
I live in PAL land and PAL DVDs have

Quote:
-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.

Quote:
Originally Posted by knuxyl View Post
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:

Quote:
-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).
FranceBB is offline   Reply With Quote
Old 2nd June 2022, 20:54   #3  |  Link
knuxyl
Registered User
 
Join Date: May 2022
Posts: 2
@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.

Code:
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.

Last edited by knuxyl; 2nd June 2022 at 21:37.
knuxyl is offline   Reply With Quote
Old 10th June 2022, 02:47   #4  |  Link
Balling
Registered User
 
Join Date: Feb 2020
Posts: 539
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.
Balling is offline   Reply With Quote
Old 10th June 2022, 12:32   #5  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,883
Quote:
Originally Posted by Balling View Post
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:

Quote:
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:

Quote:
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:

Quote:
--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:


FranceBB is offline   Reply With Quote
Old 17th June 2022, 15:53   #6  |  Link
Balling
Registered User
 
Join Date: Feb 2020
Posts: 539
Quote:
Originally Posted by FranceBB View Post
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

Last edited by Balling; 17th June 2022 at 16:06.
Balling is offline   Reply With Quote
Reply

Tags
bt470g, bt601, colorspace, ntsc, primaries

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:07.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.