Welcome Guest ( Log In | Register )


Important

The forums will be closing permanently the weekend of March 15th. Please see the notice in the announcements forum for details.

 
Generate Interlaced Video From Imageset
« Next Oldest | Next Newest » Track this topic | Email this topic | Print this topic
xieweibo
Posted: Dec 25 2013, 07:55 AM


Newbie


Group: Members
Posts: 5
Member No.: 37589
Joined: 25-December 13



Hi٬
Recently I'm doing some research on interlaced video, I don't have a camera which can generate interlaced video, but I can support image set(which contains several images), so my question is very simple that how to generate interlaced video with image set with virtualDub?

Thanks a lot.
 
     Top
dloneranger
Posted: Dec 25 2013, 12:45 PM


Moderator


Group: Moderators
Posts: 2366
Member No.: 22158
Joined: 26-September 07



You want to make a fake interlaced file of the tv kind?
That's the one where they took 50 (pal) fields pre second and when shown progressively has combing effects?

You can easily fake that with AviSynth, no need to use imagesets
Install http://avisynth.nl/index.php/Main_Page

Then make a text file and paste this into it
CODE
# put your own path to a video path in the next line
directshowsource("c:\somevideo.avi")

# split the video into fields
SeparateFields()

# delete the first frame so when they're joined back together you'll get half of one frame and half the next
Trim(1,0)

# join the fields back into frames
Weave()

Rename the text and make it's extension .avs eg FakeInterlaced.avs
(.avs is Avisynth's extension)
Open that FakeInterlaced.avs file with virtualdub

--------------------
MultiAdjust JoinWav WavNormalize FFMPeg Input Plugin v1827 UnSharpMask
Windows7/8 Codec Chooser
All FccHandlers Stuff inc. Installers for acm codecs AAC, AC3, LameMp3
 
    Top
raffriff42
Posted: Dec 25 2013, 10:11 PM


Advanced Member


Group: Members
Posts: 384
Member No.: 35081
Joined: 25-June 12



* Using Xvid, under "Profile," "More...", enable "Interlaced Encoding"
or (maybe)
* Using x264vfw, in the "Extra Commands" box, add "--tff" or "--bff" (top- or bottom-field-first interlaced mode)

Verify with MediaInfo: Xvid "Scan Type" shows as "Interlaced," but x264 "Scan Type" shows as MBAFF (not sure if this is truly interlaced)
 
     Top
dloneranger
Posted: Dec 25 2013, 11:07 PM


Moderator


Group: Moderators
Posts: 2366
Member No.: 22158
Joined: 26-September 07



True, that will make a technically interlaced video, as in the encoder will encode the fields separately instead of doing the whole frame

But if your source is progressive, the fields of the interlaced video will still be from the same time-instance, as opposed to video cam style (capture at 50 fields per sec, display as 25 frames per sec) where the second field is from a different time-instance to the first field
So, effectively all it'll do is make a less efficient encode than using progressive

If your source has interlaced content where the fields are from different time-instances then setting your encoder to interlaced will give a more efficient encode than setting it to progressive


--------------------
MultiAdjust JoinWav WavNormalize FFMPeg Input Plugin v1827 UnSharpMask
Windows7/8 Codec Chooser
All FccHandlers Stuff inc. Installers for acm codecs AAC, AC3, LameMp3
 
    Top
raffriff42
Posted: Dec 26 2013, 12:15 AM


Advanced Member


Group: Members
Posts: 384
Member No.: 35081
Joined: 25-June 12



Hmmm what does the "interlace" filter do...?
QUOTE
converts progressive scan video to interlace at half the frame rate
The output of this filter looks like the output of your Avisynth script FWIW.

I think you need both an interlaced encoder and the script or filter.

I've never had to actually do this before, can you tell?
 
     Top
dloneranger
Posted: Dec 26 2013, 01:08 AM


Moderator


Group: Moderators
Posts: 2366
Member No.: 22158
Joined: 26-September 07



As the frame rate's halving, it looks like it's discarding fields and joining up the remaining ones
Same kind of thing, but that halving of the frame rate might not be what the OP wants

All we're doing here is making a 'fake' interlaced file that simulates the combing effect

Just some points of clarity

Interlaced video and combing
A total pain in the neck

Interlaced video may not mean what you think it means
We've all seen the horrible combed effects of what we normally think is interlacing
But interlaced video may also be effectively the same as progressive with none of the combing
And more annoyingly progressive video may be combed to hell

In essence you have to consider them as two separate things

A vid cam may capture 25 full frames a second but still encode it as interlaced - so that would be interlaced but un-combed
A vid cam may capture 50 fields a second and encode it as interlaced - so that would be interlaced and combed
Like the bbc may record at 25 frames a sec, but then on transmission over the air it's split into fields that are recombined on the tv
Or they can record at 50 fields a sec, then on transmission over the air it's sent as is and recombined on the tv
The first example doesn't need deinterlacing as it's uncombed (really progressive but transmitted interlaced)
The second one does need deinterlacing, or encoding with a codec set to interlaced

It's the studios choice, capture 2 frames at the same time-instance or at different time-instances
One way you get better vertical resolution and the other way you get half resolution but 50% greater motion rate

A codec's interlaced setting basically just alters the way it compresses the frame
In progressive it'll use the top line, then the second line, 3rd, 4th etc
In interlaced mode, it'll use the top line, then the 3rd line, 5th etc till it reaches the bottom - then it'll go back to the top and do lines 2,4,6 etc

This doesn't actually make a video interlace or progressive - you can mix and match
The reason you use the matching one, is for efficiency inside the codec
Progressively encoding a combed frame uses more bits as the codec has to keep all those sharp 1 pixel offsets
Interlaced encoding of a progressive frame uses more bits as now you've actually made those sharp offsets by only doing every other line

Codecs normally mark the video stream with a flag to say if it's interlaced or progressive
But as you can mix and match however you like, and interlaced video may not be combed anyway.... all you can deduce really is that somewhere in the process somebody ticked a box dry.gif

NTSC land also uses a pulldown system to make fake interlaced video from progressive ones for going from 24fps->29.97
Sensible systems like mpeg2 use a flag that tells the decoder to generate the interlaced output, leaving the actual content at 24 progressive
Annoying systems generate the 29.97 interlaced output and then encode it, they may even swap field orders at scene changes (or because it's a wednesday) just to throw out deinterlacers - thanks so much

Thankfully the trend is to progressive, and when america finally stops using pulldown we can all have a party and I'll buy the beer

--------------------
MultiAdjust JoinWav WavNormalize FFMPeg Input Plugin v1827 UnSharpMask
Windows7/8 Codec Chooser
All FccHandlers Stuff inc. Installers for acm codecs AAC, AC3, LameMp3
 
    Top
dloneranger
Posted: Dec 26 2013, 01:32 AM


Moderator


Group: Moderators
Posts: 2366
Member No.: 22158
Joined: 26-September 07



Quite a nice explanations for anyone who's after information - with pictures and animations, so it's almost fun for all the family!
(For a given value of 'fun')

http://www.neuron2.net/LVG/interlacing.html
http://www.100fps.com/


--------------------
MultiAdjust JoinWav WavNormalize FFMPeg Input Plugin v1827 UnSharpMask
Windows7/8 Codec Chooser
All FccHandlers Stuff inc. Installers for acm codecs AAC, AC3, LameMp3
 
    Top
xieweibo
Posted: Dec 26 2013, 03:20 AM


Newbie


Group: Members
Posts: 5
Member No.: 37589
Joined: 25-December 13



Thanks a lot for all your replies.smile.gif
Finally I search a yuv file and use ffmepg wich "ffmpeg -s 352x288 -r 30 -i foreman.yuv -vcodec rawvideo foreman.avi" to create an avi. It's works.

Actually I'm trying interlaced rendering for game, render top field this frame and bot field next frame, I had use a simple filter similar to bob filter, but the aliasing is too obvious for a game, so I want to try yadif, before tried yadif I want to make sure the filter can really solve my problem, so I use foreman sequence do a test in VirtualDub, found that the aliasing is really good, but another problem is that flick is too obvious for tree leaf and wall at the end of foreman sequence, is there anyway to solve this?

And here is another problem I can support a sequence of our game with 120 frames(each contain 2 field), I'm not sure what's the layout image which contains a top filed& a bot field(one line for top,one line for bot?

Thanks. cool.gif
 
     Top
xieweibo
Posted: Dec 30 2013, 02:55 AM


Newbie


Group: Members
Posts: 5
Member No.: 37589
Joined: 25-December 13



Hi,
Any idea?
Thanks.
 
     Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
8 replies since Dec 25 2013, 07:55 AM Track this topic | Email this topic | Print this topic

<< Back to Capture