Transcoding FFV1 output from Topaz to other lossless codec

Hi, I have a fairly long workflow for some videos that even includes passing through Topaz four times in some cases - and that is before the final output from Topaz which then goes to Vegas Pro 22 for actual editing. At all times within Topaz I stick with the FFV1 codec at 4:4:4 10 bit since that is the only lossless option other than the uncompressed RGB option (which despite all attempts, cannot be imported into Vegas Pro 22). And then I obviously lose nothing at all when I have to pass the material through Topaz as many times as required.

Since I wish to retain the maximum possible quality until the final “delivery codec” step, I prefer to stay completely lossless throughout. And I am able to do so except for the step between Topaz outputting it’s final step as (FFV1 4:4:4 10) and into Vegas Pro 22.

After weeks of experiments and research including going through all ffmpeg official and unofficial documentation, I have not found any possible way to go from the FFV1 4:4:4 10 Topaz output to the same 4:4:4 10 lossless input such that Vegas Pro 22 will be able to import it. It won’t even take the two ffmpeg (genuinely) lossless H.264 and H2.65 options either. It won’t take uncompressed RBG as mentioned either. It does take 4:2:2 lossless but I do not wish to lose the totally uncompromised colour space.

The best I have managed to this point is to transcode the FFV1 output to ProRes 4444XQ since that is the least damaging option that retains 10 bits and the colour space. But despite the claims that ProRes is visually lossless, I can actually see the difference between the FFV1 output and the ProRes 4444XQ equivalent (and yes, it is retaining the colour space and bit depth). Yes, the difference is subtle and I accept that people can’t see the difference but for better or worse, I can. The ProRes simply does not “pop” quite as much, most noticeably with the colour detail very slightly compromised (though keep in mind this is 50 fps sport - I cannot tell the difference between FFV1 and ProRes 4444XQ for film content for example).

So anyway, I am still trying to see if there is a way to transcode FFV1 4:4:4 10 Topaz output to 4:4:4 10 lossless that can then be imported into Vegas Pro 22. That way I know I lose absolutely nothing at all through the workflow till the very end (which is acceptable to me in the sense that it is inevitable and cannot be avoided once I get to the end).

I did buy the MagicYUV codec and it is excellent - I wish ProRes 4444 XQ looked as perfectly pristine as MagicYUV does! But alas, while Vegas Pro happily exports MagicYUV, it won’t import it! And ffmpeg only handles MagicYUV to 8 bits.

If anyone has specific experience in this area and knows a totally lossless format that Vegas Pro will accept, has 10 bit depth and the full 4:4:4 colour space and which can be transcoded from the FFV1 equivalent, please let me know.

Thank you

QQ - Why do you use FFV1 4:4:4 10 rather than FFV1-with-rgb48le in your workflow? It is still compressed, but lossless. TVAI always converts to rgb48le internally, and every pass you will end up with a YUV>RGB>YUV filter getting auto-inserted? May as well stay in TVAI’s native format, exactly as it comes out of the back of the TVAI filter.

Edit: I misread you were using Resolve - just re-read and you are running Vegas Pro. This does not help your final export problem, but FFV1-with-RGB48le does avoid multiple YUV>RGB>YUV conversions within TVAI.

1 Like

Thanks. I had not realised I could change these parameters myself when I originally replied and was going to ask how I do it, but then I realised I just had to do some editing in the encoders file.

Here’s a snippet from my encoders.json. I place it after the existing FFV1 definitions.

  {
    "id": "ffv1-16bit-rgb48le",
    "encoder": "FFV1",
    "profile": "16-bit RGB48le",
    "ffmpegOpts": "-codec:v ffv1 -level:v 3 -coder:v range_tab -slices:v 4 -slicecrc:v 1 -pix_fmt:v rgb48le -g:v 1",
    "ext": [
      "nut",
      "mkv",
      "mov",
      "avi"
    ]
  },

It seems odd that this is not included in the default encoders.json because rgb48le is TVAI’s native pixel format.

[The team over on the ffmpeg-devel mailing list are working on GPU-accelerated FFV1 encoding, which will hopefully ripple its way through to TVAI some time in the next year or so]

1 Like

Thank you. You have been extremely helpful to me. You have also answered indirectly two other questions I had - one was what was the internal precision of Topaz - I had not been able to find that anywhere. And secondly, the stock R210 entry in the encoder file has the wrong picture format - YUV (not that it effects the final result but it does produce an error that ffmpeg itself corrects as it changes it to RGB). Thanks to you putting it into my mind that I could actually edit the offending file I could fix that up myself as well. And thanks to Topaz for allowing us to do that in the first place.

I can actually see a difference in the final output with your recommended settings that retain full precision through the Topaz chain as opposed to what I was doing before with all the YUV-RGB-YUV translations (which in this case is a total of four passes because the source material is so awfully bad and it needs a lot of progressive manipulation, the first with Artermis remaining at SD, the second with Proteus taking it to Full HD, a third with Nyx then finally Aion. The final result just looks a little bit more “pristine”. I doubt 99% of people would notice any difference but I do (it is harder to see any difference on my computer monitor but much easier to a difference on my LG OLED). But when you are using short snippits of the same test material over and over you get used to seeing the most minute changes in it with every tiny change in Topaz!

1 Like