Add More Lossless Encoders

The fact that ffv1 can’t be used above 4096x4096 is very limiting. Please add other lossless video encoders, such as PNG lossless or JPEG lossless.

PNG is already an included option. I’m not sure if JPG is ever lossless… but it is an option already as well.
Tiff is also there and it’s even more lossless. (But the main reason for using Tiff is that it keeps the colorspace, but TVAI converts to a PNG colorspace, so that benefit is moot.)

There is a PNG image sequence. There is not a PNG lossless video codec.

JPEG lossless is a type of video codec.

I’ll look it up and get you the lines to add to encoders.json if it’s available.
Does AVI still have that 4GB size limit?

No, but I always use MOV for lossless files anyway. Not a fan of AVI or MKV.

You can output into MagicYUV by editing the encoders.json file but since V4 the output magicyuv avi file seems to be unreadable in other applications. I get a black video in virtualDub and when playing the file into MPC-HC. It’s strange because mediaInfo reports the correct metadatas and Windows explorer is able to display a thumbnail of the video and if using it as a preview it works on VEAI. Maybe a ffmpeg issue in the topaz build-in.

Okay. I got it to encode to PNG. The resulting video played, but not smoothly at all.
%ProgramData%\Topaz Labs LLC\Topaz Video AI\models\video-encoders.json is where the file is on Windows. Paste that into the explorer and it will try to open the file.
Add

{
    "id": "png-in-container",
    "encoder": "PNG in container",
    "profile": "8-bit",
    "ffmpegOpts": "-vcodec png -compression_level 9 -pred mixed",
    "ext": [
      "mkv",
      "mov",
      "avi"
    ]
  },
  {
    "id": "png-in-container16",
    "encoder": "PNG in container",
    "profile": "16-bit",
    "ffmpegOpts": "-vcodec png -pix_fmt rgb48le -compression_level 9 -pred mixed",
    "ext": [
      "mkv",
      "mov",
      "avi"
    ]
  },

somewhere in the file. I put it right below FFV1.
-compression_level goes from 0 to 9. 0 Made a 2BG file for 240 frames of 1706X960 16bit video. That’s huge, but expected. 9 Took twice the time to process but was half the size. I think 6 is PNG default.

JPG is probably similar. I didn’t find anything right away because mjpg exists. I can keep digging if you don’t figure it out.

3 Likes

It worked like a charm. I modified it a bit and also played with the audio encoders. But no more resolution limitations :+1:

1 Like