Al Spaeth wrote:Wow that's an analysis I didn't know was possible.
I assure you it's easy to do, especially if you are already set up for AVISynth processing. Actually, you can do the same with ffmpeg and generate the SSIM and PSNR values simultaneously, but I found some variance between ffmpeg builds and so still prefer to do it this way. It is rather time consuming though.
Al Spaeth wrote:I understand your workflow which is what I was planning to do.
That's largely why I posted the data; I thought it might help you better understand the reason why this approach has been advised.
Al Spaeth wrote:I did a visual test - MP4>Cineform>Resolve (no editing)>Cineform>MP4 on a 4k 8bit source clip.
I used Vdub Filter Mod as suggested by Andrew with Cineform set to Medium and pixel format set to YUY2 (8 bit). Then Cineform>h.264 using Handbrake's x264.
I visually compared result to source and it "looked good" (subjective) - but I see your tests show SSIM is below 90 with Cineform set to Medium indicting a quality loss.
No, I transcoded and rendered to Cineform at High quality (FilmScan1) in these tests. The only 'Medium' there was one of the series of quality settings I tested for Resolve QT H264 output.
That said, even at HD resolution, Cineform at Medium quality will still give very good results and generally speaking you would be hard-pressed to notice a difference between Medium and High (FilmScan 1), and even less so (if at all) between High and Best (FilmScan 2). The reason why Andrew recommend Medium quality for your 4K material, I would assume, is because you stand a better chance of managing the transcodes on the Resolve timeline. As for setting the (compresssor) pixel format to YUY2 (8-bit) in VDub FilterMod - that's necessary because it will default to the default decode pixel format (YUV420-709) otherwise and throw an error; Cineform only accepts rgb16, rgb24, rgb32, YUY2 or v210 input.
I do the same when transcoding 8-bit 4:2:0 material to Cineform via AVISynth and 'regular' VirtualDub. I use AVISynth to convert decode YV12 to YUY2 and then 'Fast Recompress' in VirtualDub to avoid intermediary conversion via RGB. The only thing I find about Cineform.avi files encoded with VDub is that, for some reason, Resolve doesn't recognize them... but does after remuxing to mov. Have you found this ?
There was also an issue with VDub FilterMod where the Cineform configuration settings kept reverting back to default, but I see that has been fixed in the latest update (version 38919).
Al Spaeth wrote:Look forward to your final results.
Yes, as regards:
Bryan Worsley wrote:BTW Al, I was going to include results for x264 encoded with Handbrake, using the same x264 profile as in the MeGUI tests, but I'm having an issue opening the x264 files (m4v remuxed to mp4) with the AVISynth decoder used in these tests. If I manage to sort that, I'll post the results.
Turns out the issue was not with the Handbrake x264 files
per se. It was a bug in the MeGUI tool (File Indexer) that I use for automatically loading clips in AVS scripts which appeared in the last MeGUI update. Rolling back to the pre-update (for now), I've tested the Handbrake x264 files encoded at CRF 14, 16 and 18. Here's an amended table including the Handbrake results:
https://www.datafilehost.com/d/9ecc654aAs you can see, the Handbrake x264 give slightly lower metric scores than the equivalent MeGUI x264 encodes, but there could be any number reasons for that - x264 build, decode/conversion>YV12 efficiency ? I wouldn't read too much into it.
Bear in mind also that these tests were done with just one HD-AVC clip as the source and there are various factors that can wildly affect the outcomes, not least the content of the test material - the fidelity, complexity and degree of motion, all profoundly impact the compression/encoding efficiency especially with x264 in unrestricted Constant Quality (CRF) mode. Even something as bland as a slow pan across a pebble beach, or rolling surf can send the bitrate up.
So I wouldn't at all hold to this particular set of results as a reference for predicting what quality efficiency outcome (in terms of metric scores) can expected be at a particular encode quality setting.
Also, in these tests I used the original native HD-AVC clip as the reference clip for the metric analyses so as to represent the overall efficiency of the process chain. Taking the MeGUI x264 file encoded at CRF14 for example. There it gave SSIM and PSNR scores of 91.84 and 43.00. Had I used the Cineform export file as a reference the scores would actually be lower - SSIM 91.31, PSNR 42.70 - because the Cineform file needs to be decoded and converted to YV12 to perform the test. And if I encode the original HD-AVC clip directly to x264 at CRF14, the scores will obviously be higher - SSIM 93.69, PSNR 44.92. Yet I doubt very much that you would able to discern any visible difference between the two encodes; they are both very high quality.
In addition what these metrics can't account for is the psycho-visual element of x264 CRF "Constant Rate Factor" encoding, as explained quite nicely in layman's terms here:
http://slhck.info/video/2017/02/24/crf-guide.htmlSo it could be argued that these quality metrics actually underestimate the visual perception of quality. In fact x264 can be tuned for optimal SSIM or PSNR efficiency, but it is at the expense of fettered CRF encoding. I chose not to in these tests.
Al Spaeth wrote:Would it be possible:
1) to compare the Cineform workflow you used to h.264>Resolve>Resolve QT H.264 MOV>Re-Wrap to MP4 to see how poor Resolve h.264 really is?
I did also create a parallel set of x264 encodes using the native HD-AVC source clip for input, but haven't yet run the metric tests on the full set. The several Resolve QT H264 files I have tested do give slightly higher SSIM values (around +0.01 or +1% higher) than the equivalent renders produced with the Cineform transcode for input, but that's only to be expected - there is inevitably a 'quality hit' when transcoding to Cineform and again when converting back to 8-bit YV12. The Cineform (FilmScan 1) transcode used in these tests, for example, gave an SSIM score of 96.62 and a PSNR score of 46.28 relative to the native source clip. Transcoding at FilmScan 2 (Best) quality level increased that to SSIM 98.09 and PSNR 47.61, which is way beyond 'visually lossless'.
What's more relevant is how the Resolve H264 and Cineform export>x264 encodes compare using the same Resolve input, and the results already show that.
Actually, if you look at the native clip>Cineform (FilmScan 1) transcode and the export Cineform file (FilmScan 1) produced when the native clip is used for input, they have exactly the same SSIM and PSNR scores and are nigh on bit identical 453,994,044 vs 453,994,054 bytes i.e. the intrinsic 'pass-through' efficiency of the Resolve engine is effectively lossless.
Al Spaeth wrote:2) to compare Resolve h.264 output with the same clip to Pr Pro output?
I'm not sure I follow what you are saying here. What's Pr Pro?
Edit: Ah, OK, Premiere Pro. Well that could apply to any NLE, but then you are comparing different process chains, not just the quality of H264 encoding
per se - apples and oranges really. Surely the point is "if the quality of Resolve's own H264 rendering format is deemed sub-standard, what are the alternatives for external H264 encoding via an export intermediate" ? I guess you could use quality metrics (with the chosen export intermediate as reference) to compare x264 with Adobe's Main Concept H264 implementation via AME, if you were so inclined. Me not.
Al Spaeth wrote:3) to compare to Resolve using Optimized Media DNx > Output to Dnx > DNx >h.264 to your Cineform workflow? ie - instead of transcoding camera source use h.264 media, optomize to DNx format the render out to DNx (I'm not sure which Dnx option as an intermediate would give best results).
I understand your incentive for wanting to do that (based on your further comments - below), but I'm afraid I wouldn't have the time to devote to such an exercise. Like I said, running these tests is quite time consuming.
If you want to get into metric testing yourself, here are ffmpeg commands for SSIM and PSNR
- Code: Select all
#SSIM:
ffmpeg -i [Test] -i [Ref] -lavfi ssim="stats_file=ssim.log" -f null -
#PSNR:
ffmpeg -i [Test] -i [Ref] -lavfi psnr="stats_file=psnr.log" -f null -
#SSIM and PSNR simultaneously:
ffmpeg -i [Test] -i [Ref] -lavfi "ssim="stats_file=stats_ssim.log";[0:v][1:v]"psnr="stats_psnr.log" -f null -
#SSIM and PSNR - no log file:
ffmpeg -i [Test] -i [Ref] -lavfi "ssim;[0:v][1:v]psnr" -f null -
#Where [Test] and [Ref] are the directory paths and names (with extension) of the Test and Reference clips.
Edit: There are also some software for video quality assessment:
https://superuser.com/questions/338725/compare-two-video-files-to-find-out-which-has-best-qualityI used an early version of the free MSU Quality Measurement Tool years back for SD material. But for HD/4K video you'd need the Pro version which will put you back $1000.
Al Spaeth wrote:I still have a workflow problem using much the larger Cineform files in my Media Bin.
The saved resolve Project is Much larger than if I had the h.264 files in my bin.
To archive the project I need my source MP4 files, Vdub batch conversion settings, my Cineform source files from Vdub, the saved Resolve edit project, the Cineform rendered out file and the Handbrake h.264 MP4 - which gets kid of messy and needs a lot of space.
Workflow using Optimized Media seems easier in 3) above as I only have to backup my much smaller h.264 source, my saved Resolve project, and my output files.
If I need to return to my archived project, all I need to do is open my saved project in Resolve and re-generate Optimized Media??
Seems the obvious solution would be for Resolve to add Cineform as an optimize option.
I think the other members would be better qualified to speak to that. I've only recently started using Resolve and haven't even used Optimized Media.
Sorry for the long winded post, but I'm glad the test results I posted were helpful.