Best codec for 4k recordings

Dear friends, i need to record a 4k sdi stream from a Sony FS7 camera. Can you suggest the best codec for that? I mean the best quality target. I plan to use a BM mini recorder 4k. The idea is to use 10 bits 4:2:2 2160p23.98, 2160p24, 2160p25, 2160p29.97, 2160p30 if it’s possible. The server will be an i7. The use will be 4k record server only. Thank you.

As ever the answer will be some engineering balance, and you may need multiple choices that depend on the further processing of the recoded content.

Best quality is, obviously, uncompressed - but there is a very high price for the large storage capacity and high media-write speed. The optimum codec needs to balance the record data rate, the picture quality measured using psnr relative to uncompressed, the further processing requirements on the signal and the final distribution operations.

Will the recordings be used in a post-production chromakeying operation? If yes, then uncompressed or near uncompressed may prove essential if 3-D virtual reality backgrounds are needed. You will need to experiment with the edge key quality when using data rate reduction codecs. It may be possible to chromakey with satisfactory quality for most applications using one of the DNx-HD or ProRes codecs as both can support 10-bit working in 4:2:2 colour space.

If the recording will just have cut-edit processing, followed by the edited item being played out direct to transmission the codec data rate can be reduced. Will the content always pass via the same edit software, or will a mixture of edit software be used? If a mixture of edit systems are deployed look for a codec that is fully supported by all edit packages.

Will the camera be used to shoot high dynamic-range content? If yes then the codec needs to be one of those that support HDR signals.

The chosen codec should target the minimum number of re-encodes. So using an intra frame codec that is the same codec used in any edit will support data pass through with no further signal degradation unless the frame is subject to a fade or colour-correction change.

Non-intra-based codecs (H264, H265 in 4:2:2) have the largest potential for quality loss in each re-encode operation. It is possible that the signal to noise ratio will degrade up to 3dB per re-encode if worst case alignments happen.

Dear Andyw, Thank you very much for your comments. You are very clear. I understand the difference between intra and non-intra codecs, and my first need is not a chroma key scenario. Just i need to record the camera for a small budget soup opera and we are concern about the maximum time per memory. So the idea is to built a server and get some versatility over this limitation. In such case, we think the HDR will be a big plus but how to set this record mode is unclear for me. Also:

  1. For record, in the official client seems several settings are lost. So i think to write the commands in amcp protocol sending to the server using telnet automation.
    If anybody can help with examples that are in use or some link to read will be great. I’m afraid the official client doesn’t have complete codecs options. (I mean examples of 4k record settings)
  2. Really i don’t know if Prores, DNx-HD, or H264 are stable and can be used for production in 4K using the server 2.3 last built.
    Thank you again.

Thank you for expanding the user requirements, that is very helpful.

I have reviewed the specification of the Sony camera. I misread the specification prior to my first post, and in consequence I mislead you about HDR recording for which I apologise. The dynamic range of the Sony camera sensor and processing does have the ability to capture high-dynamic range content, but it can only save this onto a local file recording system using RAW encoding. After the files are graded an HDR signal that can be passed across an SDI link is created in either Hybid Log Gamma or Dolby. A quick check with a retail supplier shows the Sony RAW recorder elements are expensive.

This means the SDI output from the camera can only have a standard dynamic range, requiring each shot to be carefully exposed ready for minor adjustment in post production grading.

I think the SVT client record presets cover the expected majority of HD recording. You are correct that you need to use a custom command to send your chosen record properties to the CasparCG server. You can save good solutions in a client preset, speeding preparation of further record commands.

Both ProRes and DNX codecs are well proven in operations. Avid started offering versions of media composer using DNX with Ultra-HD resolution about 5 years ago. The DNX codec is an SMPTE standard (VC-3), enabling wide access to the standard documentation.

The ProRes codec situation is more complex. Apple have not, as far as I can detect, offered the ProRes documentation to any standards body for open publication. There is a recent (January 2020) Apple White Paper about the ProRes codec available here. This document does make it clear that the ProRes in ffmpeg is not an authorised implementation, and incompatibilities can occur.

H.264 decoding is very well specified. Like all codecs intended for distribution applications the documentation concentrates on processing a bitstream. An H.264 encoder is a process that creates a compliant decodable bitstream. Given a file containing source samples two H.264 encoders are likely to create two very different bitstreams, but both of which should decode correctly, but with possibly very different picture qualities.

I think you probably have to test DNx against H.264 encoded with relatively short GOPs. In addition to visual checking of decoded codec outputs for given file size per frame, you may also need to make objective quality tests. There are several psnr software suites available for free, such as the one from EPFL available here on GitHub. One bonus to ffmeg as the encoder is that it can be used to encode a source file at various settings, later switching the operation to input from a device instead of a file.

I do not currently have access to Ultra-HD kit, so I hope another member of the forum can provide an ffmpeg command string to speed investigations.

4K is 4096x2160p. As far as I know you can output this resolution on FS7 only over HDMI.
Which is not reliable on long run cables.

Better record inside camera, get two sets of cards, while one is recording the other one will be unload on a normal PC. You will get 1 extra advantage: you will preserve your mobility (1 cable less)

As for the codec the only option is XAVC-I if you want 10bit.
For RAW and ProRes you will need an extender XDCA-FS7 (plus some extra gear)

I dont know whether is possible or not to get 12G-SDI out from FS7
(even using extra HXR-IFR5). CasparCG works only with Decklink cards.
So whatever signal Decklink accepts that reflects on what CasparCG accepts.

My 2 cents. don’t film 4K if your final product will be UHD.

Of course there is also the Atomos way:

AndyW, i understand your comments. The next week i start comparison between DNX and H264 codecs in UHD and 4k DCI and will be working with the edit suite in order to check the best results, profiles and levels. They asking me for prores hq 4:2:2 so i have to try it also. Thank very much for your complete and detailed help.

Dan, Thank you very much for your point of view, and advice. The problem with memory card is the workflow. For a two cameras shoot, you need to buy a lot of cards. And you also have to shoot always thinking in the remaining time. By the way, If one master card is lost, it’s my instant dead.
May be you can live with this workflow for films, or music, but this is not the right way for a soup opera.
The point of the cable is important but in studio you have energy cables connected too. If we need some movements like steadycam and so, we can use the cards anyway.

You can’t get 12G-sdi from this camera. My best chance is 3g-sdi, then you are right, the 4k is not possible from sdi in the FS7. The blackmagic card is 6G but the fs7 is not. It seems we can do it using HDMI. Thank you for this information and the 2 cents…