Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Capture quality HDCAM 1080i50 is decreased with CasparCG 2.4 compared with 2.1 #1574

Open
TKooijmans opened this issue Sep 27, 2024 · 3 comments
Labels

Comments

@TKooijmans
Copy link

Observed Behavior

I noticed that capture image quality with 2.1 is better then with 2.4 version.
This only seems the case with HDCAM 1080i50 MXF capture. capture in MP4 format seems fine.
Vertical resolution seems reduced with 2.4 version

if you look to these pictures you can see the problem
Grab CasparCG 2 1 capture
Grab CasparCG 2 4 capture

Expected behaviour

Picture quality should not decrease with HDcam 50 MXF capture

Steps to reproduce

1.Setup with CasperCG 2.1
SET 1 MODE 1080i5000
PLAY 1-1 Decklink 1 FORMAT 1080i5000 CHANNEL_LAYOUT stereo
record file with
ADD 1 FILE "Testclip HD.mxf" -b 50000000 -acodec pcm_s24le -vcodec mpeg2video -pix_fmt yuv422p -alternate_scan 1 -g 12 -bf 2 -minrate 50000k -maxrate 50000k -color_primaries bt709 -color_trc 1 -colorspace 1 -dc 10 -lmin 1*QP2LAMBDA

Setup with CasperCG 2.4
SET 1 MODE 1080i5000
PLAY 1-1 Decklink 1 FORMAT 1080i5000
record file with
ADD 1-700 FILE "TEST 2.4 NRK.mxf" -b:v 50000000 -codec:a pcm_s24le -codec:v mpeg2video -filter:v interlace,zscale=rangein=full:range=limited:primaries=709:transfer=709:matrix=709,format=yuv422p -alternate_scan:v 1 -g:v 12 -bf:v 2 -minrate:v 50000k -maxrate:v 50000k -color_primaries:v bt709 -color_trc:v 1 -colorspace:v 1 -filter:a pan=stereo|c0=c0|c1=c1

2 feed a HD SDI 1080i50 (TV broadcast) to the SDI input of the Decklink card, use the CasparCG test picture
2.Capture from a Decklink HD SDI source in HDCAM 50 mode with CasparCG 2.1 and Caspar 2.4

compare the image quality between CasparCG 2.1 capture and CasparCG2.4 capture
vertical resolution has decreased with CasparCG 2.4 capture

Environment

Server 2.1 and 2.4
Win 10 Pro with Decklink Extreme4k and Nvidia graphics

@Julusian
Copy link
Member

I can only give some background/theories at this stage.

In 2.1, for a 50i channel the mixer ran at 25hz, typically with interlaced frames, sometimes with progressive frames, depending on the source and whether the producer decided to deinterlace.
So the ffmpeg/file consumer you add will be receiving frames in 50i.

In 2.4, for a 50i channel the mixer runs at 50hz. Either with frames deinterlaced to 50p, or preserving doubling the interlaced frames, depending on the producer/parameters to the producer. The decklink producer only deinterlaces when there is a mismatch between the decklink and channel format, or if explicitly told to.
So the ffmpeg/file consumer will be receiving frames which claim to be 50p, which could be packed in one of two ways.

In either case, if ffmpeg is correctly reinterlacing the 50p to 50i (taking the upper from one frame, lower from the next) it should produce the same thing. We pass the two frames around internally in pairs, so that we can be sure to not fall out of sync with which frame should be each field.
I don't remember if I tested the ffmpeg consumer at all, so it could simply be a case of refining your command, or it could be that something needs to be done on the casparcg side to present the frames different when the channel is interlaced

@TKooijmans
Copy link
Author

The strange thing is in this case is that only HDCAM MXF is soft, MP4 1080i50 recordings are fine.

@TKooijmans
Copy link
Author

This problem is also there with CasparCG 2.2 and CasparCG 2.3.
So you have to use CasparCG 2.1 to get good quality with 1080i50 HDCAM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants