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. |
15th January 2022, 12:38 | #1782 | Link | |||||
Registered User
Join Date: Mar 2012
Location: Texas
Posts: 1,666
|
Quote:
Some things I've found: MPEG-2 FAQ Quote:
Quote:
Quote:
Edit: Quote:
Last edited by Reel.Deel; 15th January 2022 at 12:47. |
|||||
15th January 2022, 16:03 | #1783 | Link | |||
Broadcast Encoder
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,904
|
Quote:
Quote:
Quote:
Right! So an XDCAM-50 stream, namely an MPEG-2 stream at 50 Mbit/s 4:2:2 yv16 which is using the Type 0, left, MPEG2 chroma placement, as we all thought! So FFProbe is getting it wrong, so are the indexers ffms2 and LSMASH.dll. Also this seems to confirm the fact that for 4:2:2 the chroma location is always Type 0, left, MPEG-2, especially for MPEG-2 streams like XDCAM-50, right? So we all agree that FFProbe, LWLibavVideoSource and FFVideoSource all report the WRONG chroma location as it shouldn't be top left at all and that's a bug and needs to be fixed, right? This is important 'cause I opened a bug here: https://trac.ffmpeg.org/ticket/9598#comment:5 and if it's fixed in FFProbe / FFMpeg, it will be consequently fixed in LSMASH and ffms2. Last edited by FranceBB; 15th January 2022 at 16:16. |
|||
16th January 2022, 14:05 | #1784 | Link |
Banana User
Join Date: Sep 2008
Posts: 989
|
How VS guys didn't noticed this bug?
No idea what Balling implies on https://trac.ffmpeg.org/ticket/9598#comment:4, in "Figure D.2" I see only one chroma placement, and it's not topleft.
__________________
InpaintDelogo, DoomDelogo, JerkyWEB Fixer, Standalone Faster-Whisper - AI subtitling |
17th January 2022, 08:58 | #1787 | Link | |
Broadcast Encoder
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,904
|
That's odd...
And not just the VapourSynth guys, but also the ffmpeg guys... Quote:
Nah, just like Avisynth is used in professional settings (Crunchyroll, Viewster, Sky, RecordTV, NRK, CentrevilleTV, and plenty others across the world), I'm pretty sure VapourSynth is used somewhere too (although I can't name any 'cause I don't use it). Same goes for FFMpeg/FFProbe, which are both used in professional settings too by some companies. If we think about even just some of the user base here on Doom9, we have almost all the major streaming companies here eheheheheheheh (TL;DR Alex works at Hulu, Ben works at Amazon, Derek works at Disney, me and Livio work at Sky etc). Even you, DTL, I saw you discussing the resizing kernels topic, in particular SincPow2 and not only you had a deep insight about how thing worked and the math behind it and you could translate it into code that was able to run and be integrated into Jean Philippe's plugins, but you were testing the results and in particular aliasing on a professional waveform monitor by Tektronix, similar to the one I have sitting right next to me here at Sky, which is far too expensive for a home user, so... I'm pretty sure you work for some broadcasting company too ehehehehe Now I'm curious, which one is it? :P This is much more likely. |
|
17th January 2022, 14:29 | #1788 | Link |
Registered User
Join Date: Jul 2018
Posts: 1,070
|
" in professional settings too by some companies. "
It is a sad feature of the end of dying civilization - even in the 'pro companies' almost no one understand how the digital visual technologies working. Also the quality control if even exist in some very poor form mostly can not dig in such thing like 'chroma placement'. I see currently only a few fans in the nowdays dying internet network at this planet still trying to keep things in the old software for digital moving pictures processing in some logic and quality. The general idea of the companies: If it digital - it is just perfect and no more any pro-s required to support it. Company simply buy pro-cameras and pro-NLEs and it work without any service but cleaning cooling from dust for decades and changed to next generation of digital cams and NLEs and air servers/switches. Even the worker 'engineer' sitting near the still used 'multi-functional measuring equipment' (Tek/Leader/other) rasterizer mostly can only check max/white level at iris setup and mostly tune picture by image in simple control monitor by its taste - not by numbers at the analyzer. It looks the quality is not required nowdays and I do not see/hear any complain from end-users for poor quality of broadcasting (really sent to the broadcasting company - not just posed somewhere in the internet). So no complains and 'digital equipment' mean no more any engineers really required at production. So if even some broadcasting company will many years produce fulltime air with not left but top-left chroma it mostly no one will see. The actual datastream for nowdays endusers of air broadcasting is significantly degraded by the very low MPEG 4:2:0 bitrate so have many more severe distortions in addition with possible slight chroma-shift from left/top-left chroma treatment in XDCAM sources. The main pro companies activity is about making money - not about making perfect digital moving images content. "which one is it? " Currently most of organizations require to sign some form of NDA with restriction to make public any data that may harm the company commertial activity. So if some possible harmful content is typed in some internet forum - it is no good to make additional signs where from it can be. Unfortunately the degradation in digital moving industry hits not only the small broadcasting companies. Also the more 'perfect' you make the digital content production tools (even freeware ffmpeg) - the less engineers reqiuired and in a few years they physically disappear. Someday the broadcasting owners find that no one left to help with any new issue. At old analog days with servicing broadcast equipment about dayly with real understanding engineers - this helps to production and support some broadcasting engineers pool with ability to understand how things working. Last edited by DTL; 17th January 2022 at 14:44. |
17th January 2022, 16:41 | #1789 | Link | ||||
Broadcast Encoder
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,904
|
Quote:
I've witnessed this myself in some occasions... Quote:
Most of the things that are checked are luma and chroma levels, subtitles alignment for TTX muxed as OP47 in mxf and few other things over here too by some of my colleagues... Unfortunately, algia, (so Livio Aloja), the only other colleague who was lurking here on Doom9 retired and he's not working here any longer... I still miss him 'cause he was one of the few people who actually really cared... There's still Fabio Sonnati here on Doom9 from Sky, but he works in the technology department (i.e they're the ones who get the already encoded and conformed, loudness corrected mezzanines I encode and re-encode them in H.264 or H.265 for the end users), so we don't really work together... Quote:
If we had the EBU investing into things like indexers/decoders and also open source encoders, it would be a game changer. Think about the XAVC intra class 300 and 480 inside x264. If it wasn't for ifb, Bug Master (Anton Mitrofanov), Jean Philippe and in a very little part me, it would have never been implemented, but it could have been implemented if the EBU funded it like it did for intra class 50, 100 and 200 (along with NRK). Speaking of which, if it wasn't for Steinar Apalnes, Kiearn Kunhya and NRK we wouldn't have had any implementation of the intra class at all in the first place. Another thing that is still not very reliable is the FFMpeg mxf muxer and I've been reporting issues which have later been fixed more than once. If it wasn't for the good heart of the BBC developers who made BMX Transwrap and raw2bmx open source and free, God knows what I would have done... And yet, if the EBU funded it, we would have had a good compliant muxer in FFMpeg as well. Quote:
It's almost a paradox, but it's just how things are... I'm glad to have found Doom9 in 2006, I'm glad to have been lurking for years and I'm glad to have learned everything from the right place and the right people, 'cause university alone wouldn't have even remotely been enough. Last edited by FranceBB; 18th January 2022 at 09:23. |
||||
17th January 2022, 17:26 | #1790 | Link |
Registered User
Join Date: Jul 2018
Posts: 1,070
|
"it could have been implemented if the EBU funded it."
You can try to join some 'video' groups of EBU (at least VS-all) or may be VS-EBU if your company is EBU member and post the ideas/questions/suggestions to mailing lists or individual projects in 'workspaces'. May it will helps somehow. Link is https://tech.ebu.ch/groups/video . Send e-mail request to Frans de Jong about joining available workgroups. |
17th January 2022, 19:30 | #1791 | Link | |
Broadcast Encoder
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,904
|
Ok, the FFMpeg guys replied and this is something interesting for us all:
Quote:
So, in a nutshell, 4:2:2 doesn't have a chroma location, it's literally always the same. x262, x264, x265 don't encode any value for the chroma location and what ffprobe does (as well as the indexers) is reporting left for H.264 encoded streams and top left for MPEG-2 encoded streams, but even though the name is different, they're actually exactly the same. In other words, in "Avisynth terms", it's always "left", so I think we have two choices: 1) We change this behavior in indexers so that they're gonna report "unknown" (or "left" eventually) every time we get a 4:2:2 stream 2) We make the internal resizers handle 4:2:2 anyway assuming the old MPEG-2 chroma location every time, no matter what the indexer says instead of throwing an error Ferenc, you're the boss here, the decision is yours. |
|
18th January 2022, 08:44 | #1795 | Link |
Broadcast Encoder
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,904
|
So if you handle let's say 4:2:0 Type 2 as Type 0?
Well, at high enough resolutions like UHD it will be hard to spot, but it will look blurrier and slightly out of the boundaries / shifted towards a side. Sort of, but the higher the resolution, the lower the shift, the less you'll notice. This is a chroma shift happening in an SD material, however I exasperated the shift a bit by 3 points rather than 0.5 to show you the effect: Let's now suppose to have a real life example in which we're wrongly assuming a chroma location and we're performing the 0.5 shift (when we shouldn't): Can you see it? No? Well, you're not alone, it takes a 2000% zoom in to get a proper grasp to what it does: you can see the color tone is different (wrong) on the left compared to the right, so as you can see a real life shift is so subtle that most people will never notice, however it's there and it's wrong. |
18th January 2022, 11:02 | #1796 | Link |
Registered User
Join Date: Mar 2012
Location: Texas
Posts: 1,666
|
The effect of correct and wrong chroma placement can be better seen with a synthetic example:
Here the RGB sample was converted to YUV420 using the "MPEG2" chroma placement. The it was converted back to RGB with the corresponding chroma placement, as shown in the image. Then PointResize 4X since it's easier to see. As FranceBB said, it's hard to spot the wrong chroma placement, especially in live footage. Here's the script I used to create the example: Code:
Blankclip(width=48, height=16, pixel_type="RGB32", color=$FF0000, length=1) #red AddBorders(0,0,0,16,$00FF00) # green AddBorders(0,0,0,16,$0000FF) # blue AddBorders(0,0,0,16,$00FFFF) # cyan AddBorders(0,0,0,16,$FF00FF) # magenta AddBorders(0,0,0,16,$FFFF00) # yellow src = last mask = src.ExtractR().mt_lutspa(mode="absolute", expr="x 32 % 16 < 0 1 ? y 32 % 16 < 0 1 ? + 1 == 0 255 ?") mask2 = src.ExtractR().mt_lutspa(relative=false, expr="x 16 % 0 == y 16 % 0 == | 255 0 ?") grid1 = Overlay(src, src.FlipVertical(), mask=mask) grid2 = Overlay(src, src.FlipVertical(), mask=mask2) StackHorizontal(grid1, grid2) src2 = last.AddBorders(0,0,4,0) ConvertToYV12(ChromaOutPlacement="mpeg2") mpeg1 = last.ConvertToRGB32(ChromaInPlacement="mpeg1") mpeg2 = last.ConvertToRGB32(ChromaInPlacement="mpeg2") topleft = last.ConvertToRGB32(ChromaInPlacement="top_left") Interleave(mpeg1, mpeg2, topleft) StackHorizontal(src2, last) PointResize(width*4, height*4) AddBorders(0,16,0,0) Text("RGB Source") Text("MPEG1 CHROMA LOCATION (WRONG)", x=51*8, first_frame=0, last_frame=0) Text("MPEG2 CHROMA LOCATION (CORRECT)", x=51*8, first_frame=1, last_frame=1) Text("TOPLEFT CHROMA LOCATION (WRONG)", x=51*8, first_frame=2, last_frame=2) AssumeFPS(1,2) |
18th January 2022, 16:54 | #1797 | Link |
Registered User
Join Date: Dec 2005
Location: Sweden
Posts: 703
|
Thanks for the demonstrations. Probably this is happening to my UHD-footage when I import it into avs+ because it has got a slight color shift compared to the original file. Any suggestions on how to correct this? Maybe I need to upload a sample?
Edit: it is XAVC-S 8-bit 4:2:0 I think it is some mpeg4 format. Last edited by anton_foy; 18th January 2022 at 17:04. |
18th January 2022, 23:22 | #1799 | Link |
Broadcast Encoder
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,904
|
XAVC should be interpreted as left type 0, but it's always nice to double check. Feel free to upload a sample. A landscape will do, although someone holding a colour palette would be better.
|
18th January 2022, 23:51 | #1800 | Link | |
Registered User
Join Date: Dec 2005
Location: Sweden
Posts: 703
|
Quote:
Yes I have somewhere a clip with an IT8 chart. Will locate and upload it asap. |
|
|
|