According to https://kdenlive.org/en/project/color-hell-ffmpeg-transcoding-and-preserving... bt 601 pal and bt 601 ntsc are slightly different, I tried to update CinGG's definitions so now she have two distinct 601 colorspaces, but I still can be wrong (esp on kr, kb coeffecients) can anyone test patch 3 and see if it makes any positive difference?
Cursory test results - there is a difference between 601ntsc and 601pal but not sure what it is. My poor eyes do not see a difference but ydiff does as in, for example: 84480 -47651 102207 1.209837 1684 84480 -48210 104558 1.237666 1685 84480 -49645 105447 1.248189 1686 84480 -49654 108066 1.279190 1687 84480 -49677 107739 1.275320 1688 84480 -52184 110310 1.305753 1689 84480 -49910 113198 1.339938 1690 84480 -47662 112548 1.332244 1691 84480 -48872 115812 1.370881 1692 84480 -48576 117170 1.386955 1693 84480 -50510 116738 1.381842 1694 ... 84480 -1750 1766 0.020904 2706 84480 -1767 1795 0.021248 2707 84480 -1569 1593 0.018857 2708 84480 -516 516 0.006108 2709 84480 0 0 0.000000 2710 84480 0 0 0.000000 2711 84480 0 0 0.000000 2712 84480 0 0 0.000000 2713 -168860741 406941285 Manual says: "The ydiff output is debug data with lines that show frame size in bytes, sum of error, and sum of absolute value of error. The frames size is sort of useless, the sum of error shows frame gray point drift and the abs error is the total linear color error between the images. At the very end is the total gray point drift and total absolute error on the last line." On Mon, Jul 12, 2021 at 2:26 PM Andrew Randrianasulu via Cin < [email protected]> wrote:
According to
https://kdenlive.org/en/project/color-hell-ffmpeg-transcoding-and-preserving...
bt 601 pal and bt 601 ntsc are slightly different, I tried to update CinGG's definitions so now she have two distinct 601 colorspaces, but I still can be wrong (esp on kr, kb coeffecients)
can anyone test patch 3 and see if it makes any positive difference?
-- Cin mailing list [email protected] https://lists.cinelerra-gg.org/mailman/listinfo/cin
I'm ashamed to say this, but I always have trouble applying patches. I get the following error: $ patch -p3 < 0003-Attempt-at-differenciating-601-pal-and-ntsc.patch patching file appearanceprefs.h patching file ffmpeg.C Hunk #1 succeeded at 1589 (offset -4 lines). Hunk #2 succeeded at 1719 (offset -4 lines). Hunk #3 succeeded at 2640 (offset -4 lines). Hunk #4 succeeded at 2653 (offset -4 lines). Hunk #5 succeeded at 2896 (offset -12 lines). patching file preferences.C can't find file to patch at input line 116 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |diff --git a/cinelerra-5.1/guicast/bccolors.C b/cinelerra-5.1/guicast/bccolors.C |index e587321d..94dfd20b 100644 |--- a/cinelerra-5.1/guicast/bccolors.C |+++ b/cinelerra-5.1/guicast/bccolors.C -------------------------- File to patch: bccolors.C bccolors.C: No such file or directory Skip this patch? [y] y Skipping patch. 1 out of 1 hunk ignored can't find file to patch at input line 130 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |diff --git a/cinelerra-5.1/guicast/bccolors.h b/cinelerra-5.1/guicast/bccolors.h |index 94be40bc..820b977d 100644 |--- a/cinelerra-5.1/guicast/bccolors.h |+++ b/cinelerra-5.1/guicast/bccolors.h -------------------------- File to patch: /cinelerra-5.1/guicast/bccolors.h /cinelerra-5.1/guicast/bccolors.h: No such file or directory Skip this patch? [y] y Skipping patch. 1 out of 1 hunk ignored can't find file to patch at input line 148 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |diff --git a/cinelerra-5.1/guicast/bccolors.inc b/cinelerra-5.1/guicast/bccolors.inc |index 010faca5..58afbaee 100644 |--- a/cinelerra-5.1/guicast/bccolors.inc |+++ b/cinelerra-5.1/guicast/bccolors.inc -------------------------- File to patch: ...
On Tuesday, July 13, 2021, Andrea paz via Cin <[email protected]> wrote:
I'm ashamed to say this, but I always have trouble applying patches. I get the following error:
try patch - p1 from directory level above? it seems to find files in current dir ( cinelerra/) correctly but does not look up one level (i think this is logical behavior)
$ patch -p3 < 0003-Attempt-at-differenciating-601-pal-and-ntsc.patch
patching file appearanceprefs.h patching file ffmpeg.C Hunk #1 succeeded at 1589 (offset -4 lines). Hunk #2 succeeded at 1719 (offset -4 lines). Hunk #3 succeeded at 2640 (offset -4 lines). Hunk #4 succeeded at 2653 (offset -4 lines). Hunk #5 succeeded at 2896 (offset -12 lines). patching file preferences.C can't find file to patch at input line 116 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |diff --git a/cinelerra-5.1/guicast/bccolors.C b/cinelerra-5.1/guicast/bccolors.C |index e587321d..94dfd20b 100644 |--- a/cinelerra-5.1/guicast/bccolors.C |+++ b/cinelerra-5.1/guicast/bccolors.C -------------------------- File to patch: bccolors.C bccolors.C: No such file or directory Skip this patch? [y] y Skipping patch. 1 out of 1 hunk ignored can't find file to patch at input line 130 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |diff --git a/cinelerra-5.1/guicast/bccolors.h b/cinelerra-5.1/guicast/bccolors.h |index 94be40bc..820b977d 100644 |--- a/cinelerra-5.1/guicast/bccolors.h |+++ b/cinelerra-5.1/guicast/bccolors.h -------------------------- File to patch: /cinelerra-5.1/guicast/bccolors.h /cinelerra-5.1/guicast/bccolors.h: No such file or directory Skip this patch? [y] y Skipping patch. 1 out of 1 hunk ignored can't find file to patch at input line 148 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |diff --git a/cinelerra-5.1/guicast/bccolors.inc b/cinelerra-5.1/guicast/bccolors.inc |index 010faca5..58afbaee 100644 |--- a/cinelerra-5.1/guicast/bccolors.inc |+++ b/cinelerra-5.1/guicast/bccolors.inc -------------------------- File to patch: ... -- Cin mailing list [email protected] https://lists.cinelerra-gg.org/mailman/listinfo/cin
Finally I managed to patch! On Phyllis' suggestion I entered the absolute path of the files to patch every time it didn't find them. Below is the test I did. I downloaded the app mentioned from the link and created a video on smartphone; as mentioned in the link the video produced is: YUV, NTSC,color range:tv; primaries=BT 601 PAL; Transfer=BT 601 and Matrix:BT 601 (a horror in this day and age where broadcast worldwide uses HD and rec 709). In CinGG without patching you have a slight change in brightness going from 601 to 709 and vice versa (correct is 601!); you have a bigger change going from Mpeg to Jpeg (correct is mpeg!). Applying the patch and importing the same video as before you have some difference between BT601 PAL and BT601 NTSC (correct is BT601 NTSC). Both are different from BT 709. Thanks Andrew, you did a great job for me! In CinGG, to make a transcode there is the excellent ColorSpace plugin that works just for these changes of color spaces. I once asked if it was possible to integrate it into the "Transcode" function so that it would work for all project sources and not just the edits to which the plugin applies. But I think it's a complicated job....
On Tuesday, July 13, 2021, Andrea paz <[email protected]> wrote:
Finally I managed to patch! On Phyllis' suggestion I entered the absolute path of the files to patch every time it didn't find them. Below is the test I did.
I downloaded the app mentioned from the link and created a video on smartphone; as mentioned in the link the video produced is: YUV, NTSC,color range:tv; primaries=BT 601 PAL; Transfer=BT 601 and Matrix:BT 601 (a horror in this day and age where broadcast worldwide uses HD and rec 709). In CinGG without patching you have a slight change in brightness going from 601 to 709 and vice versa (correct is 601!); you have a bigger change going from Mpeg to Jpeg (correct is mpeg!). Applying the patch and importing the same video as before you have some difference between BT601 PAL and BT601 NTSC (correct is BT601 NTSC). Both are different from BT 709. Thanks Andrew, you did a great job for me!
one concern is... while input video claims itself to use bt 601 pal primaries - you get correct result wuth bt 601 ntsc? may be it was tagged wrong, or ffmpeg flipped it?
In CinGG, to make a transcode there is the excellent ColorSpace plugin that works just for these changes of color spaces. I once asked if it was possible to integrate it into the "Transcode" function so that it would work for all project sources and not just the edits to which the plugin applies. But I think it's a complicated job....
code is already written, even with OpenGL accelerated preview... so may be it can be reused, or just tell swscale (because we mostly use ffmpeg here) to do some colorspace changes for us...
Not so sure about that after running more tests. Using 601Pal, mediainfo reports BT.601. Using 601Ntsc, medinao reports BT.709 !! As always, have to make sure old projects still work. On Mon, Jul 12, 2021 at 2:26 PM Andrew Randrianasulu via Cin < [email protected]> wrote:
According to
https://kdenlive.org/en/project/color-hell-ffmpeg-transcoding-and-preserving...
bt 601 pal and bt 601 ntsc are slightly different, I tried to update CinGG's definitions so now she have two distinct 601 colorspaces, but I still can be wrong (esp on kr, kb coeffecients)
can anyone test patch 3 and see if it makes any positive difference?
-- Cin mailing list [email protected] https://lists.cinelerra-gg.org/mailman/listinfo/cin
On Tuesday, July 13, 2021, Phyllis Smith via Cin <[email protected]> wrote:
Not so sure about that after running more tests. Using 601Pal, mediainfo reports BT.601. Using 601Ntsc, medinao reports BT.709 !! As always, have to make sure old projects still work.
its called color hell for this exact reason) may be mediainfo a bit wrong (at least ver. you used - shoukd be recent on Fedora, but small fixes like this can go in anytime...) see confusing code at (should be recent enough from 2020) https://sourceforge.net/p/mediainfo/discussion/297610/thread/0b6d2fd38f/?lim... ===== ha. //--------------------------------------------------------------------------- extern const char* Mpegv_colour_primaries(int8u colour_primaries) { switch (colour_primaries) { case 1 : return "BT.709"; case 4 : return "BT.470 System M"; case 5 : return "BT.601 PAL"; case 6 : return "BT.601 NTSC"; case 7 : return "SMPTE 240M"; //Same as BT.601 NTSC case 8 : return "Generic film"; case 9 : return "BT.2020"; //Added in HEVC case 10 : return "XYZ"; //Added in HEVC 2014 case 11 : return "DCI P3"; //Added in HEVC 2016 case 12 : return "Display P3"; //Added in HEVC 2016 case 22 : return "EBU Tech 3213"; //Added in HEVC 2016 default : return ""; } } //--------------------------------------------------------------------------- extern const char* Mpegv_transfer_characteristics(int8u transfer_characteristics) { switch (transfer_characteristics) { case 1 : return "BT.709"; //Same as BT.601 case 4 : return "BT.470 System M"; case 5 : return "BT.470 System B/G"; case 6 : return "BT.601"; case 7 : return "SMPTE 240M"; case 8 : return "Linear"; case 9 : return "Logarithmic (100:1)"; //Added in MPEG-4 Visual case 10 : return "Logarithmic (316.22777:1)"; //Added in MPEG-4 Visual case 11 : return "xvYCC"; //Added in AVC case 12 : return "BT.1361"; //Added in AVC case 13 : return "sRGB/sYCC"; //Added in HEVC case 14 : return "BT.2020 (10-bit)"; //Same a BT.601 //Added in HEVC, 10/12-bit difference is in ISO 23001-8 case 15 : return "BT.2020 (12-bit)"; //Same a BT.601 //Added in HEVC, 10/12-bit difference is in ISO 23001-8 case 16 : return "PQ"; //Added in HEVC 2015 case 17 : return "SMPTE 428M"; //Added in HEVC 2015 case 18 : return "HLG"; //Added in HEVC 2016 default : return ""; } } //--------------------------------------------------------------------------- extern const char* Mpegv_matrix_coefficients(int8u matrix_coefficients) { switch (matrix_coefficients) { case 0 : return "Identity"; //Added in AVC case 1 : return "BT.709"; case 4 : return "FCC 73.682"; case 5 : return "BT.470 System B/G"; case 6 : return "BT.601"; //Same as BT.470 System B/G case 7 : return "SMPTE 240M"; case 8 : return "YCgCo"; //Added in AVC case 9 : return "BT.2020 non-constant"; //Added in HEVC case 10 : return "BT.2020 constant"; //Added in HEVC case 11 : return "Y'D'zD'x"; //Added in HEVC 2016 case 12 : return "Chromaticity-derived non-constant"; //Added in HEVC 2016 case 13 : return "Chromaticity-derived constant"; //Added in HEVC 2016 case 14 : return "ICtCp"; //Added in HEVC 2016 default : return ""; } } ===== note _transfer characteristics_ #1 said to be the same for bt. 709 and #6 bt. 601! (in comment) can you post full mediainfo output for input video, and three other videos: unmodded Cin, modded and set to BT601 NTSC, set to BT601 pal?
On Mon, Jul 12, 2021 at 2:26 PM Andrew Randrianasulu via Cin < [email protected]> wrote:
According to
https://kdenlive.org/en/project/color-hell-ffmpeg- transcoding-and-preserving-bt-601/
bt 601 pal and bt 601 ntsc are slightly different, I tried to update CinGG's definitions so now she have two distinct 601 colorspaces, but I still can be wrong (esp on kr, kb coeffecients)
can anyone test patch 3 and see if it makes any positive difference?
-- Cin mailing list [email protected] https://lists.cinelerra-gg.org/mailman/listinfo/cin
@Andrew In my opinion the BT 601 PAL tag (mediainfo) is wrong, in fact the file is described as YUV, NTSC 8-bit, and these are data taken directly from the file, while the primaries is a metadata that can also be wrong. I tried ffprobe and it confirms smtpe170m i.e. NTSC. @Phyllis Test with ffprobe. Mediainfo is not 100% accurate!
participants (3)
-
Andrea paz -
Andrew Randrianasulu -
Phyllis Smith