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. |
19th August 2014, 14:18 | #1 | Link |
Registered User
Join Date: May 2009
Location: Belgium
Posts: 1,744
|
How to gather 2 top fields then 2 bottom fields ?
Hi,
I'd like to see how does look a video in which each frame consists of 2 top fields or 2 bottom fields, and not of a top and a bottom field as usual. I guess the first step with avisynth consists to separate fields, but then I don't know. The idea is to gather fields 1 and 3 (while they come from 2 successive frames) then 2 and 4, 5 and 7, 6 and 8, ... weave() is not good for that because it gathers 1 and 2, 3 and 4, ... |
19th August 2014, 15:38 | #4 | Link |
Registered User
Join Date: May 2009
Location: Belgium
Posts: 1,744
|
Actually no (I answer my own question), if one put SelectOdd() after SelectEven(), the total frames number is divided by 2 (it lacks a frame on two).
But after a few tests, I believe I found how to reach my goal ; Code:
SeparateFields() A=SelectEven().Weave() B=SelectOdd().Weave() Interleave(A, B) I first tried this ; Code:
SeparateFields() A=SelectEven() B=SelectOdd() Interleave(A, B) Code:
SeparateFields() Weave() Last edited by Music Fan; 19th August 2014 at 15:43. |
19th August 2014, 15:52 | #5 | Link | |
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,431
|
Quote:
Code:
A=SelectEven() B=SelectOdd() Interleave(A, B) |
|
19th August 2014, 16:17 | #6 | Link |
Registered User
Join Date: May 2009
Location: Belgium
Posts: 1,744
|
Right, I confounded some tests I made, I should have seen this before to write it.
edit : I believe I meant that ; Code:
A=SelectEven() B=SelectOdd() Interleave(A, B) Code:
SeparateFields() Weave() Last edited by Music Fan; 19th August 2014 at 16:25. |
19th August 2014, 18:14 | #10 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Does this work ?
Code:
mpeg2source("d:\vob\XMEN2.d2v") SeparateFields E=SelectEven.AssumeFrameBased.SeparateFields E_A=E.SelectEven E_B=E.SelectOdd O=SelectOdd.AssumeFrameBased.SeparateFields O_A=O.SelectEven O_B=O.SelectOdd Interleave(E_A,O_A,E_B,O_B) Weave AssumeFieldBased Weave
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 19th August 2014 at 18:24. |
19th August 2014, 23:25 | #11 | Link |
Moderator
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
|
Something like the above should work. Shorter would be:
Code:
c = mpeg2source("d:\vob\XMEN2.d2v") f = c.SeparateFields().AssumeFrameBased() #t1b1t2b2t3b3... #not sure whether AssumeFrameBased() is necessary f.SelectEvery(4,0,2,1,3) #t1t2b1b2 t3t4b3b4 ... AssumeFieldBased() Weave() Last edited by Wilbert; 20th August 2014 at 00:46. |
20th August 2014, 00:51 | #14 | Link |
Registered User
Join Date: May 2009
Location: Belgium
Posts: 1,744
|
Same question than above, what's the difference between this script and mine for the output ?
I post it here again ; Code:
SeparateFields() A=SelectEven().Weave() B=SelectOdd().Weave() Interleave(A, B) |
20th August 2014, 01:57 | #16 | Link |
Registered User
Join Date: May 2009
Location: Belgium
Posts: 1,744
|
Ok.
There is something strange in Virtual Dub with my script : the duration is divided by 4 compared to the original video while the framerate and the number of frames of my script are identical to those of the original video. edit : that's an error, actually the duration is the same but I realize that ffvideosource does not detect the good framerate, thus I have to add assumefps(25/1), which I did in my main script but not in my first script containing only one line (ffvideosource ...). The source is a TS file containing mpeg-2 in 720.576, ffvideosource has maybe a problem with ts files. If I don't add assumefps(25/1), the detected framerate is 5.89 fps. Last edited by Music Fan; 20th August 2014 at 02:11. |
21st August 2014, 14:20 | #18 | Link | |
Registered User
Join Date: May 2009
Location: Belgium
Posts: 1,744
|
Quote:
And the frame number differs in 1 case ; if I i add trim(100,0) (= from 100 to end) in both scripts, I get 6832 frames with mine, 6831 with yours. But if I add trim(100,199), they both get 100 frames. If I don't use trim, they both get 6931 frames. But this is a ts file recorded on tv, I should try with another file. |
|
22nd August 2014, 12:28 | #20 | Link |
Registered User
Join Date: May 2009
Location: Belgium
Posts: 1,744
|
Here is an interesting exercise, begin the script with this to see big numbers on an interlaced video, you don't even need video, thanks to BlankClip function ;
Code:
BlankClip(length=100, width=720, height=576, fps=25, color=$000000) ShowFrameNumber(size=400) separatefields() selectevery(4,0,3) weave() Then add bxyhxyh's script, then mine, add SeparateFields() at the end, forward frame by frame in Virtual Dub and see what happens Here are the complete scripts ; Code:
BlankClip(length=100, width=720, height=576, fps=25, color=$000000) ShowFrameNumber(size=400) separatefields() selectevery(4,0,3) weave() SeparateFields() A=SelectEven().Weave() B=SelectOdd().Weave() Interleave(A, B) SeparateFields() Code:
BlankClip(length=100, width=720, height=576, fps=25, color=$000000) ShowFrameNumber(size=400) separatefields() selectevery(4,0,3) weave() SeparateRows(4) SelectEvery(4,0,2,1,3) WeaveRows(4) SeparateFields() |
Thread Tools | Search this Thread |
Display Modes | |
|
|