Anamorphic and HLG

Hi, using a recent (2 weeks ago) git compilation of both mlt and shotcut for 64bit on Linux.

Something of a rambling statement about my user requirements and another rambling question which will not be hugely scientific from my perspective but I want to understant better.

So I’ve found a really nice way to use anamorphic and shotcut. Just change the aspect ratio on the container using ffmpeg.

ffmpeg -i infile.mp4 -aspect 64:27 -c copy outfile.mkv

This changing containers helps because ffmpeg won’t accept mp4 with lpcm audio. This can be done in bulk in a folder and is instataneous because of just changing the container. It also is one less conversion :grinning:

It works well, shotcut recognises the aspect ratio and on exporting in the advanced tab my proportions. I haven’t done exhaustive testing with filters but it works well. If someone sees a problem that might bite me later I would appreciate a heads up :+1:t5:

Here’s the thing, I have been trying to get as much out of my camera as possible, up until now I used CineD which has the most dynamic range and flattest profile on my panasonic. However, the greens are far too souped up for my liking and not natural at all.

Just tried the HLG profile and wow! It’s nice and flat and the dynamic range is visibly better. I tried it on MPV and also on shotcut without ‘edit friendly’ formatting it. The colours were similar to just viewing it on the monitor and I just loved the extra dynamic range.

So Ive looked for other posts and understand from previous threads that in fact I dont gain dynamic range due to the conversion process in exporting when using HLG files in this manner. It doesn’t look like the top parts of highlights are just chopped off… Just squished into the 8bit range.

The idea is using 10 bit files in an 8 bit workflow to export. I realise I can’t change any files to take care of underexposure or overexposure because the 10 bits aren’t there to play around in. I will however be happy just to gain some more dynamic range in my original videos.

As an aside I’ve tried ffmpeg conversions HLG → yuv420 and they look pretty good to me as well. Well they look the same to my eyes. If it’s more sensible to convert to 8 bit upon importing that’s just and extra line in that ffmpeg routine so no problems either way.

1 Like

This is clever. In regards to something biting you later, does your aspect ratio match the timeline resolution you’re using?

DCI 4K Scope: 4096x1716 with 1024:429 aspect
Blu-ray 4K Scope: 3840x1600 with 12:5 aspect
Consumer ultra-wide: 2560x1080 with 64:27 aspect

As in, if your timeline is the traditional 4096x1716 but the incoming videos have a 64:27 aspect ratio, then there will be slender letterboxing on the sides of the exported video. Since your project resolution wasn’t specified in your post, I’m just double-checking.

This should be “good enough” with HLG. It’s designed to be backwards compatible with SDR. The transfer curve is going to be a little different by design, but it should be subtle enough that you could make minor exposure changes without the image totally falling apart. If banding does appear, there is a Deband filter to help conceal it.

For all practical purposes, Shotcut will do an implicit conversion from 10-bit 4:2:2 with HLG transfer characteristics to 8-bit yuv422p with BT.709 transfer characteristics when the video is processed on the timeline. (This is probably better described as “re-flagging” the transfer characteristic rather than an actual conversion, but it looks okay by nature of HLG being backward compatible.) Unless you want to do additional pre-filtering on every clip, there is no reason to do this conversion yourself. It will look the same.

The one possible reason to pre-convert would be preview playback speed. The more conversions that can be done in advance, the less on-the-fly conversion that Shotcut has to do, and this increases preview performance. However, the degradation in quality from pre-conversion (plus encoding time) is probably not worth it considering that much more performance can be gained with proxies than would be gained with pre-conversion.

2 Likes

64:27 is the timeline and as it is exported. Just the idea I’m editing 1080p but seeing and editing 2560:1080 and more to do with the filters and such, I haven’t tested my titles yet but I generally make them in gimp anyway. Even the Preview Scaling is working perfectly. Exporting works straight.

In my tests I’m able to edit 200MBS All-I and 100MBS Long GOP 1080p with a couple of filters and blends on one video track with a 4 core i7 7 year old laptop with preview scaling only and no dropped frames. Happy with that :grinning_face_with_smiling_eyes: , pretty much my use-case scenario.

If anyone wants the one liner for converting in a folder:

for f in *.MP4; do ffmpeg -i "$f" -aspect 64:27 -vcodec copy -acodec copy ${f%.MP4}.mkv; done

Thanks Austin

1 Like

This topic was automatically closed after 90 days. New replies are no longer allowed.