I put up a new version. In the previous ones, the used coefficients were slightly wrong. Although the difference is not noticable in practice
btw, I corrected the naming convention. MPEG-2 coefficients are called Rec.709 and MPEG-1 coefficients Rec.601. Thus
ColorMatrix(clip, mode="Rec.709->Rec.601") (default)
ColorMatrix(clip, mode="Rec.601->Rec.709")
I advice you to use the internal
ConvertToRGB(clip, matrix="Rec.709")
instead of
ColorMatrix(clip, rgb=true).
Output is identical (thx IanB), but the former is faster.