Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage
Register FAQ Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 2nd July 2006, 18:06   #1  |  Link
Buddy Casino
Registered User
 
Join Date: Sep 2003
Posts: 20
Properly convert true 50p to 50i

Hi!
I'd like to convert a video with true 50fps progressive frames to 50 interlaced fields.
SeparateFields() does not do what I want, since it assumes a video of half the frame rate containing previously merged fields. This is not the case here, because the video was rendered by a program in true 50p.
It is very important to keep the video as much fluid as possible, so I don't want to discard half of the frames, but rather half the vertical resolutionof the existing frames and somehow use them as the fields for my 50i.
Is this possible?

Thanks for every help!
Buddy Casino is offline   Reply With Quote
Old 2nd July 2006, 18:13   #2  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
separatefields()
selecteven()
weave()
Guest is offline   Reply With Quote
Old 2nd July 2006, 18:20   #3  |  Link
MfA
Registered User
 
Join Date: Mar 2002
Posts: 1,075
Shouldn't that be :

AssumeFrameBased
SeparateFields
SelectEvery(4, 0, 3)
Weave

?
MfA is offline   Reply With Quote
Old 2nd July 2006, 18:22   #4  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
I assumed he's already frame based, but it doesn't hurt to add it.

SelectEven() is the same as SelectEvery(4, 0, 3), it seems to me.

And you should always retain the ()'s to ensure proper Avisynth caching.
Guest is offline   Reply With Quote
Old 2nd July 2006, 18:39   #5  |  Link
Alain2
Registered User
 
Join Date: May 2005
Posts: 236
Quote:
Originally Posted by neuron2
SelectEven() is the same as SelectEvery(4, 0, 3), it seems to me.
I think 4,0,3 selects the even field of frame 1 and the odd field of frame 2 (or vice-versa), and weaving these will keep resolution in static parts, and avoid jitter
Alain2 is offline   Reply With Quote
Old 2nd July 2006, 18:43   #6  |  Link
MfA
Registered User
 
Join Date: Mar 2002
Posts: 1,075
SelectEven selects 0, 2, 4, 6, etc.
SelectEvery(4, 0, 3) selects 0, 3, 4, 7 etc.
MfA is offline   Reply With Quote
Old 2nd July 2006, 19:07   #7  |  Link
scharfis_brain
brainless
 
scharfis_brain's Avatar
 
Join Date: Mar 2003
Location: Germany
Posts: 3,655
in fact is has to be:

AssumeFrameBased()
AssumeTFF() #-> set desired output fieldorder
converttoyuy2() # convert to desired output colourspace (as the choosen encoder needs)
SeparateFields().SelectEvery(4, 0, 3).Weave() #re-interlace


using selecteven() instead of selectevery(4,0,3) will result in halved vertical resolution due to wrong vertical alignment.
__________________
Don't forget the 'c'!

Don't PM me for technical support, please.
scharfis_brain is offline   Reply With Quote
Old 2nd July 2006, 19:35   #8  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
Yeah, I stand corrected.

I was assuming SelectEvery(4,0,2) was written and didn't look closely at it, and of course that is the same as SelectEven().

Either way, scharfi and Mfa are correct about the shift.
Guest is offline   Reply With Quote
Old 2nd July 2006, 20:11   #9  |  Link
MfA
Registered User
 
Join Date: Mar 2002
Posts: 1,075
Quote:
Originally Posted by scharfis_brain
AssumeTFF() #-> set desired output fieldorder
Doesn't really matter much, whichever is set things work out alright because of the weave.
MfA is offline   Reply With Quote
Old 2nd July 2006, 21:29   #10  |  Link
Buddy Casino
Registered User
 
Join Date: Sep 2003
Posts: 20
First of all: thank you very much for your help!

Ok, now it looks like i'm getting interlaced content, I can see the comb artefacts. What puzzles me is that the resulting file (DV) displays as 25fps in the MediaPlayerClassic properties (and also in VirtualDubMod under "video" -> "framerate"). Is that normal? I know its frames per second, not fields per second, but shouldn't it instead say "50fps" or "25fps interlaced" or something like that?
Excuse my ignorance, but i'm just getting started...
Buddy Casino is offline   Reply With Quote
Old 2nd July 2006, 22:05   #11  |  Link
vhelp
Registered User
 
vhelp's Avatar
 
Join Date: Feb 2003
Posts: 299
Hello everyone

Yeah, I was waiting all day to see how long it would take for someone to catch
this oversight.

Buddy Casino, you would need to add one more sub group to the param, [2,5] ..

selectEvery(4, 0,3, 2,5)

will (should) report 50 fps.

fwiw, I think someone wanted to do the reverse of what you want, over at videohelp,
here: dvd ntsc=> pal conversion & adding subtitles best way?expert opinion

-vhelp
__________________
ESC K7S5A / XP 1800+ / Windows 98
ADVC-100[dvio] / WTVGO[avio] / DC10+[avio] / Canon ZR-10 / Delphi 6 Personal / JVC S-VHS HR-S3910U / Durabrand SSS w/ DVD Player STS75E / Sony TRV-22
FithElement/Dogma/BladeRunner/Contact
vhelp is offline   Reply With Quote
Old 2nd July 2006, 22:11   #12  |  Link
MfA
Registered User
 
Join Date: Mar 2002
Posts: 1,075
No that will generate 100 fields per second, just like the original.

What Im assuming is happening is that the codec doesn't know it's getting interlaced content, it just codes them as progressive frames.
MfA is offline   Reply With Quote
Old 2nd July 2006, 22:20   #13  |  Link
Buddy Casino
Registered User
 
Join Date: Sep 2003
Posts: 20
If the codec is the problem, why does VirtualDubMod also report 25fps under "video" -> "framerate" when loading the above script?
(Btw.: I'm using the old MainConcept 2.4.4 DV codec, which is still VfW based)
Buddy Casino is offline   Reply With Quote
Old 2nd July 2006, 22:28   #14  |  Link
vhelp
Registered User
 
vhelp's Avatar
 
Join Date: Feb 2003
Posts: 299
MfA, don't take this the wrong way. I'm not sure I follow you.

If I may explain myself..
I'm not an expert in the selectEvery() function, thought it's quite a
powerful filter, imho. And, I do love working with it, though my sources
are NTSC based, and not PAL. The numbers above were used on a NTSC source
who fps were 29.970 fps.

When I read this article this moring, I did a little what-if playing around.
Then, I got the idea that I could be wrong, but only beause I dont' have a PAL
source. So, I found some PAL demo clips (snipped from this forum, at various
areas - thanks everyone) and used those PAL videos as a reference to all my
selectEvery() scenarios.

FWIW, below I post the relative param values, that gave me the final FPS
for each run inside selectEvery() function:

# NTSC: @ 4
# 14.985=(0,3)
# 29.970=(0,3, 2,5)
# 44.955=(0,3, 2,5, 4,7)
# 59.940=(0,3, 2,5, 4,7, 6,9)

# PAL: @ 4
# 12.500=(0,3)
# 25.000=(0,3, 2,5)
# 37.500=(0,3, 2,5, 4,7)
# 50.000=(0,3, 2,5, 4,7, 6,9)

where

@ 4, is the first param entry for the "group of pictures" to include in the
final process.

Someone posted, selectEvery(4, 0,2) and gave an explanation why. In the end,
I found either one works well. But, the results will (would) be dependant on
the given source being used with. We all know how the tons of video out there
can be unpredictable, even when we *feel* otherwise.

Last, I sure would love to D/L a small piece of this member's video.. just to
get an idea of what this 50p (PAL) source is like with selectEvery() function.

Thank you.

-vhelp
__________________
ESC K7S5A / XP 1800+ / Windows 98
ADVC-100[dvio] / WTVGO[avio] / DC10+[avio] / Canon ZR-10 / Delphi 6 Personal / JVC S-VHS HR-S3910U / Durabrand SSS w/ DVD Player STS75E / Sony TRV-22
FithElement/Dogma/BladeRunner/Contact
vhelp is offline   Reply With Quote
Old 2nd July 2006, 22:38   #15  |  Link
MfA
Registered User
 
Join Date: Mar 2002
Posts: 1,075
Buddy, after weaving you do get a 25 frame per second stream ... the codec has to be told in some way that the source is interlaced, and that each frame is actually 2 fields.
MfA is offline   Reply With Quote
Old 2nd July 2006, 22:39   #16  |  Link
actionman133
Movie buff & shine
 
Join Date: Jan 2004
Location: Logan, the only hole above ground.
Posts: 257
@Buddy Casino

There is no 'interlaced' flag under the AVI format (that I'm aware of), so AVISynth can't tell VDub or any other program whether it's progressive or interlaced. The only way an output application could tell is if it analyzed the frames, which can be unreliable.

As such, if you are playing 25 interlaced frames per second, it will simply tell VDub that it is playing 25 frames per second and VDub will just assume it's progressive. If you want the video to be compressed as an interlaced source, you'll have to set the option manually in your video compressor's configuration...

Hope that explains it a little for you... : )
__________________
I'm a boxer who can Bob () & Weave (). I like to Overlay () punches and Blur () his vision to ShowFiveVersions (). My KO punch will always Pulldown ().TimeStretch () and all he will hear is Tone ().
actionman133 is offline   Reply With Quote
Old 2nd July 2006, 22:50   #17  |  Link
Buddy Casino
Registered User
 
Join Date: Sep 2003
Posts: 20
I see...
Nothing to configure here:



Is there a DV codec I can use that would support this behaviour?
I don't have to necessarily use VirtualDub, if that is the problem...
Buddy Casino is offline   Reply With Quote
Old 2nd July 2006, 23:05   #18  |  Link
MfA
Registered User
 
Join Date: Mar 2002
Posts: 1,075
Try this :

AssumeFrameBased()
AssumeBFF()
SeparateFields().SelectEvery(4, 0, 3)

Without the weave it gets a 50 fps stream, with a bit of luck it automatically assumes that kind of rate means it's interlaced.
MfA is offline   Reply With Quote
Old 2nd July 2006, 23:17   #19  |  Link
Alain2
Registered User
 
Join Date: May 2005
Posts: 236
Hum interlaced clips frames are made of fields taken at with a difference in time of half the fps; so in your case, as you have only 50fps for each field taken both at exactely the same time, then you can only make 25fps interlaced ; or you can interpolate 1 intermediate frame between 2 of the original 50p source (with the mvtools or depan), which will give you 100p fps, so each field will be at 100fps, and using the methode above will give you back 50i frames...

Last edited by Alain2; 2nd July 2006 at 23:21.
Alain2 is offline   Reply With Quote
Old 2nd July 2006, 23:26   #20  |  Link
Buddy Casino
Registered User
 
Join Date: Sep 2003
Posts: 20
...which would be 100 fields per second, right?
I only want to convert a 50fps progressive source to a 50 fields per second DV avi. This seems to be harder than expected! :-)
Buddy Casino is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 15:46.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.