View Full Version : Progressive -> Interlaced
zambelli
9th February 2004, 13:24
I have a progressive PAL video (25p) which I'd like to interlace (50i) in order to prepare it for broadcast. Is there a way I can do this in Avisynth?
aklendathu
9th February 2004, 14:13
You could try this ('borrowed' from Scharfi's Brain NTSC 24p -> PAL 25i script)
AVISource("I:\File.avi")
ChangeFPS(50)
# Convert to PAL interlaced output by taking even lines from one
# frame and odd lines from another. Normally (4,0,3) works for DVDs
# (top field first) while (4,1,2) works for DV (bottom field first).
SeparateFields()
SelectEvery(4,0,3)
Weave()
AssumeFPS(25)
I think this would give you 25i PAL from 25p PAL ...
Pedro.
ronnylov
9th February 2004, 14:42
25 fps can be broadcasted in PAL without any converion of the video file to interlaced, in the same way as movies are sent on TV. No converion is needed!
bb
9th February 2004, 16:55
Sounds silly, but if you really need 50i, I'd say all you need to do is
SeparateFields()
Still wonder why you'd want to do this...
bb
sh0dan
9th February 2004, 17:13
... I would say you shouldn't do anything! ;)
25fps progressive do not have anything to display in the missing field, so you should just keep it as 25fps progressive, and you'll get the best result. Adding a blended field is not likely to make it look any better.
zambelli
10th February 2004, 01:56
Originally posted by aklendathu
You could try this ('borrowed' from Scharfi's Brain NTSC 24p -> PAL 25i script)
I think this would give you 25i PAL from 25p PAL ...
Thanks Pedro,
This is very close to what I'm trying to achieve, except that it speeds up the final video to 2x the original speed because you're dropping every other frame. If you change the AssumeFPS to ChangeFPS, the playback rate is good, but the playback is choppy because every other frame is missing.
zambelli
10th February 2004, 02:10
I'm sorry, I wrote the original post in a hurry. I should've elaborated and explained the entire problem.
I need to generate some 50i (weaved) content in order to be able to test interlaced encoding and playback. The trouble is: my source content is 25p and I have no 50i content readily available to replace it with. So I need to cheat a little bit and interlace the progressive content. Or, in other words, it needs to *look* interlaced.
It's interesting how difficult it actually is to find good resources or plugins for doing this. It seems like everyone only talks about deinterlacing, but nobody actually considers going the other way. :confused:
The best technique I've found so far is actually integrated into Adobe Premiere Pro. Under Field Options of every video track there is an option called "Interlace Consecutive Frames". Here's what the help says:
Converts pairs of consecutive progressive-scan (noninterlaced) frames into interlaced fields. This option is useful for converting 60-fps progressive-scan animations into 30-fps interlaced video, because many animation applications don't create interlaced frames.
It seems to work quite well, but I was wondering if it were possible to do it in AviSynth too.
morsa
10th February 2004, 06:15
What you are saying is a nonsense, because
quote:
--------------------------------------------------------------------------------
Converts pairs of consecutive progressive-scan (noninterlaced) frames into interlaced fields. This option is useful for converting 60-fps progressive-scan animations into 30-fps interlaced video, because many animation applications don't create interlaced frames.
--------------------------------------------------------------------------------
It is obvious to go from 60 progressive (60p) to 30 interlaced (30i), you just select one field from the first and the other from the following and you end up with 30 interlaced.
In Avisynth you can go both ways ,from 30i to 60p and from 60p to 30i.
What you are trying to do is completly different you want to go from 25 p to 50i (not from 50 p to 25i which is the normal PAL video transmition).
The only solution I can give you is:
You could use framedoubler from Tbarry to double your 25p to 50p and then interleave them selecting even and odd to get 25i.
Or you could use Motionperfect to synthesize new frames to go from 25p to 50p and then use Avisynth to go from 50p to 25i.
There are no other ways.
Kika
10th February 2004, 09:49
Maybe a simple Phase Shift will solve his Problem.
SeparateFields()
Trim(1,0).Weave()
zambelli
11th February 2004, 00:51
Originally posted by morsa
What you are saying is a nonsense, because
It is obvious to go from 60 progressive (60p) to 30 interlaced (30i), you just select one field from the first and the other from the following and you end up with 30 interlaced.
In Avisynth you can go both ways ,from 30i to 60p and from 60p to 30i.
What you are trying to do is completly different you want to go from 25 p to 50i (not from 50 p to 25i which is the normal PAL video transmition).
The only solution I can give you is:
You could use framedoubler from Tbarry to double your 25p to 50p and then interleave them selecting even and odd to get 25i.
Or you could use Motionperfect to synthesize new frames to go from 25p to 50p and then use Avisynth to go from 50p to 25i.
There are no other ways.
Morsa, I think we're having a misunderstanding over nomenclature. When I say 50i, I mean 50 "fields per second". When weaved, this is is 25 frames per second, full resolution - interlaced. This is what you're referring to when you say 25i, right? To me "field" means "half a frame". Would you disagree with this definition?
In Avisynth, when you go from 30i (what I would refer to as 60i) to 60p, you're only retaining half of your vertical resolution. 640x480 becomes 640x240.
morsa
11th February 2004, 01:31
Not completly right.
If you use DGbob that isn't the case.The resolution will only decrease on moving parts.
BTW this is not the original topic.
With 25i I mean 50 fields, with 25p I mean 25 complete frames.
With 60i I mean 60 fields and 60p is 60 complete frames, 720x480 in any of its flavors.
Going on topic again if you want to go from 25p to 50 fields, and have the smoothness of video, the only solution is to sinthesize the missing fields with any of the methods I've mentioned above.
Sorry if I misunderstood you or If I'm not completly clear.
Anyway if you are having trouble using avisynth for your task you could try this:
http://forum.doom9.org/showthread.php?s=&threadid=70257
zambelli
11th February 2004, 03:18
Originally posted by morsa
Not completly right.
If you use DGbob that isn't the case.The resolution will only decrease on moving parts.
But DGBob will turn 60i into 60p by reconstructing missing lines. You'll start with a 30 fps video (60i weaved) and end up with a 60 fps video (60p). Correct?
What I mean by "half vertical resolution" is that if you take a 30 frames per second (30p) 640x480 video and run SeparateFields(), you're going to end up with a 60 fps 640x240 video. This is where I think we're having differences over the nomenclature. Even though the AVI framerate is 60 fps, it's really 60 fields per second, not 60 frames per second because only half a frame is rendered every 1/60th of a second. I call this 60i and use the i to denote fields, rather than frames. A little confusing, I admit, but I'm not the first one to ever use that syntax.
BTW this is not the original topic.
With 25i I mean 50 fields, with 25p I mean 25 complete frames.
With 60i I mean 60 fields and 60p is 60 complete frames, 720x480 in any of its flavors.
Wait... 25i to you means 50 fields, but 60i means 60 fields. Why? Don't you find that confusing?
Going on topic again if you want to go from 25p to 50 fields, and have the smoothness of video, the only solution is to sinthesize the missing fields with any of the methods I've mentioned above.
Sorry if I misunderstood you or If I'm not completly clear.
My goal:
I want to take my 720x576 25fps progressive AVI and turn it into a 720x576 25fps interlaced AVI. The "25fps" here refers to the framerate of the AVI, just to be clear.
scharfis_brain
11th February 2004, 07:35
I want to take my 720x576 25fps progressive AVI and turn it into a 720x576 25fps interlaced AVI. The "25fps" here refers to the framerate of the AVI, just to be clear.
As said above do NOTHING !
btw. just live with it, that 25i and 50i or 30i and 60i are the same. It's not well defined.
bb
11th February 2004, 11:32
If you need the "interlaced look", i.e. the combing artefacts in each frames, Kika gave the perfect answer. You'll lose a single field at the very beginning, but there's no way to avoid that. This is what people call "phase-shift"; you may encounter the phase-shift e.g. when capturing (originally progressive) film from TV.
But beware: there's a big difference between phase-shifted and "truly" interlaced video: the first can be reconstructed to progressive video, whereas the second needs to be deinterlaced to get progressive video (including resolution loss and artefacts).
bb
morsa
12th February 2004, 00:42
That's why I told before to generate the intermediate fields that don't exist through framedoubler or MotionPerfect.
@Zambelli
I know I made a mistake with my nomenclatures for different frame formats, sorry.Anyway that's not the point.
zambelli
12th February 2004, 23:43
Originally posted by bb
If you need the "interlaced look", i.e. the combing artefacts in each frames, Kika gave the perfect answer. You'll lose a single field at the very beginning, but there's no way to avoid that. This is what people call "phase-shift"; you may encounter the phase-shift e.g. when capturing (originally progressive) film from TV.
Thanks, that does look like the effect I'm looking for. I'll play around with it and see what results I get.
But beware: there's a big difference between phase-shifted and "truly" interlaced video: the first can be reconstructed to progressive video, whereas the second needs to be deinterlaced to get progressive video (including resolution loss and artefacts).
bb
Would you say that both qualify as functionally interlaced though? If you were to play both on a TV, would they both look smooth?
bb
13th February 2004, 08:58
Originally posted by zambelli
Would you say that both qualify as functionally interlaced though? If you were to play both on a TV, would they both look smooth?
If played on TV - provided that the field order is correct - both, phase-shifted and truly interlaced video, will look smooth on an interlaced display, e.g. on TV. Even progressive video will look smooth.
You didn't say what you are going to do with the "fake" interlaced video, though. Thus I can't tell if phase-shifted progressive video is appropriate for your application.
bb
spyder
13th February 2004, 22:10
If you just really want interlaced video the best way to emulate it is to weave the frames of a progressive clip. This does speed it up but it creates the effect of real interlacing... or you can separate fields and select the top from one frame and the bottom from the next...
Kika
15th February 2004, 00:18
I posted this "Phase-Shift"-Solution because it is the same effect, you can see on some PAL-VHS-Tapes and PAL-DVDs. So this solution is kind of "natural".
Malow
27th April 2004, 09:54
sorry to interrupt, but, someone can post the example of script to 60p to 30i?
i cant get a soft motion interlace with my tests.... (on tv)
scharfis_brain
27th April 2004, 11:39
60p to 30i (aka 60i)
avisource("60p")
#anyresizer
separatefields()
selectevery(4,0,3) # use (4,1,2) for reversed fieldorder
weave()
#info() #shows the outputted fieldorder.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.