View Full Version : Weave warning
Waleska
4th January 2009, 06:57
I get the following warning interleaving a regular, telecined NTSC video file from a commercial DVD.
"Weave: Weave should be applied on field-based material: use AssumeFieldBased() beforehand"
My script:
AssumeTFF()
Weave()
Adding "AssumeFieldBased()" gets rid of the warning but results in 720x960 frames :confused:
Please notice I'm only using Weave to figure out decent settings for doing IVTC with Dcomb.
Thanks in advance :cool:
neuron2
4th January 2009, 07:01
Your application of weave() makes no sense to me. Can you explain it more please?
Also, you talk about interleaving and then weaving. These are not the same thing.
Waleska
4th January 2009, 07:13
I'm sorry about the confusion, I didn't know weaving was different from interleaving. All I wanted to do is what's explained here: http://avisynth.org/mediawiki/Weave , create a frame out of 2 fields.
neuron2
4th January 2009, 07:37
But you already have frames made of two fields. Again, you're just not making any sense to me.
You can only weave a stream of fields, not a stream of frames. A stream of frames can be converted to a stream of fields by applying SeparateFields, for example.
Waleska
4th January 2009, 07:55
I must have gotten everything wrong. I thought a telecined DVD movie contained a stream of fields you could weave together in order to create progressive video for displaying on progressive screens.
neuron2
4th January 2009, 08:07
Yes, you got everything wrong. Time to study the basic concepts more thoroughly. There is ample material readily available.
Waleska
4th January 2009, 09:22
I'll be damned :confused: , but just to confirm; could you then imply that the combing seen in this image is not the product of weaving two fields that belong to different frames?
http://i39.tinypic.com/igc7ea.png
IanB
4th January 2009, 12:21
Well that will depend on the original source, film or video.
With film, inverse telecine is all about recognising the field pattern and recovering the original complete frames.
With video each field exists at a separate instance in time, 1/60th of a second apart (or 1/50th for PAL). There will be no uncombed frames (except for static scenes)
Leak
4th January 2009, 12:43
Adding "AssumeFieldBased()" gets rid of the warning but results in 720x960 frames :confused:
Weave takes pairs of two of your source frames and interleaves their lines, thus doubling the height (and introducing combing if the frames either weren't really fields or came from a different point in time).
But frames off a DVD are already weaved - if you run Weave on them you'll get a mess, like you've seen.
If for some reason you want the fields separated, you'll either have to call, well, SeparateFields (which does the inverse of Weave, but of course leaves you with half-height frames) or use one of the many more or less smart Bob filters available for AviSynth (Bob, (Leak-)KernelBob, DGBob, MVBob, yadif, etc.)...
Though if your DVD is telecined and you want to get progressive video you should either use DGIndex/DGMpgDec and it's "Force film" mode (in case of flag-based soft telecine) or run the frames through any of the available fieldmatching/decimation filters like Decomb or TIVTC to get rid of any inserted duplicate fields and get smooth, 23.976 FPS video instead.
np: Tocotronic - Cheers For Fears (Pure Vernunft Darf Niemals Siegen)
Waleska
4th January 2009, 13:09
Well that will depend on the original source, film or video.
With film, inverse telecine is all about recognising the field pattern and recovering the original complete frames.
With video each field exists at a separate instance in time, 1/60th of a second apart (or 1/50th for PAL). There will be no uncombed frames (except for static scenes)
Well, guess I'm not mistaken about the weaving thing. The original source was film, then it had those 24 full frames per second split+telecined into 60 fields (half-frames) per second for the DVD, but then, as I try to combine 2 fields into one full frame, I get aforementioned error and I'm still wondering why :confused:
Weave: "it takes pairs of fields from the input video clip and combines them together to produce interlaced frames"
Leak
4th January 2009, 13:38
Weave: "it takes pairs of fields from the input video clip and combines them together to produce interlaced frames"
Yes, but that assumes your video clip consists of nothing but fields (i.e. half-height images that don't have any combing). Any video source used to read DVDs or interlaced video files will always return frames made up of already weaved fields.
Internally to AviSynth, fields and frames are the same (that is, simply images), except for a flag that's set by Weave/SeparateFields/AssumeFrameBased/AssumeFieldBased and a few other filters that convert one into the other.
*You* can detect fields by looking at the image and noticing it's squished vertically (since fields are half-height), but AviSynth can't, so you have to tell it what's what. You could, for example, also split a progressive video into fields, and you'd get half-height images that don't have combing when recombined via Weave.
Please discard your seemingly fixed idea that just because your video is interlaced AviSynth is getting the fields; if you look at your video in, say, VirtualDub and you see combing, you're seeing two fields weaved into a frame (because that's what video codecs work on). If you want single fields, please (re-)read my post above.
If you want to see what AviSynth's idea of the current frame is just throw a call to the Info filter at the end of your script, which will tell you whether AviSynth thinks the current image is field- or framebased.
np: Tocotronic - Kapitulation (Kapitulation)
neuron2
4th January 2009, 16:23
I'll be damned :confused: , but just to confirm; could you then imply that the combing seen in this image is not the product of weaving two fields that belong to different frames? No, it is the product of weaving two fields that belong to different pictures. When you can appreciate the importance of that distinction you will then have a proper understanding of what is going on. It's misleading to say that fields of a picture belong to frames because there are different valid ways of placing them, e.g., straight progressive, progressive with a one-field shift, pulled-down.
Waleska
5th January 2009, 08:29
No, it is the product of weaving two fields that belong to different pictures. When you can appreciate the importance of that distinction you will then have a proper understanding of what is going on. It's misleading to say that fields of a picture belong to frames because there are different valid ways of placing them, e.g., straight progressive, progressive with a one-field shift, pulled-down.
I re-read the Video Basics (http://www.doom9.org/video-basics.htm) but it doesn't make a distinction between frames and pictures, in fact, it states they are the same; "When we watch these movies in the movie theater we get to see 24 pictures (also known as frames) per second"
Any explanation offered would be most appreciated.
Any video source used to read DVDs or interlaced video files will always return frames made up of already weaved fields
Do you actually mean "software" instead of "source", if not, you totally lost me :confused:
All I can gather from everything you people have said is that weaving my DVD video is redundant because it's somehow being done already? and at this point I'm not even sure I got that one right.
This is getting more complicated by the minute.
Leak
5th January 2009, 12:10
Do you actually mean "software" instead of "source", if not, you totally lost me :confused:
We're talking about AviSynth here, and anything that loads sequences of images (nee "video") is called either a "source" (AVISource, DirectShowSource, MPEG2Source, QTSource, ...) or a
"reader" (ImageReader, ...).
All I can gather from everything you people have said is that weaving my DVD video is redundant because it's somehow being done already? and at this point I'm not even sure I got that one right.
Oh, COME ON already... :mad:
Every video frame (yes, even progressive video) has two fields: odd and even. The even field are all lines of the image with an even number (line 0,2,4,6,...), the odd field are all lines of the image with an odd number (line 1,3,5,7,...). If you separate those fields, you get two images of half the original height where every other line is missing.
To get something watchable you need to watch both fields together (or the image height will be off), but unless the video is progressive or there is no motion at all you will get comb artifacts since both fields don't show the same point in time.
If you only have one field (like with live video), you'll simply have to make the other field up - that's called deinterlacing.
To put it bluntly: IF IT ALREADY IS 720x480 (or 720x576 for PAL), *DON'T* USE WEAVE ON YOUR VIDEO. IF IT HAS COMBS, *DEINTERLACE* IT.
What is so hard about this? Just *LOOK* at your video (or use Info to get it's dimensions), and unless everything is totally squished you don't need to call Weave, ever.
It's not rocket science...
Since your video seems to be some theatrical movie on DVD, it'll be telecined - and the correct process to remove that is inverse telecine, also called IVTC. Just search this forum for that term, or read the AviSynth documentation that's installed along with it (Start Menu > AviSynth 2.5 > AviSynth Documentation > External Filters > Deinterlacing & Pulldown Removal).
neuron2
5th January 2009, 14:55
I re-read the Video Basics (http://www.doom9.org/video-basics.htm) but it doesn't make a distinction between frames and pictures, in fact, it states they are the same; "When we watch these movies in the movie theater we get to see 24 pictures (also known as frames) per second"
Any explanation offered would be most appreciated. "Picture" has multiple usages. Part of understanding things is to know its different usages. The usage I am currently using is that a picture is a sample of a scene from a particular moment in time. Suppose we have an interlaced clip. Then each frame (pair of weaved fields) contains fields from two different pictures because the fields are sampled at the field rate (1/60th second for NTSC). When you step through the fields you see a change every field, i.e., a new picture every field.
Another usage of "picture" is as the encoding unit of MPEG2.
All I can gather from everything you people have said is that weaving my DVD video is redundant because it's somehow being done already? Your decoder always returns frames, i.e., pairs of weaved fields. The decoder returns frames because that is what people watch. As far as storage on the DVD is concerned, the data may be stored as fields or frames depending on encoding decisions, but the decoder always returns frames.
Waleska
5th January 2009, 15:12
@Leak: I already had a good idea of everything else you mentioned. If you read my first post you'll notice I was just trying to properly combine them fields to get full frames and then step forward to figure out the pulldown pattern so I could tweak Dcomb more adequately and achieve a better IVTC.
What I seem to understand better now is the difference between video originally shot progressively and video originally shot interlacedly, where each field is from a moment in time and apparently the kind of video that benefits from weave because it doesn't have an upper/lower field.
So, if the video on my DVD was stored interlacedly and Avisynth refuses to apply weave(), does that mean there's certain information somewhere in the video telling it "these are the even lines of a frame, I already know I have to combine them with the odd ones and how, so let's not weave"?
Thanks everyone for your patience and sorry for not being particualrly bright about this :D
neuron2
5th January 2009, 15:27
What I seem to understand better now is the difference between video originally shot progressively and video originally shot interlacedly, where each field is from a moment in time and apparently the kind of video that benefits from weave because it doesn't have an upper/lower field. Videos don't "benefit" from weave while others do not. And they don't have the option to be weaved or not by the decoder. So Avisynth is not doing any weaving. The decoder returns FRAMES. A frame is always two weaved FIELDS. The fields may be both from the same picture or they may be from two different pictures.
So, if the video on my DVD was stored interlacedly and Avisynth refuses to apply weave(), does that mean there's certain information somewhere in the video telling it "these are the even lines of a frame, I already know I have to combine them with the odd ones and how, so let's not weave"? The decoder always returns weaved frames, because a frame just is a pair of weaved fields. How it is encoded on the DVD is irrelevant because the decoder always returns frames. Obviously the decoder will weave fields into frames if the MPEG2 uses field structure.
2Bdecided
5th January 2009, 16:42
720x480 is a video frame.
720x240 is a video field.
720x960 is a **** up.
How difficult is it?! ;)
Cheers,
David.
2Bdecided
5th January 2009, 16:43
The decoder returns FRAMES.
...
The decoder always returns weaved frames
...
the decoder always returns framesI've got it now. The decoder returns fields.
;)
btw, on a serious note (Waleska, please stop reading now - this will just confuse you), I disagree with your assertion neuron2 that progressive video also consists of fields. I know the circumstances where you can say that if you want to, and also those where it's actually true (PsF and SD analogue broadcast), but it's not universally true. Obviously YouTube clips, and 4k digital film do not consist of fields in any sense - and progressively encoded SD video (e.g. 720x576p25 encoded in MPEG-2 frame mode) doesn't really either.
Cheers,
David.
Gavino
5th January 2009, 16:48
... Avisynth refuses to apply weave() ...
As neuron2 has explained, a source clip always consists of weaved frames once it has been decoded into Avisynth.
Therefore, it is logical that Avisynth refuses to apply weave() on such a clip.
However, if you subsequently apply a filter like SeparateFields(), thus 'tearing apart' the frames into individual fields, Avisynth remembers this and allows you to apply Weave() to put them back together again.
You might find it useful to read this wiki page (http://avisynth.org/mediawiki/Interlaced_fieldbased).
neuron2
5th January 2009, 17:07
I disagree with your assertion neuron2 that progressive video also consists of fields In the sense that is relevant here, i.e., what you get from a decoder in Avisynth, and which is then separable using SeparateFields(), any frame can be considered to consist of a set of even lines and a set of odd lines, or in common parlance, two weaved fields.
Waleska
5th January 2009, 19:01
So 24 frames (progressive) per second end up being 30 weaved fields per second after telecine, yet MPEG2 decoders choose to output these fields the way they were originally stored (weaved) or one after the other (interlacedly) depending on the target screen?
neuron2
5th January 2009, 19:09
The decoder does not decide how to display the decoded frames. The display process decides that. Assuming you are talking about soft telecine, the display process will have both the progressive frames and the pulldown flags. The display process can either just display the progressive frames at 24fps, or it can "pull down" extra fields as specified by the pulldown flags to output 30fps. The display process will output data appropriately for the attached display device. It typically offers options in that regard if the device is capable of supporting different interfaces.
Waleska
5th January 2009, 19:17
Nope, I was talking about the older type of pulldown where an actual field duplication occurs, which means flags are not required.
neuron2
5th January 2009, 19:35
Some display processes are capable of detecting hard telecine and removing it for display (IVTC). Some are not capable of that and can only do IVTC with soft telecine.
Waleska
5th January 2009, 19:44
I just wanted confirmation for my first post on the second page of this thread, and I think your reply "The display process decides that" does it :)
2Bdecided
5th January 2009, 21:27
MPEG2 decoders choose to output these fields the way they were originally stored (weaved) or one after the other (interlacedly) depending on the target screen?In a PC environment, the MPEG-2 decoder itself always outputs full frames. For NTSC interlaced content, or 24p with pulldown flags honoured, or hard telecine, this will be 30 frames per second. For 24p with pulldown flags (actually "repeat field" flags) ignored, this will be 24 frames per second.
You're questioning this as if it matters. All that matters is that the first line after the SOMETHINGsource command in AVIsynth receives full frames (weaved fields, if you prefer).
What matters is whether those fields are from the same temporal moment, or different temporal moments. What the MPEG-2 encoder and decoder might or might not have done with them internally is irrelevant - they're often set up to do the opposite of what you might expect - it doesn't matter (to you).
Cheers,
David.
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.