Topaz's FFMPEG not working after updating to version 3.1.8

  1. The bug / behavior you have encountered:
    I use FFmpeg to batch generate Topaz enhanced DNxHR mxfs with same metadata. It’s not working after updating from 3.0.x to 3.1.8 version of TVAI. I refuse to use the GUI as it does not support DNxHD/R and does not pass metadata I need to conform new mxf files.
  2. Your system profile: Irrelevant as it worked previously, but it’s i9 9960X and RTX 3080

logsForSupport.tar.gz (112.4 KB)

Example of my command:

"C:\Program Files\Topaz Labs LLC\Topaz Video AI\ffmpeg.exe" "-n" "-strict" "2" "-hwaccel" "auto" "-i" "input.mxf" "-copyts" "-sws_flags" "spline+accurate_rnd+full_chroma_int" "-color_trc" "1" "-colorspace" "1" "-color_primaries" "1" "-color_range" "pc" "-filter_complex" "tvai_up=model=ahq-12:scale=0:w=3840:h=2160:device=0:vram=0.9:instances=1,scale=in_range=full:out_range=full,scale=out_color_matrix=bt709" "-c:v" "dnxhd" "-pix_fmt" "yuv422p10le" "-profile:v" "dnxhr_hqx" "-b:v" "729M" "-map_metadata" "0:s:0" "input_upscale.mxf"

The content of models folder (with the model file downloaded specifically for my video):

 Directory of G:\Topaz Video AI\models

09/03/2023  15:08    <DIR>          .
09/03/2023  15:08    <DIR>          ..
09/03/2023  15:08        23.819.790 ahq-v12-fgnet-fp16-576x672-1x-rt806-8500.tz
08/03/2023  23:21             1.051 auth.tpz
               2 File(s)     23.820.841 bytes
               2 Dir(s)  41.712.050.176 bytes free

It worked as expected in versions 3.0.x, however, sometimes Topaz generated a watermark despite being logged in, which prompted me to update the software. Now, FFmpeg simply crashes without providing any error. I updated the environment variables as the names changed according to the support article. I noticed that in the models folder the .json files are now missing and the GUI does not generate then anymore and perhaps this is the problem.

"C:\Program Files\Topaz Labs LLC\Topaz Video AI\ffmpeg.exe" "-y" "-strict" "2" "-hwaccel" "auto" "-i" "input.mxf" "-copyts" "-sws_flags" "spline+accurate_rnd+full_chroma_int" "-color_trc" "1" "-colorspace" "1" "-color_primaries" "1" "-color_range" "pc" "-filter_complex" "tvai_up=model=ahq-12:scale=0:w=3840:h=2160:device=0:vram=0.9:instances=1,scale=in_range=full:out_range=full,scale=out_color_matrix=bt709" "-c:v" "dnxhd" "-pix_fmt" "yuv422p10le" "-profile:v" "dnxhr_hqx" "-b:v" "729M" "-map_metadata" "0:s:0" "input_upscale.mxf"
ffmpeg version N-110405-gd141821d7b Copyright (c) 2000-2023 the FFmpeg developers
  built with Microsoft (R) C/C++ Optimizing Compiler Version 19.29.30148 for x64
  configuration: --toolchain=msvc --prefix=output-conan --enable-libvpx --enable-libaom --enable-shared --enable-x86asm --x86asmexe=yasm --enable-nvenc --enable-nvdec --disable-vulkan --enable-amf --enable-libvpl --enable-zlib --enable-tvai --extra-cflags='-I./conan/lib3rdparty/videoai/include -I/c/Users/Gregory/topaz-labs/ffmpeg-deps/include -I./conan/lib3rdparty/libvpx/include -I./conan/lib3rdparty/aom/include -I/c/Users/Gregory/topaz-labs/ffmpeg-deps/oneVPL/include/vpl' --extra-ldflags='-libpath:./conan/lib3rdparty/videoai/lib -libpath:/c/Users/Gregory/topaz-labs/ffmpeg-deps/nv_sdk -libpath:/c/Users/Gregory/topaz-labs/ffmpeg-deps/zlib-binary -libpath:./conan/lib3rdparty/libvpx/lib -libpath:./conan/lib3rdparty/aom/lib -libpath:/c/Users/Gregory/topaz-labs/ffmpeg-deps/oneVPL/lib -incremental:no'
  libavutil      58.  3.100 / 58.  3.100
  libavcodec     60.  6.100 / 60.  6.100
  libavformat    60.  4.100 / 60.  4.100
  libavdevice    60.  2.100 / 60.  2.100
  libavfilter     9.  4.100 /  9.  4.100
  libswscale      7.  2.100 /  7.  2.100
  libswresample   4. 11.100 /  4. 11.100
[mxf @ 000001EABDD51200] Stream #0: not enough frames to estimate rate; consider increasing probesize
Input #0, mxf, from 'input.mxf':
  Metadata:
    operational_pattern_ul: 060e2b34.04010102.0d010201.10030000
    uid             : 3f532e5a-bcc9-904f-8c71-f1880d31f000
    generation_uid  : 424366fe-8764-624d-85b8-847b2e8f25cc
    company_name    : Blackmagic Design
    product_name    : DaVinci Resolve
    product_version : 18.1.4
    product_uid     : 057cd849-178a-4b88-b4c7-825af8761b34
    modification_date: 2023-03-08T13:34:15.880000Z
    application_platform: DaVinci Resolve
    material_package_umid: 0x060A2B340101010501010D431300000064088ED20BE50000060E2B347F7F2A80
    comment_Comment : Created by Resolve
  Duration: 00:00:03.52, start: 0.000000, bitrate: 729238 kb/s
  Stream #0:0: Video: dnxhd (DNXHR HQX), yuv422p10le(tv, bt709, progressive), 3840x2160, SAR 1:1 DAR 16:9, 25 tbr, 25 tbn
    Metadata:
      file_package_umid: 0x060A2B340101010501010D431300000064088ED20BE60000060E2B347F7F2A80
      reel_umid       : 0x060A2B340101010501010D431300000064088ED20BE70000060E2B347F7F2A80
      timecode        : 10:57:00:00
Stream mapping:
  Stream #0:0 (dnxhd) -> tvai_up:default
  scale:default -> Stream #0:0 (dnxhd)
Press [q] to stop, [?] for help

At this point, a few seconds pass after which the programs ends and only generates a 0kB input_upscale.mxf file. The result is the same irregardless of codec used. Even the unmodified, GUI provided FFmpeg command behaves the same way.

If my suspicion about .json files missing is right, the question is: How do I generate these files for FFmpeg to work? Or, what is the cause of crash?

TVAI_MODEL_DIR is hard-coded to "C:\ProgramData\Topaz Labs LLC\Topaz Video AI\models"
I’m not sure if that was the case before.

I did not have the mxf source at hand, so I used the mkv(h.264) source, but it completed successfully with the commands given.

Maybe the environment variable is set incorrectly. The default values are as follows.

TVAI_MODEL_DATA_DIR
C:\ProgramData\Topaz Labs LLC\Topaz Video AI\

TVAI_MODEL_DIR
C:\ProgramData\Topaz Labs LLC\Topaz Video AI\models

Since the installation folder of the models is “G:\Topaz Video AI\models”, you need to change TVAI_MODEL_DIR and TVAI_MODEL_DATA_DIR.
It is also a good idea to check the consistency between the environment variables and the actual installed folder.