[Tutorial] How to Deinterlace and keep original fps

There have been many that asked how can they deinterlace the video in TVAI using Dione:DV, Dione:TV or Iris without doubling (bobbing) the frame rate.
By default if you select Interlace in TVAI it would automatically select x2 on the FPS. e.g. if your video is Interlaced 25fps, the output would become 50fps.

image

Even though most claim that it is a good practice to bob (double) the fps for motion smoothness it doesn’t come without its own issues.
for example: each frame has half the vertical resolution, or resolution equal to that of each field that the frame was made from. Bobbing prevents combing artifacts and maintains smooth motion but can cause a noticeable reduction in picture quality from the loss of vertical resolution and visual anomalies whereby stationary objects can appear to bob up and down (hence, the name “bobbing”) as the odd and even lines alternate.

Many requested how can they Deinterlace but keep the original fps without bobbing.
TVAI documentation sais that for one to keep the original fps, one must select manually the fps he/she wishes to have.

image

the problem with this method is that it requires you to turn on frame interpolation for this to actual work, if not it just won’t work and you would still have the double frame rate even though you selected “25fps” manually as in the example.

There are two problems with this out of the box method.

  1. you are artificially doing a frame interpolation (using TVAI filter) that is not needed. this may reduce quality and some picture distortion as we all know the frame interpolation is not perfect.

  2. You adding extra workload on the TVAI video process as now TVAI needs to process two filters instead of one, and that costs time. in other words, you are going to wait more time to finish processing your video.

Turns out TVAI does no deinterlacing. TVAI instead uses the bwdif filter from ffmpeg to do the deinterlacing.
So why not utilize it’s, i.e. FFmpeg, function and tell it not to bob the video? As this is supported OOB by FFmpeg. :slight_smile:

That is what we going to do now.
The method that I found that works very well, is by utilizing FFmpeg’s built-in function to retain the original fps. It would be much quicker to process and would not introduce any artifacts that frame interpolation potentially does.

here are the steps:

  1. load your video into TVAI and set all your settings for deinterlacing , upscale, whatever you want, as you Ready to press the “Export” button.

Example:

image

  1. press Ctrl+Shit+E, this would open a window with the command that TVAI would run in the background in case you would press the “Export” button.
    Copy the content by clicking on the “Copy” Button.

image

  1. Open Notepad and paste the content you just copied into notepad

  2. In Notepad, search for bwdif=mode=1 and replace the “1” with a “0”. leave the rest untouched.

  3. Copy everything from notepad (Ctrl+C).

  4. In TVAI press Ctrl+T, this should open a command prompt. paste the content you just copied from notepad into the command line and Press “Enter”.

Example:

That’s it, your video will now be deinterlaced at original fps with the AI you chose (Dione:DV / TV, Iris).
no frame interpolation , much faster process and natively supported by ffmpeg.

I wish Topaz would just have this function in the UI as a drop down option when deinterlacing (to x2 fps or not) and based on the selection change the FFmpeg command line. it is so simple to implement. hardly any coding is needed.

6 Likes

Thanks - very helpful. In TVAI 3.3.5 frame interpolation was set automatically to Chronos fast- with a warning note in the video box - if you delaced an interlaced source then selected the original frame rate. Being new to TVAI I did not know you were supposed to turn on frame interpolation (which is what we are back to in 3.3.6-3.3.8) as it happened automatically.
I fully take your point about potential quality loss in bobbing then de-bobbing. But not having to delve into the intricacies of ffmpeg, avisynth and other such behemoths was the main reason I just spent a small fortune on buying TVAI! As you say, hardly any code is needed to put this option in the UI. We can only hope.

I think it’s a bug. it did use to turn on automatically. but the point remains that it goes through the frame interpolation process.

We are working on implementing the ability to maintain the input FPS without needing to do double the work within the UI :slight_smile:

2 Likes

hello, your technique is not bad to keep the 25 fps, but strangely, I have the same quality when deinterlacing at 25 fps or 50 fps, even worse, if I deinterlace with hybrid and qtgmc, without bob at 25 fps or with bob at 50 fps, and after I make a pass with iris, I have better quality at 50 fps than at 25 fps. no pass with iris, just deinterlacing with qtgmc gives me exactly the same quality (h264 lossless), pixel-perfect, so I think iris gives better results with 50 fps source rather than 25 fps

Hi, Akira - To add to your process:

On a Mac, use Command (not Control)+Shift+E to open the export command string. I’m using Ventura with all updates.

I’ve changed bwdif=mode=1 to “0” and copied that modified FFmpeg command string. I then use Command+T (not Control+T, that does nothing in TVAI on the Mac), and Terminal starts. Paste the modified command string and press Enter. Terminal returns the error:
“zsh: command not found: ffmpeg”. This happens even when I select “Open Command Prompt” from the Process dropdown menu. Is there some other way to enter the modified command string into TVAI? Thanks.

I’m sorry, I don’t usually use the command prompt, I don’t know how it works. and i’m on windows

Using this method I get an “error parsing debug value” if I use motion deblur or stabilization. Works fine if I do a straight upconvert/cleaning. Definitely something I’ll be adding to my process!

Interesting tutorial, I’m going to get it on a Word file. I could use it one day.

Seems with the latest 3.3.8 update, mp4 videos encoded with h264 Dione DV are no longer streaming properly online.

this tutorial was aimed for those who want to deinterlace in TVAI and keep the fps the same. it isn’t supposed to compete or be better or less good then other deinterlacing methods. I personally deinterlace with Hybrid. but many prefer using TVAI as their sole tool. so i created this for those target audience.

I don’t have MacOS, so i don’t know how well this would work on MacOS. this was tested on windows.

on Windows or MacOS?

Yes I understood but precisely I was also talking about the deinterlacing TVAI, I did not perceive any difference in quality in 25 fps or 50 fps … weird…

I myself also did not see any quality advantage between 25fps vs. 50fps (bobbing) that is why i personally remain with x2 fps. double fps was smoother motion for me.
but this tutorial is for those who want to retain the 25fps (or whatever original fps they have) if they decide that they do see a difference. on paper, the original fps should provide higher vertical resolution, in practice, i did not see any difference.

Okay, it reassures me, in any case I also think that it is better to keep the fluidity of 50 fps, easier for models to clean the video with more images in my opinion. Okay, it reassures me, in any case I also think that it is better to keep the fluidity of 50 fps, easier for models to clean the video with more images in my opinion. But it’s amazing that the quality is the same because as you say, the vertical resolution is supposed to be limited by deinterlacing. a bit like the bitrate of a video, with an equal bitrate, a 25 fps video will be more detailed than a 50 fps video.

I compared this to chronos fast + dione tv (on old anime) and the results were unexpected. For starters the exporting time is exactly the same but the end results are not even close. The chronos one is 8.71mb while this is 9.60mb (15 seconds). The chronos one is either lagging or ahead with a single frame compared to this version. The chronos version makes it look laggy and choppy with lot of ghosting compared to no frame doubling. This tutorial wins hands down.

1 Like

No matter whether it’s 50/60 or 25/30 you have to de-interlace. So the vertical resolution won’t be any better at the higher frame rate. You just get smoother motion with the higher frame rate. If there was no de-interlacing, the 50/60 version would just be the 25/30 with each frame repeated twice (and all the interlacing still there). The extra motion information only happens because it keeps one set of lines on one frame, then the other lines on the next. Topaz seems to be doing something more sophisticated than just a basic de-interlace because the results are much smoother that what I get with other methods.

I use Topaz on source clips for edited videos and those final videos will never be 59.94fps. So for me, I’d rather not even bother getting the full frame rate if I can get 29.97 at a much better speed and file size. This method is worth a shot, but it would be great if Topaz just let me maintain the source frame (not field) rate.

I know interlacing and I know the effects it has :slight_smile: I deinterlace my sources by doubling from 25 to 50, because effectively, there is no change in quality, at least with qtgmc or yadiff needi3 etc… always the same quality, and when we apply a model with vai, the more images there are, the better the results I noticed, especially since I like the fluidity, even if the video finish is twice as heavy, no big deal, the important thing is to have the quality with a good movement. afterwards free for those who want to maintain the 25/30 fps, but we can do it with topaz, it’s not complicated, I don’t really remember the procedure but Akila made a post on that, you have to ask him or let him read this thread.

Is Topaz using inter-frame information to do the scaling and de-interlacing? If so, the extra frames may be useful in the final image. If not, it should make no difference. I don’t know the answer but assumed it was doing all the processing within each individual frame per.

I don’t really know, I just think he uses bwdif