Go Back    Forum > Digital Video > Video Project Help > Edit Video, Audio

Reply
 
LinkBack Thread Tools
  #1  
09-28-2013, 05:45 AM
metaleonid metaleonid is offline
Free Member
 
Join Date: Aug 2011
Location: Fort Lee, New Jersey
Posts: 502
Thanked 19 Times in 17 Posts
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.

Last edited by metaleonid; 09-28-2013 at 06:01 AM.
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Ads / Sponsors
 
Join Date: ∞
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
  #2  
09-28-2013, 08:06 AM
juhok juhok is offline
Free Member
 
Join Date: Sep 2009
Posts: 379
Thanked 108 Times in 88 Posts
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

Last edited by juhok; 09-28-2013 at 08:55 AM.
Reply With Quote
The following users thank juhok for this useful post: metaleonid (09-28-2013)
  #3  
09-28-2013, 01:32 PM
metaleonid metaleonid is offline
Free Member
 
Join Date: Aug 2011
Location: Fort Lee, New Jersey
Posts: 502
Thanked 19 Times in 17 Posts
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?
Reply With Quote
  #4  
09-28-2013, 01:36 PM
juhok juhok is offline
Free Member
 
Join Date: Sep 2009
Posts: 379
Thanked 108 Times in 88 Posts
Never heard of it. Check this list out: http://avisynth.nl/index.php/External_filters
Reply With Quote
  #5  
09-28-2013, 01:37 PM
metaleonid metaleonid is offline
Free Member
 
Join Date: Aug 2011
Location: Fort Lee, New Jersey
Posts: 502
Thanked 19 Times in 17 Posts
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?
Reply With Quote
  #6  
09-28-2013, 01:39 PM
juhok juhok is offline
Free Member
 
Join Date: Sep 2009
Posts: 379
Thanked 108 Times in 88 Posts
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.
Reply With Quote
The following users thank juhok for this useful post: metaleonid (09-28-2013)
  #7  
09-28-2013, 01:42 PM
metaleonid metaleonid is offline
Free Member
 
Join Date: Aug 2011
Location: Fort Lee, New Jersey
Posts: 502
Thanked 19 Times in 17 Posts
I'll look. Thanks.
Reply With Quote
  #8  
09-28-2013, 02:06 PM
admin's Avatar
admin admin is offline
Site Staff | Web Development
 
Join Date: Jul 2003
Posts: 4,308
Thanked 658 Times in 457 Posts
Quote:
Originally Posted by juhok View Post
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.

- Did this site help you? Then upgrade to Premium Member and show your support!
- Also: Like Us on Facebook for special DVD/Blu-ray news and deals!
Reply With Quote
  #9  
09-28-2013, 03:11 PM
msgohan msgohan is offline
Free Member
 
Join Date: Feb 2011
Location: Vancouver, Canada
Posts: 1,323
Thanked 336 Times in 277 Posts
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.
Reply With Quote
  #10  
09-28-2013, 03:59 PM
admin's Avatar
admin admin is offline
Site Staff | Web Development
 
Join Date: Jul 2003
Posts: 4,308
Thanked 658 Times in 457 Posts
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.

- Did this site help you? Then upgrade to Premium Member and show your support!
- Also: Like Us on Facebook for special DVD/Blu-ray news and deals!
Reply With Quote
  #11  
09-28-2013, 04:34 PM
juhok juhok is offline
Free Member
 
Join Date: Sep 2009
Posts: 379
Thanked 108 Times in 88 Posts
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.
Reply With Quote
  #12  
09-28-2013, 04:41 PM
admin's Avatar
admin admin is offline
Site Staff | Web Development
 
Join Date: Jul 2003
Posts: 4,308
Thanked 658 Times in 457 Posts
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.

- Did this site help you? Then upgrade to Premium Member and show your support!
- Also: Like Us on Facebook for special DVD/Blu-ray news and deals!
Reply With Quote
  #13  
09-28-2013, 04:47 PM
juhok juhok is offline
Free Member
 
Join Date: Sep 2009
Posts: 379
Thanked 108 Times in 88 Posts
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().
Reply With Quote
  #14  
09-28-2013, 04:52 PM
admin's Avatar
admin admin is offline
Site Staff | Web Development
 
Join Date: Jul 2003
Posts: 4,308
Thanked 658 Times in 457 Posts
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!

- Did this site help you? Then upgrade to Premium Member and show your support!
- Also: Like Us on Facebook for special DVD/Blu-ray news and deals!
Reply With Quote
  #15  
09-28-2013, 04:57 PM
juhok juhok is offline
Free Member
 
Join Date: Sep 2009
Posts: 379
Thanked 108 Times in 88 Posts
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.
Reply With Quote
  #16  
09-28-2013, 05:33 PM
metaleonid metaleonid is offline
Free Member
 
Join Date: Aug 2011
Location: Fort Lee, New Jersey
Posts: 502
Thanked 19 Times in 17 Posts
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
Reply With Quote
  #17  
09-28-2013, 05:56 PM
msgohan msgohan is offline
Free Member
 
Join Date: Feb 2011
Location: Vancouver, Canada
Posts: 1,323
Thanked 336 Times in 277 Posts
Quote:
Originally Posted by metaleonid View Post
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.
Reply With Quote
The following users thank msgohan for this useful post: metaleonid (09-28-2013)
  #18  
09-28-2013, 08:06 PM
metaleonid metaleonid is offline
Free Member
 
Join Date: Aug 2011
Location: Fort Lee, New Jersey
Posts: 502
Thanked 19 Times in 17 Posts
Quote:
Originally Posted by msgohan View Post
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 View Post
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.
Reply With Quote
  #19  
09-28-2013, 08:51 PM
metaleonid metaleonid is offline
Free Member
 
Join Date: Aug 2011
Location: Fort Lee, New Jersey
Posts: 502
Thanked 19 Times in 17 Posts
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.
Reply With Quote
  #20  
09-29-2013, 01:54 PM
msgohan msgohan is offline
Free Member
 
Join Date: Feb 2011
Location: Vancouver, Canada
Posts: 1,323
Thanked 336 Times in 277 Posts
Quote:
Originally Posted by metaleonid View Post
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 View Post
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.
Reply With Quote
The following users thank msgohan for this useful post: metaleonid (09-29-2013)
Reply




Similar Threads
Thread Thread Starter Forum Replies Last Post
Video Bit Rate is 350mb for AVI, but larger for a DVD? xoanon Encode, Convert for discs 3 07-17-2013 10:35 PM
Video conversion: Line TBC vs Full Frame TBC Mejnour Project Planning, Workflows 1 02-01-2012 02:50 AM
Frame rate trouble in DVD Architect Reading Bug Encode, Convert for discs 15 12-31-2009 01:39 PM
Interlacing on HD progressive displays? admin Capture, Record, Transfer 2 12-02-2009 12:42 PM
Interlaced vs. non-interlaced artifacts? via Email or PM Capture, Record, Transfer 1 04-16-2009 05:37 PM

Thread Tools



 
All times are GMT -5. The time now is 08:28 PM