Log in

View Full Version : Convert 720p/30 to 720i/15 with motion


sixthofmay
18th November 2024, 23:23
I would like to convert some 720p/30 video to 720i/15 with frame motion in the fields. Restated, I want to go from progressive 1280x720 at 30fps to interlaced 1280x720 at 15fps. I want the new fields created to include the motion found between the 30fps video frames. Thus it would be a real 720i/15 video.

I'm sure everyone has "why?" in their head now.

I have a 720p/30 concert video that has proven impossible to get to 1080p/30 with sufficient detail in zoomed-out wide angle shots. It was professionally shot using ancient pro videocameras at 1080i/30 (native) in low light. The footage is blurry- not out of focus, just not enough light.

I have a partial glitchy 16Mbps capture of the 1080i/30 video and a perfect capture of the 720p/30 video at 6Mbps, which is about double the minimum bitrate for decent 720p/30 and (in theory) should be workable with TVAI.

I'm using Topaz Video AI 4.2.2 and 5.3.2. I've tried all the enhancement models at 2x and 4x for Rhea (it only comes in 4x). Rhea is the latest usable model and does ok, but the performers' faces disappear when the light is too low. Rhea doesn't have any face recovery training so I gave up on it.

Iris MQ is the only strong model with face recovery training, but it's not as strong as Rhea. Regardless, it's giving the best output but lacking in detail on the zoomed-out shots.

I tried a short segment of the 1080i/30 video and Iris MQ does well with it. Clearly the higher bitrate and resolution are enough for decent quality. But it's just a short segment of when it wasn't glitching.

I have observed that the models that work with interlaced video deliver more detail, compared to the same resolution video in progressive using the same model or other progressive models (Iris and Proteus support both interlaced and progressive video).

Restated, some 480i videos can go to a sharp detailed 720p without any trouble when directly opened in TVAI. But the same 480i video if deinterlaced with Vegas' GPU Deinterlacer makes a less detailed 720p video (a container and codec supporting the interlace flag is used or else TVAI can't work).

If deinterlaced with QTGMC ("faster" preset retains the most detail for upscaling), the 720p has even less detail than the one via Vegas. Shocking but QTGMC delivers less detail than Vegas. I wasn't the one who discovered this, but have confirmed it to be true. Others have explained that QTGMC was not designed to produce maximum detail.

Thus I would like to try an experiment. Take the 720p concert video and convert it to a real 720i video, complete with motion in each field. And then see what Topaz VAI's deinterlacing models can do with it. My hypothesis is somehow the deinterlacing models extract more detail when fed interlaced video. I'm guessing they were trained with interlaced DVDs and progressive Blu-rays of the same movie or TV show.

The 15fps is not an issue. Topaz' Apollo v8 model delivers artifact free 2x and 4x framerate increases.

TLDR:

I need an Avisynth+ script to convert 720p/30 to 720i/15 with frame motion in the newly generated fields. I'll be using DGSource for input and audio is being processed separately.

I found this thread:
How to convert 30p to 30i (https://forum.doom9.org/showthread.php?t=121005)

actionman133 provided this:

Import ("MVBob.avs")
MVConv (60, 1) # or MVConv (60000, 1001) if its 29.97
AssumeTFF ()
SeparateFields ()
SelectEvery (4, 0, 3)
Weave ()


That's good, but I need to know how to incorporate the motion between the frames into the fields. Can anyone help?

Emulgator
19th November 2024, 00:31
Samples would help.
And, to make it worse for TVAI by feeding it interlaced and hoping for magic results... this won't help I guess.
Topaz 2.6.4 here, and I found no deinterlacing mode I would prefer. Maybe the later versions can do better.
Maybe only take the source 1080i30 and go from there using QTGMCp.
(The 720p30 copy should be already damaged, half of the temporal information must be butchered and smeared into neighboring lines)

poisondeathray
19th November 2024, 05:12
I would like to convert some 720p/30 video to 720i/15 with frame motion in the fields. Restated, I want to go from progressive 1280x720 at 30fps to interlaced 1280x720 at 15fps. I want the new fields created to include the motion found between the 30fps video frames. Thus it would be a real 720i/15 video.


And, to make it worse for TVAI by feeding it interlaced and hoping for magic results... this won't help I guess.


I agree with Emulgator. There is no way you can DISCARD 50% of the spatial data and get better results, assuming the video is half decent to begin with . If it was really really crappy , and not really 720p worth of resolution, but really something like 240p, then maybe it might not make a difference

The results you get might appear to have more false details and artifacts, but that's it


#your 720p30 video
AssumeTFF ()
SeparateFields ()
SelectEvery (4, 0, 3)
Weave ()

johnmeyer
19th November 2024, 07:35
In keeping with the previous two comments, I could not understand what you are trying to do because, as they said, it seems backwards and you are almost certainly going to end up with worse results than what you started out with.

sixthofmay
19th November 2024, 19:17
Samples would help.
Topaz 2.6.4 here, and I found no deinterlacing mode I would prefer. Maybe the later versions can do better.

Iris MQ in 4.2.2 finds additional detail with no visible artifacts at sane settings. Prior to that Dione Robust in 2.3.0 was usually the strongest model for interlaced, and Proteus, Artemis, or Gaia HQ for progressive. 2.6.4 was unusable (for me) because you could not disable the excessive post warpsharp TVEAI did with all the enhancing models. With 2.3.0, the json config files allowed you to disable the warpsharp (then Topaz hid the jsons in their code). 2.3.0 was the only usable 2.x.x version IMO.

3.x.x versions were too buggy so I didn't use them other than to test new versions. In 4.2.2 they finally made a decent GUI and with Iris MQ, Apollo, Chronos Fast (great if no static text), and other decent models, it's quite useful. 5.3.x has Rhea, but without face enhancement and the license changes limiting you to 1 GPU, it's not great.[/QUOTE]

I searched some more, this time for 1080p/30 to 1080i/15 conversion. The terminology others use is most confusing. 1080i/15 refers to 15 interlaced frames/sec and 30 unique fields/sec (per various wikis and blogs). Most folks in the discussions are looking for 1080p/30 to 1080i/30 (60 fields per second for broadcast), which requires additional motion information to create the new fields. But that's not what I needed for my test. I found that converting 1080p/30 to 1080i/15 requires no additional information. The same logic and code applies for 720p/30 to 720i/15 conversion.

The following script works properly. From 720p/30 it gives 30 unique fields per second and an interlaced frame rate of 15 frames per second. I verified it by adding another SeparateFields() at the end, and opened that in Virtualdub2 to see 1280x360 fields bobbing, and noted there were now twice as many images.

DGSource("myvideo.dgi", deinterlace=0)
AssumeTFF()
SeparateFields()
SelectEvery(4, 0, 3)
Weave()


With that I was able to save the video using the DirectShow version of Huffyuv 2.1.1 (32bit only) which properly carries the interlace flag into Topaz VAI.

The experiment was a bust. I could see no visible difference using Iris MQ in interlaced mode with the interlaced video. Apollo worked properly and got the enhanced progressive video back to 30 frames/sec. The mp4s I encoded at the same CRF using both methods were almost the same size, confirming what I could see. With more detail, they are typically larger and with less detail they are typically smaller.

Thanks all for sharing your thoughts.

cubicibo
20th November 2024, 13:27
Most folks in the discussions are looking for 1080p/30 to 1080i/30 (60 fields per second for broadcast), which requires additional motion information to create the new fields

Not necessarily. Any progressive frame is also two fields. 1080p30 footage can be stored in a 1080i/30 container without adding or removing any information. In fact, it is very commmon: there is wider support for 1080i/30 than 1080p30.

FranceBB
21st November 2024, 07:21
Yes. While 1080p60 can be divided in fields and encoded as 1080i30, when you're starting from 1080p30 you would just encode the progressive source as interlaced without modifying it. The TV will then bob it to 60p but instead of having motion you would have 1 progressive frame and one repeated frame, one progressive frame, one repeated frame etc.
Most TVs nowadays are even able to detect that and instead of bobbing to 60p where half the frames are duplicated, they just display the progressive source by duplicating on their own (despite it being encoded as interlaced and signaling interlaced) thus avoiding to introduce aliasing.

I live in PAL land, but I've encoded plenty of stuff at 25fps progressive as 25i by signalling that it's interlaced in the encoder.

wonkey_monkey
23rd November 2024, 21:07
Most TVs nowadays are even able to detect that and instead of bobbing to 60p where half the frames are duplicated, they just display the progressive source by duplicating on their own (despite it being encoded as interlaced and signaling interlaced) thus avoiding to introduce aliasing.

Wouldn't a decent encoder identify and encode most of it as progressive anyway? I forget the acronym.

FranceBB
24th November 2024, 05:45
Wouldn't a decent encoder identify and encode most of it as progressive anyway? I forget the acronym.

Yes, but only for H.264 I'm afraid. :(
x264 is able to encode in MBAFF and it would detect the input to be progressive and encode all frames as progressive anyway, thus being quite as efficient.

The problem is with MPEG-2 where you would still have the encoder encoding the input as if it was truly interlaced and thus being totally inefficient. :(