digitalFAQ.com Forum

digitalFAQ.com Forum (https://www.digitalfaq.com/forum/)
-   Edit Video, Audio (https://www.digitalfaq.com/forum/video-editing/)
-   -   Interlaced video to progressive (double frame rate) (https://www.digitalfaq.com/forum/video-editing/5403-interlaced-video-progressive.html)

metaleonid 09-28-2013 05:45 AM

Interlaced video to progressive (double frame rate)
 
Hi,

What would be the proper way using AVISynth to do so?

The basic script is this (assuming Huffyuv AVI source).

bob(AssumeTFF(AVISource("file.avi")))

I believe I will either need to move odd fields one scan line up or even fields one scan line down. What's the proper syntax for this?

Alternatively I can use TDeint:
TDeint(AVISource("HuffyuvFile.avi"), 1, 1)

Any other parameters for TDeint?

Thanks.

juhok 09-28-2013 08:06 AM

You don't have to move fields with Bob, but that's beside the point because dumb Bob is horrible quality and not fit for viewing.

I would recommend among else; for speed/quality (YadifMod, NNEDI3):
Code:

YadifMod(mode=1, edeint=NNEDI3(field=-2)) # double rate, do spatial check
for quality:
http://forum.doom9.org/showthread.php?t=156028

metaleonid 09-28-2013 01:32 PM

Noted. I tried TDeint(AVISource("HuffyuvFile.avi"), 1, 1) and the results are pretty good. Let me look at QTGMC. Is Phosphor available for AVISynth?

juhok 09-28-2013 01:36 PM

Never heard of it. Check this list out: http://avisynth.nl/index.php/External_filters

metaleonid 09-28-2013 01:37 PM

Ok this thread QTGMC is a lot of reading. Now all I need is double frame rate at best possible quality. What would that be for QTGMC?

juhok 09-28-2013 01:39 PM

QTGMC is considered to the best by many Avisynth users. If you mean what settings are good, there's a readme file that comes with the package.

metaleonid 09-28-2013 01:42 PM

I'll look. Thanks.

admin 09-28-2013 02:06 PM

Quote:

Originally Posted by juhok (Post 27940)
QTGMC is considered to the best by many Avisynth users. If you mean what settings are good, there's a readme file that comes with the package.

Use QTGMC. Don't even bother with the other (older!) methods. Yadif was great pre-QTGMC, but not the best now.

Code:

# Load the source, either AVI or demuxed MPEG video
# avisource("c:\video.avi")
# ffvideosource("c:\video.m2v")

# First convert colorspace. Then deinterlace, selecting the even field as dominant.
ConvertToYV12()
QTGMC(Preset="Slow")
SelectEven()

# Other common Avisynth filters
# Deen() # remove edge noise
# Spline36Resize(720,480) # resize to Full D1 if needed
# Cnr2("xoo",4,2,64) # remove chroma banding noise, wide UV setting

Here's a snippet of the code we're putting into our Q4 2013 / Q1 2014 Avisynth guides. :)

Uncomment # as needed.

Why double the framerate? It won't improve anything.

msgohan 09-28-2013 03:11 PM

Bobbing ("doubling the frame rate") preserves the temporal information from the source while interpolating spatial information. Your usage of SelectEven() throws away half the temporal data.

admin 09-28-2013 03:59 PM

It does not. Doubling a framerate has no effect on truly interlaced source because simply doubling it does not unweave the image data.
I wish it were -- that'd be so much easier! Alas, it's not.

juhok 09-28-2013 04:34 PM

Maybe we're talking about different things here? For example, 50i is 50 fields per second (to demonstrate take pure interlaced clip and do "SeparateFields()"). With QTGMC we will use some smart motion compensation etc and stretch the fields into 50 full frames with high quality, which still have full temporal resolution - 50 individual points in time per second. With SelectEven() or SelectOdd() we throw half of this away. All this is pretty easy to see / compare.

admin 09-28-2013 04:41 PM

I always hate the "i" notations. They didn't really show up until a few years ago, and it even tripped me up at first.
25 fps = 50i
29.97 fps = "60i" / 59.94i

Every second (fps!) is half an image. Those are the fields.

It's not the same as the "p" measurements == 25p, 50p, "30p"/29.97p, "60p"/59.94p

In theory, I'd agree that QTGMC can create the 50p ("double" 25fps = 50fps/50p) from 50i. But not sure if it makes much difference seeing that the source was 25fps (50i).

My advice: Don't make things more complicated than they already are. :)

juhok 09-28-2013 04:47 PM

Well, to speak in SMPTE:
576i/25 is 50 unique points in time and 576p/25 is 25 unique points in time. When dealing with 576i/25 (most analog- and DV age camcorders etc) we are throwing half of the temporal resolution away with SelectEven/Odd().

admin 09-28-2013 04:52 PM

My next question would be with usage. If not for DVD, and maybe not Blu-ray, what's it for?
I think my reference is more disc-based, so I do think we're talking about (slightly) different things here. But somewhat the same.

I know you know you're stuff, so no disgreements here. :)

So going back a few posts ---

To metaleonid:
1. Why deinterlace?
2. And why double the framerate?

Be sure it's needed!

juhok 09-28-2013 04:57 PM

For DVD/Blu-ray I would (and do) keep it 576i/25 so there's no conversion really. I'd think that some people want to do HQ de-interlacing "manually" because realtime-while-viewing de-interlacers lack in quality in comparison. For my own stuff, I keep them archived in the original format and accept the non-optimal realtime quality when viewing - I'm only picky when doing stuff for customers / friends. :)

edit: And 25/50 difference is of course the fluidity of the motion. It varies greatly how well people see the difference. Some are very picky, many don't notice / care.

metaleonid 09-28-2013 05:33 PM

So 59.94i = 29.97fps of interlaced footage, right? For Pal 50i = 25fps of interlaced footage, right?

I want double frame rate to convert to 59.94p or to 50p to achieve fluidity of the motion.

I loaded the original Huffyuv 29.97fps interlaced footage into VLC and watched it with various options:
no deinterlacing, various interlacing without doubling frame rate.
VLC has a bug and displays wrong field order for TFF footages when using double deinterlacers like bob, linear, yadif(2x) and Phosphor so I didn't bother with it.

I converted my interlaced Huffyuv footage with TDeint into 59.95p Huffyuv AVI using double frame rate. I was very pleased with result and fluidity of the motion. It was way better than loading plain interlaced footage into VLC. If QTGMC is better than TDeint at doing what TDeint does, then I will be more than happy.
Flat screen TV is going to deinterlace interlaced footage anyway. I am certain that if I do myself it with double frame rate into 59.94p with QTGMC or TDeint, the motion and overall quality will be better. My end result most likely will be in Blu-Ray, but that will be another question.

PS. The bug about wrong field order was reported a year ago, but I doubt it will ever get fixed 'cause the VLC developer the bug is assigned to is stubborn and lazy: https://trac.videolan.org/vlc/ticket/7713

msgohan 09-28-2013 05:56 PM

Quote:

Originally Posted by metaleonid (Post 27969)
VLC has a bug and displays wrong field order for TFF footages when using double deinterlacers like bob, linear, yadif(2x) and Phosphor so I didn't bother with it.

It works correctly for me with MPEG-2 files. AVIs are always assumed to be BFF, just like in AviSynth (when you don't manually set it).

Quote:

My end result most likely will be in Blu-Ray, but that will be another question.
Thing is, Blu-ray doesn't support any frame rate higher than 29.97 for SD resolutions. You would have to upscale to 720p.

metaleonid 09-28-2013 08:06 PM

Quote:

Originally Posted by msgohan (Post 27971)
It works correctly for me with MPEG-2 files. AVIs are always assumed to be BFF, just like in AviSynth (when you don't manually set it).

I just tested mpg and it worked fine. However, it doesn't work for fine for DVDs that I authored. How do I manually set field order in the avi file?


Quote:

Originally Posted by msgohan (Post 27971)
Thing is, Blu-ray doesn't support any frame rate higher than 29.97 for SD resolutions. You would have to upscale to 720p.

Thanks. I didn't know that as I am not too familiar with Blu-Ray. So then here
http://en.wikipedia.org/wiki/Blu-ray_Disc#Video
1280×720 60p (59.94p) 16:9

What do I need to do in AVISynth to achieve this format given the fact that my source footage would be 720x480 4:3. I guess I need to add borders and upscale it, right? Or upscale it 1st and then add borders. I will do some math and come back here.

metaleonid 09-28-2013 08:51 PM

So if I have 720x480 SD footage, I guess I need to add 240 horizontal pixels (120 each side) using AddBorders and then perform resize to 1280x720 to get the correct aspect ratio.

msgohan 09-29-2013 01:54 PM

Quote:

Originally Posted by metaleonid (Post 27983)
I just tested mpg and it worked fine. However, it doesn't work for fine for DVDs that I authored. How do I manually set field order in the avi file?

Are the DVDs that you authored flagged for TFF?

My understanding is that AVI contains no capacity for metadata about field order.

Quote:

Originally Posted by metaleonid (Post 27987)
So if I have 720x480 SD footage, I guess I need to add 240 horizontal pixels (120 each side) using AddBorders and then perform resize to 1280x720 to get the correct aspect ratio.

We don't recommend it because if you later get hardware or software that does better upscaling, you can never revert your resized video to the original to benefit from it.

If you're going to do it, I would resize to 960x720 and then add 320 on each side, simply for the sake of a nice clean border.


All times are GMT -5. The time now is 02:56 AM

Site design, images and content © 2002-2024 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2024 Jelsoft Enterprises Ltd.