CasparCG / server

CasparCG Server is a Windows and Linux software used to play out professional graphics, audio and video to multiple outputs. It has been in 24/7 broadcast production since 2006. Ready-to-use downloads are available under the Releases tab https://casparcg.com.
GNU General Public License v3.0
905 stars 268 forks source link

Add support for higher precision pixel formats #1528

Closed niklaspandersson closed 4 months ago

niklaspandersson commented 6 months ago

This branch introduces:

Only minimal testing have been performed on windows.

niklaspandersson commented 5 months ago

I'm glad that you approve. This is just the first iteration, to get something out there that can be tested by the client. How "complete" the support will be will ultimately be up to them.

5opr4ni commented 5 months ago

Hi,

This is super interesting work and would have been very useful for Eurovision Song Contest 2024 in Malmö, where we're incorporating a lot of color gradients in the graphics. All the graphics for ESC will be done in CasparCG.

Keep up the good work, Niklas and Julian!

MauriceVeraart commented 5 months ago

Nice work. Can this also be used for "custom resolution consumers"? 10Bit or even higher will be a big improvement for our market with non-standard resolutions. 

niklaspandersson commented 5 months ago

@MauriceVeraart

Nice work. Can this also be used for "custom resolution consumers"? 10Bit or even higher will be a big improvement for our market with non-standard resolutions.

Yes, absolutely. For ffmpeg I think it would just work without any modifications. Do have a specific consumer in mind?

MauriceVeraart commented 5 months ago

@MauriceVeraart

Nice work. Can this also be used for "custom resolution consumers"? 10Bit or even higher will be a big improvement for our market with non-standard resolutions.

Yes, absolutely. For ffmpeg I think it would just work without any modifications. Do have a specific consumer in mind?

When we use custom resolutions it will be the screenconsumer

Julusian commented 4 months ago

@niklaspandersson I don't see any comments left that need addressing on this. Let me know if you are happy for it to be merged (or go ahead and merge it yourself)

niklaspandersson commented 4 months ago

@Julusian I'm happy if you are happy. Feel free to merge

Sidonai-1 commented 4 months ago

Great work, thank you!

Question: channel bit depth goes from 8 to 16 directly, right? I tried to set it to 10 or 12 but it crashed, I just wanted to quickly test it on a laptop without decklink to compare image outputs with Photoshop but it seems that is not possible at the moment.

Screen consumer only supports 8-bit color depth
Image consumer only supports 8-bit color depth.
Julusian commented 4 months ago

@Sidonai-1 correct, it is limited to 8 or 16bit And yes, the consumer/producer support for higher bit depths is very limited currently

Sidonai-1 commented 3 months ago

Nice work. Can this also be used for "custom resolution consumers"? 10Bit or even higher will be a big improvement for our market with non-standard resolutions.

I guess when the screen consumer gets upgraded @MauriceVeraart you will be able to feed large VW at 10 bit, do you use Windows? Does it handle the screen consumer properly and in sync with the audio? I never used it for production because the frame-time was all over the place so it was not very smooth, specially comparing to Decklink. I wonder how well will Windows maintain the 10bit consumer, maybe with some extra configuration in the GPU settings?

I wanted to see if a 16bit channel would work as it is with custom resolutions and decklink ports but I got an error:

[2024-06-17 16:29:38.702] [error]   Exception: D:\a\server\server\src\modules\decklink\consumer\decklink_consumer.cpp(1131): Throw in function class caspar::spl::shared_ptr<class caspar::core::frame_consumer> __cdecl caspar::decklink::create_preconfigured_consumer(const class boost::property_tree::basic_ptree<class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >,class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >,struct std::less<class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > > > &,const class caspar::core::video_format_repository &,const class std::vector<class caspar::spl::shared_ptr<class caspar::core::video_channel>,class std::allocator<class caspar::spl::shared_ptr<class caspar::core::video_channel> > > &,enum caspar::common::bit_depth)
[2024-06-17 16:29:38.702] [error]   Dynamic exception type: class boost::exception_detail::clone_impl<struct caspar::caspar_exception>
[2024-06-17 16:29:38.702] [error]   [struct caspar::tag_msg_info * __ptr64] = Decklink consumer does not support hdr in combination with secondary ports.
[2024-06-17 16:29:38.702] [error]   [struct caspar::tag_stacktrace_info * __ptr64] =  0# 0x00007FF7DF283427 in casparcg
[2024-06-17 16:29:38.702] [error]    1# 0x00007FF7DF2AF7C6 in casparcg
[2024-06-17 16:29:38.702] [error]    2# 0x00007FF7DF407EA0 in casparcg
[2024-06-17 16:29:38.702] [error]    3# 0x00007FF7DF3C0041 in casparcg
[2024-06-17 16:29:38.702] [error]    4# 0x00007FF7DF30FC7C in casparcg
[2024-06-17 16:29:38.702] [error]    5# 0x00007FF7DF310254 in casparcg
[2024-06-17 16:29:38.702] [error]    6# 0x00007FF7DF2AAEBA in casparcg
[2024-06-17 16:29:38.702] [error]    7# 0x00007FF7DF2AFD4B in casparcg
[2024-06-17 16:29:38.702] [error]    8# 0x00007FF7DF2850C8 in casparcg
[2024-06-17 16:29:38.702] [error]    9# 0x00007FF7DF2883FF in casparcg
[2024-06-17 16:29:38.702] [error]   10# 0x00007FF7DF4F5B64 in casparcg
[2024-06-17 16:29:38.702] [error]   11# BaseThreadInitThunk in KERNEL32
[2024-06-17 16:29:38.702] [error]   12# RtlUserThreadStart in ntdll
[2024-06-17 16:29:38.702] [error]   
[2024-06-17 16:29:38.702] [error]   
[2024-06-17 16:29:38.702] [error]    0# 0x00007FF7DF283427 in casparcg
[2024-06-17 16:29:38.702] [error]    1# 0x00007FF7DF282EAA in casparcg
[2024-06-17 16:29:38.702] [error]    2# 0x00007FF7DF5390D9 in casparcg
[2024-06-17 16:29:38.702] [error]    3# 0x00007FF8CE271080 in VCRUNTIME140_1
[2024-06-17 16:29:38.702] [error]    4# _NLG_Return2 in VCRUNTIME140_1
[2024-06-17 16:29:38.702] [error]    5# RtlCaptureContext2 in ntdll
[2024-06-17 16:29:38.702] [error]    6# 0x00007FF7DF2AAEBA in casparcg
[2024-06-17 16:29:38.702] [error]    7# 0x00007FF7DF2AFD4B in casparcg
[2024-06-17 16:29:38.702] [error]    8# 0x00007FF7DF2850C8 in casparcg
[2024-06-17 16:29:38.702] [error]    9# 0x00007FF7DF2883FF in casparcg
[2024-06-17 16:29:38.702] [error]   10# 0x00007FF7DF4F5B64 in casparcg
[2024-06-17 16:29:38.702] [error]   11# BaseThreadInitThunk in KERNEL32
[2024-06-17 16:29:38.702] [error]   12# RtlUserThreadStart in ntdll

I wonder if "Decklink consumer does not support hdr in combination with secondary ports." comes from a SDK limitation or it's just not fully implemented yet. Hopefully it's the latter 😁

It was a bit strange that the log was complaining about HDR. The channel was set at 16bit in the config, with no color space or HDR settings specified.

I thought bit depth and HDR on/off were be 'independent' in some way. Are they completely intertwined?

Thanks.