Extreme curve comparision

Started by surami, September 16, 2014, 01:21:12 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

surami

I did again an extreme curve comparision (At first I wrote about it on doom9 forum in june) and I would like to ask people to check it, if it's correct or not, because I'm not a video expert. (On that forum nobody checked it.)

The main idea behind this is maintaining the best quality from RAW (MLV) till the end (eg.: MOV, MP4).

To check it, please follow this:
01. Download the Advanced FrameServer and install it.
02. Make a preset in Media Encoder (Format: Advanced FrameServer, Color space: RGB24)
03. Download the AviSynth+ and install it.
04. Make an eg.: "E:\rendering\signpost.avs" file:
#24 fps source
#AVISource("E:\rendering\signpost.avi", audio=false).AssumeFPS(24,1)
#25 fps source
AVISource("E:\rendering\signpost.avi", audio=false).AssumeFPS(25,1)
#30 fps source
#AVISource("E:\rendering\signpost.avi", audio=false).AssumeFPS(30,1)

# ConvertToRGB24()

# 4:4:4
#ConvertToYV24()

# 4:2:2
#ConvertToYV16()

# 4:2:0
#ConvertToYV12()


05. Download the VirtualDub and the Gradation Curves Plugin.
06. Download one of the MLVFS Windows clients and setup.
07. Mount a MLV with the MLVFS.
08. Open the first DNG from the sequence with ACR, make color correction, open it in PS and save as 16 bit PNG.
09. Open the PNG in VirtualDub and add the Gradation Curves filter on it, make an extreme curve, something like this. (Export the curve, it will be used later too.) Click on show preview and make a sreenshot, save it on a PS layer.
10. Import the DNG sequence into AE (Project settings: 16 bpc, sRGB), save the project.
11. Open Media Encoder, use the previously mentioned AFS preset (02) on the AE project file, start the frame serving to eg.: E:\rendering. You will get an small AVI (eg. signpost.avi).
12. Open the AVI in VirtualDub and add the Gradation Curves filter on it, import the previously saved curve (09), again show preview, screenshot, save it on PS layer.
13. Don't stop the frame serving in Media Encoder.
14. Open the AVS file (comment # every line except one of the AVISource line with the FPS setting and save it) with VirtualDub and add the Gradation Curves filter on it, import the previously saved curve (09), again show preview, screenshot, save it on PS layer.
15. Open the AVS file and delete the comment sign before (4:4:4 setting) save it, open the file with VirtualDub and add the Gradation Curves filter on it, import the previously saved curve (09), again show preview, screenshot, save it on PS layer.
16. If you made everything correctly, then there will be only a negligible difference between the reference PNG frame and the YV24 (4:4:4) setting. Check and uncheck the layers in PS. The fully commented AVS or RGB24 settings will be the same as the PNG and AVI.

If you want to convert the sequence to MOV, MP4 or HEVC, then download the latest ffmpeg build and use it. Here are some example BATs, what I made:

ProRes 4:4:4 10bit:
ffmpeg.exe -i "signpost.avs" -c:v prores_ks -qscale:v 1 -pix_fmt yuv444p10 -filter:v unsharp=5:5:0.5:5:5:0.5 "prores_1080p_444_10bit.mov"
pause


x264 4:2:0 8bit:
ffmpeg.exe -r 25 -i "signpost.avs" -s 1920x1080 -c:v libx264 -b:v 25000k -minrate 25000k -maxrate 25000k -bufsize 25000k -x264-params keyint=25:min-keyint=1 -g 25 -pix_fmt yuv420p -filter:v unsharp=5:5:0.5:5:5:0.5 -r 25 "x264_1080p_420_8bit.mp4"
pause


x265 4:2:0 8bit:
ffmpeg.exe -i "signpost.avs" -s 1920x1080 -c:v libx265 -x265-params crf=1:vbv-bufsize=12500:vbv-maxrate=12500 -pix_fmt yuv420p -filter:v unsharp=5:5:0.5:5:5:0.5 "x265_1080p_420_8bit.hevc"
pause


If you have time please check this workflow till point 16.

Here is my extreme curve comparision, download the JPGs to check them and put them into a PS file, zoom in 200% or more.
550D + nightly ML

Audionut

I don't entirely understand what you are trying to do here.

Which part of the workflow are you trying to maintain maximum quality?

surami

I'm trying to maintain the quality till the final file, I mean converting to eg. MP4 or MOV.

If the AFS works correctly, then with ffmpeg we can do the converting to MP4 (x264 is better then Main Concept), or to MOV (ProRes 444) and any other video formats what ffmpeg covers.

I'm asking for check this thing, because the extreme curve test on the 16 bit PNG looks the same as the AFS's RGB24 AVI file. In theory the PNG is 16bit and the AVI is 8bit, there should be difference with this extreme curve test between the 2 files not or I miss something somewhere?
550D + nightly ML

Audionut

Well bit depth loosely means dynamic range.  And here, the lower bit depth is only going to be an issue if you start tone mapping after a reduction in bit depth.  For display purposes, you can probably get away with 6 bits of precision.

So you're trying to frameserve from some application, to use whatever codec, and you're wanting to check the quality through the frameserve?

surami

QuoteSo you're trying to frameserve from some application, to use whatever codec, and you're wanting to check the quality through the frameserve?
Yes, this is a pipe from MLV (16 bit DNG sequence + sidecar XMP adjusments) to fileformat + codec, what ffmpeg covers. It seems the quality is pixelperfect through this pipe, but it's another question, that what ffmpeg will do during the encoding.

QuoteWell bit depth loosely means dynamic range. And here, the lower bit depth is only going to be an issue if you start tone mapping after a reduction in bit depth.  For display purposes, you can probably get away with 6 bits of precision.
Yes, I thought that too and it should be so. I mean to tone map files, what have different bit depth should give us different results (If I understand correctly). So I'm confused again. :D  I did another comparision in AE. I put a 16 bit DNG frame, a 16 bit PNG (saved from the DNG) and a 8 bit JPG (saved from the DNG) into an AE project (compositions: sRGB, 16 bpc) and I applied again an extreme curve on them, the result are the same. It's ok that, I have an 8bit + 2bit dithered display and I can see only around 10bit, but with curve applied the screenshot results should be different not (16 bit vs 8 bit)?
550D + nightly ML

dyfid

Avisynth is 8bit, any colour space conversions like rgb <> 4:4:4 using Avisynth functions will be 8bit unless you look into Dither functions and avs2yuv to get interleaved 16bit yuv or rgb, at the moment you're just putting 8bit into 10bit prores / h264 / h265. The whole monster you've created is a total waste of time, honestly pointless. sorry.

Why not do yourself a big favour and just use Resolve?, or as you've already got ACR, Photoshop and AE why not use them? :) Export to a decent intermediate format like DNxHD or image sequences and encode to h264 or h265 from there?

surami

QuoteAvisynth is 8bit, any colour space conversions like rgb <> 4:4:4 using Avisynth functions will be 8bit unless you look into Dither functions and avs2yuv to get interleaved 16bit yuv or rgb, at the moment you're just putting 8bit into 10bit prores / h264 / h265. The whole monster you've created is a total waste of time, honestly pointless. sorry.
No problem, I'm in learning phase. :D With this monster you can playback the graded MLV (DNG sequence + sidecar XMP + AE adjustments) as an AVI file (AFS's AVI) in fullscreen mode, realtime in eg. MPC-HC, there is no need to encode.

QuoteWhy not do yourself a big favour and just use Resolve?, or as you've already got ACR, Photoshop and AE why not use them? :) Export to a decent intermediate format like DNxHD or image sequences and encode to h264 or h265 from there?
I want to avoid intermediate filest if I can, we have already the best one, it's the MLV. :) If I can't avoid, yes you have right, but this is a way of experimenting.

PS: Once I fed MeGUI mod with the AVS file and I saw BGR48 somewhere at the encoding. Unfortunately I saw this only once and I forgot the settings. Anyway interesting thing to experiment with this monster. :D
550D + nightly ML

dyfid

Quote from: surami on September 16, 2014, 04:02:04 PM
With this monster you can playback the graded MLV (DNG sequence + sidecar XMP + AE adjustments) as an AVI file (AFS's AVI) in fullscreen mode, realtime in eg. MPC-HC,

Congratulations and with such a simple workflow. ;) All you need now is MadVR and a display lut, right viewing conditions and your all set up for home cinema quality. ;)

But you've shifted your direction now, no longer talking about 10bit output maintaining quality and you're not getting 10bit still. :)

Do you have sound with your playback? Are you watching an edit? What resolution and duration are your clips off a 550d? Will it work just as well for 5D MKIII?

It's a technical exercise in ignoring the simple route. How many applications you've gone through to get some output, what about tweaking your grade realtime, optical flow speed changes realtime, stabilisation realtime, editing, titling, sync'd sound track.

Resolve Lite will give you all that you've got going on and a lot more besides, in one application.:)

QuoteI want to avoid intermediate filest if I can, we have already the best one, it's the MLV. :) If I can't avoid, yes you have right, but this is a way of experimenting.

Joking apart I get it, it's a technical exercise to play back a DNG sequence with a grade on it but for anyone looking to do more than that it's looks like a right pain in the ass.

QuotePS: Once I fed MeGUI mod with the AVS file and I saw BGR48 somewhere at the encoding. Unfortunately I saw this only once and I forgot the settings. Anyway interesting thing to experiment with this monster. :D

For the time being.:)

Audionut

Quote from: surami on September 16, 2014, 02:36:04 PM
Yes, I thought that too and it should be so. I mean to tone map files, what have different bit depth should give us different results (If I understand correctly). So I'm confused again. :D

I used a poor analogy for bit depth earlier.  Bit depth is the accuracy at which something is encoded.  You need test scenes with fine gradients, since it is these gradients that require bit depth (accuracy) to accurately display, encode, whatever.

Try playing with something like this:  https://dl.dropboxusercontent.com/u/34113196/ML/_MG_4821.DNG

Since I can pretty easily generate banding on my 8 bit display with that file.

surami

Quote from: dyfidBut you've shifted your direction now, no longer talking about 10bit output maintaining quality and you're not getting 10bit still. :)
You have right, I just wrote that it can be used for this kind of monitoring and convert to different formats. I said, I'm not an expert. :D

But back again to 10 bit. How could I test the AFS's AVI file bit depth? Of course it would be the best if someone could jump into this (to find a way to build up a 16/12/10 bit frame server):
Instructions on how to setup and build the Debugmode Frameserver: https://code.google.com/p/frame-server/wiki/BuildInstructions
Premiere Pro CS6 SDK: http://www.adobe.com/devnet/premiere/sdk/cs6.html
Premier Pro CC SDK: http://www.adobe.com/devnet/premiere/sdk/cc.html (Other changes is important here.)

Anyway, this curve test came to my mind because of this. Earlier I made a test with the forced 16 bit setting. I got a MOV file, but I could rewrap the information from MOV to AVI, without quality lost. In theory the AVI files can contain only 8 bit things not? So how is this again? :D

Quote from: dyfidDo you have sound with your playback? Are you watching an edit? What resolution and duration are your clips off a 550d? Will it work just as well for 5D MKIII?
I don't have sound, I watched a footage, what was graded by ACR + contrast + saturation in AE, the resolution is 1920x818, 2-3 seconds long and if you cache all the frames, then it should work for longer footages too. I think the best would be for this an SSD, eg.: 64 GB just only for cache.

In Resolve Lite I can't grade the DNG seqeunce yet, the white balance is not ok and if I start to play with the settings everything will be worse. It hardly can be that this comes from my gappy knowledge. :) Resolve is totally new for me.

Quote from: AudionutTry playing with something like this:  https://dl.dropboxusercontent.com/u/34113196/ML/_MG_4821.DNG
I just downloaded your file and droped this curve on it, the DNG, PNG are equal, the JPG seems a bit "sharper?" or how I say, but there isn't any banding.
550D + nightly ML

dyfid

Quote from: surami on September 17, 2014, 12:34:40 PM
But back again to 10 bit. How could I test the AFS's AVI file bit depth?

Running ffmpeg command line should tell you what it's receiving ie: yuv420p etc etc

QuoteIn Resolve Lite I can't grade the DNG seqeunce yet, the white balance is not ok and if I start to play with the settings everything will be worse. It hardly can be that this comes from my gappy knowledge. :) Resolve is totally new for me.

Maybe just invest time in learning the basics of Resolve instead of flogging a dead horse. :)

surami

Quote from: dyfidRunning ffmpeg command line should tell you what it's receiving ie: yuv420p etc etc
Yes, I thought the same, but ffmpeg gives an error:

[avi @ 0000000002ad88e0] Could not find codec parameters for stream 0 (Video: no
ne (DFSC / 0x43534644), 1920x818): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
signpost.avi: could not find codec parameters
Input #0, avi, from 'signpost.avi':
  Duration: 00:00:02.40, start: 0.000000, bitrate: 6 kb/s
    Stream #0:0: Video: none (DFSC / 0x43534644), 1920x818, 25 fps, 25 tbr, 25 t
bn, 25 tbc
No decoder for stream #0:0, filtering impossible
Error opening filters!


and MPC-HC's MediaInfo shows this:
General
Format                         : AVI
Format/Info                    : Audio Video Interleave
File size                      : 1.90 KiB
Duration                       : 2s 400ms
Overall bit rate               : 6 493 bps

Video
ID                             : 0
Format                         : VFW
Codec ID                       : DFSC
Codec ID/Info                  : DebugMode FrameServer VFW
Duration                       : 2s 400ms
Bit rate                       : 800 bps
Width                          : 1 920 pixels
Height                         : 818 pixels
Display aspect ratio           : 2.35:1
Frame rate                     : 25.000 fps
Bits/(Pixel*Frame)             : 0.000
Stream size                    : 240 Bytes (12%)


I just took a look the PP CS5.5 SDK site and well it's 8bit, because the AFS is written for CS5.5, but works in CS6 too.
The CC version supports RGB 444 10bit too.

Quote from: dyfidMaybe just invest time in learning the basics of Resolve instead of flogging a dead horse. :)
But it's a mutant donkey and still alive!!! :D :D Let's jump on the pegasus! :D
550D + nightly ML

dyfid

No doubt frameserving has its uses and so does avisynth but really this is just not it.. Nothing more to say. Bye.