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. Domains: forum.doom9.org / forum.doom9.net / forum.doom9.se |
|
|||||||
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
|
#1 | Link |
|
Registered User
Join Date: May 2009
Location: Belgium
Posts: 1,787
|
How to de-interlace 25i coming from 8 mm film transfer ?
Hi,
I have to de-interlace a video for someone who made transfer by a company his 8 mm films (maybe Super 8 actually) onto Pal DV tapes and who needs a better quality to make dvd. I don't know what is the original framerate, here is an extract ; http://enfroy.free.fr/video/zoocut.avi I tried Srestore() (default settings) preceded by tdeint() (25 fps) and also tdeint(mode=1) (50 fps) but in both cases the result is far to be perfect, there are still blended and doubled frames, I guess there are better settings and/or filters. I know that qtgmc is better than tdeint but I needed something fast for the test, I will use qtgmc in the final script. I'd like to remove blended frames and keep only the original frames if possible and then increase the framerate to 25 fps with assumefps (if it's 24fps) or make interpolation with interframe (if it's 16 or 18 fps, and maybe also if it's 24fps to get 48 fps). Thanks for your help
Last edited by Music Fan; 7th September 2014 at 12:10. |
|
|
|
|
|
#2 | Link |
|
Registered User
Join Date: Dec 2007
Location: Germany
Posts: 632
|
Actually you don't need to deinterlace anything at all to make a DVD.
However, in theory, you can improve encoding efficiency if you remove the pulldown, leaving you with the raw frame rate of the video, encode it to DVD compliant MPEG2 video at that frame rate and then apply soft-pulldown for 25i. The problem in your case is the pulldown is not clean. There are brightness jumps in the "fake" fields inbetween the real motion, and the original frame rate (probably 18 fps, definitely not 24!) was unfortunately not simply adapted to 25i via clean pulldown (duplication), but blending. That's not good. ![]() Field matching (TFM) fails because of the blending. So you would need to bob-deinterlace and de-blend, which is a real bummer considering if transferred properly there is nothing to deinterlace and de-blend at all with 8 mm film. My attempts at deblending and restoring the original frame rate failed. Maybe someone else has better luck. So far my advice is therefore, don't bother, just encode it as is because the risk of making it just worse is high. Last edited by TheSkiller; 7th September 2014 at 13:22. |
|
|
|
|
|
#3 | Link |
|
Registered User
Join Date: May 2009
Location: Belgium
Posts: 1,787
|
Ok, thanks for your help.
But actually if I add Tdecimate() after Srestore(), that looks better, but there are still some duplicate images : 14 = 13, 22 = 23, 33 = 34, 39 = 40, 53 = 54, 59 = 60, 70 = 71, 79 = 80, 84 = 85, ... If I add again Tdecimate(), there are no more duplicate images but some good images are perhaps removed too, that's not easy to verify. Here is my script ; Code:
ffvideosource("F:\Zoocut DV bff.avi")
assumefps(25/1)
assumebff()
tdeint(mode=1)#50 fps
Srestore()#23.976 fps
TDecimate()#19.18 fps
TDecimate()#15.34 fps
|
|
|
|
|
|
#5 | Link |
|
Registered User
Join Date: May 2009
Location: Belgium
Posts: 1,787
|
Thanks, much better but there are still some blended and duplicate frames : 0=1, 29=30, 55=56, 63=64 ... and 16, 46 ... are blended.
But strange thing : I exported twice this script in Lagarith yv12 and the second export has less problems than the first. Before the first export I moved a lot in the file in Virtual Dub's window, but normally it shouldn't affect the export.
Last edited by Music Fan; 7th September 2014 at 16:45. |
|
|
|
|
|
#6 | Link |
|
Registered User
Join Date: Dec 2007
Location: Germany
Posts: 632
|
The problems start with the deblending already. No matter how I tweak SRestore (different modes, threshold, etc.) it just won't deblend all frames even at ridiculous aggressive settings.
Edit: @ Music Fan It doesn't make much sense to let SRestore do some Decimation (50 -> 23.976) and then use TDecimate afterwards for 23.976 -> 18 fps... Better use SRestore omode <6 to let TDecimate alone do the Decimation. But like I've said, I didn't get any satisfying results because the deblending fails. Last edited by TheSkiller; 7th September 2014 at 19:43. |
|
|
|
|
|
#7 | Link | |
|
Registered User
Join Date: May 2009
Location: Belgium
Posts: 1,787
|
Quote:
By the way, did you also use tdeint(mode=1) before deblending ? |
|
|
|
|
|
|
#8 | Link |
|
Registered User
Join Date: Dec 2007
Location: Germany
Posts: 632
|
I just used Bob() for testing.
I think you misunderstood me. By default, SRestore tries to restore to 23.976 fps because that's the most common "base" frame rate for it's general application. In your case the base frame rate is 18 fps or close to that, so it would make sense to prevent SRestore from decimating (because TDecimate does that afterwards) and use it just as a deblender. Another option would be setting SRestore's "frate" parameter to 18 (which makes TDecimate superfluous). If "omode" is set to a value <6 (6 is default) it will not decimate but only deblend (keeping 50 fps). Last edited by TheSkiller; 7th September 2014 at 21:46. |
|
|
|
|
|
#9 | Link | |
|
Registered User
Join Date: May 2009
Location: Belgium
Posts: 1,787
|
No, I had understood, but the result was better with SRestore, even if it shouldn't be the case.
Quote:
When Srestore() is removed, there are more blended frames. edit : I tried you idea (but I changed 18 to 16) and that's very good too ![]() Here is the script ; Code:
ffvideosource("F:\Zoocut DV bff.avi" )
assumefps(25/1)
assumebff()
tdeint(mode=1)#50 fps
Srestore(frate=16)#16 fps
Last edited by Music Fan; 7th September 2014 at 22:08. |
|
|
|
|
|
|
#10 | Link |
|
Registered User
Join Date: Feb 2002
Location: California
Posts: 2,783
|
First of all, you do not want, nor do you need deinterlacing. QTMG is the wrong tool for this.
Instead, what you are doing is inverse telecine (IVTC). IVTC does not involve any motion estimation or reconstruction of fields and frames, but instead is entirely oriented towards removing redundant fields. If you do a "separatefields()" on the original video, you will see that you always have two good fields, without blends, which match each other. The blends are only happening on fields, not across the entire frame. Therefore, because you always have a good pair of matching fields, there is no need for a deblender, and SRestore is the wrong solution to this problem. Instead, you simply need to use IVTC, and set the TFM and TDecimate parameters correctly. The following script removed all of the blended fields, and matched all the good fields correctly. Code:
loadPlugin("c:\Program Files\AviSynth 2.5\plugins\TIVTC.dll")
Final_Framerate = 16
AVISource("E:\Documents\Dnload\UNPACK\zoocut.avi").killaudio()
AssumeBFF()
assumefps(25)
tfm(display=false,mode=2,pp=1,cthresh=15,micmatching=3,mmsco=false,metric=1)
tdecimate(mode=0,display=false, ssd=true,noblend=false,hint=true,cycle=86,cycleR=27 )
assumefps(Final_Framerate).ConvertToYV12(interlaced=false)
#separatefields()
|
|
|
|
|
|
#12 | Link | |||
|
Registered User
Join Date: May 2009
Location: Belgium
Posts: 1,787
|
I said maybe super 8, I don't know what it is (8 or super 8 = 16 or 18 fps), I will ask to the owner of this video.
Anwyay, with my script the result is better with frate=16 instead of 18. Quote:
![]() If I don't specify assumefps, the final framerate is 17.1512 fps ![]() But of course, I can add assumefps(16) or 18. By the way, why do you write the framerate in 2 lines (Final_Framerate then assumefps(Final_Framerate)) instead of assumefps(16) ? And as the source is already in YV12 and becomes progressive with tfm and tdecimate, I guess ConvertToYV12(interlaced=false) is optional. I didn't know that the term inverse telecine could be applied in this case, I believed it was used only for 60 hz source coming from 24p movies. Quote:
Quote:
edit : What filter do you use for DV ? I used to use ffdshow but I didn't install it yet on my new pc because this project seems abandoned, that's why I used ffvideosource instead of AVISource. Does LAV support as many codecs as ffdshow ? Last edited by Music Fan; 8th September 2014 at 09:57. |
|||
|
|
|
|
|
#13 | Link |
|
Registered User
Join Date: Dec 2007
Location: Germany
Posts: 632
|
I stand corrected. I honestly didn't expect it is possible to restore this video without bob-deinterlacing + deblending.
![]() For DV sources the free Cedocida DV Codec is very recommendable (usage via AviSource()). I don't know if ffdshow's DV decoder has changed it's behaviour but it used to decode DV with it's native DV chroma placement which causes slight color fringes if it's not changed to the common MPEG2 chroma placement manually afterwards. Cedocida does this for you upon decoding. Last edited by TheSkiller; 8th September 2014 at 12:13. |
|
|
|
|
|
#15 | Link | |||||
|
Registered User
Join Date: Feb 2002
Location: California
Posts: 2,783
|
Quote:
Quote:
This is how many frames are left out of each original 25 frames. Right. The 17.1512 frames is what remains from each 25 frame. You could plays these in one second, in half a second, or whatever. The "assumpfps()" function tells the video playback software how quickly to play the list of frames, but without adding or deleting any frames. Quote:
Quote:
However, when dealing with 12, 15, 16, or 18 fps silent film (common speeds), you in PAL-land do have to add "pulldown fields" (i.e., duplicate fields) in order for those amateur movies to play at the correct speed on a playback device (your PAL television) that is hard-wired to play everything at 25 frames per second. Therefore, when those fields have already been added, you need to remove them before performing more edits. If you don't remove these duplicate fields, many filters, like those used with AVISynth, will not work correctly because they see no motion at all between certain fields, and this kills their motion estimation algorithms. The process of removing redundant fields that have been added in order to get the video to play at 25 fps is called "inverse telecine" which is often abbreviated IVTC. Quote:
You only need to use SRestore when you don't have two clean fields which already match. In your case, the software simply has to identify the "odd man out" which is the blended field that doesn't match either of its neighbors, and get rid of it. For transfers where one or more of the fields in some frames are blended, and where there is no additional "good field" from that frame to choose from, there is another script here in the forum (besides SRestore), based on some ideas Didée gave someone, which let you take a simple transfer done by pointing a video camera at a projection screen, and recover (more or less) the original frames. The power of Avisynth: salvaging "botched" transfers of old 8mm films to DVD It works very well, but it still involves compromises. In your case you don't need it. I built a very complex telecine machine that I use for transferring 16mm film from a shutterless 16mm projector. This produces results which are identical to your film, which is why I immediately realized what had to be done. The blended fields from my transfer system are, unfortunately, much more difficult to detect (some of the blends are very, very subtle), and so I end up having to do a lot more work than simply finding the correct cycle and cycleR parameters to use. But that's a story for another time ... BTW, once you have recovered the original fields, and have 18 fps video, and once you have edited that video, if you are going to play on a device that can natively play 18 fps (which includes all computers, and also many TV sets that can accept thumb drives and computer input via VGA or HDMI), you can leave the video at 18 fps, without adding pulldown fields. As we move away from videotape, which was hard-wired to a specific playback rate, pulldown is no longer required, even here in NTSC land. |
|||||
|
|
|
|
|
#16 | Link | |
|
Moderator
![]() Join Date: Oct 2001
Location: Hawaii
Posts: 7,406
|
Quote:
|
|
|
|
|
|
|
#17 | Link |
|
Registered User
Join Date: May 2009
Location: Belgium
Posts: 1,787
|
Thanks a lot for all these explanations, this is very interesting !
![]() The guy told me his movie was 8mm, not super 8, so the original framerate should be 16. Anyway, as he wants a Pal dvd, I got the idea to use Interframe with this script to triple the framerate ; Code:
avisource("F:\Zoocut DV bff.avi" )
assumefps(25/1)
assumebff()
tfm(display=false,mode=2,pp=1,cthresh=15,micmatching=3,mmsco=false,metric=1)
tdecimate(mode=0,display=false,ssd=true,noblend=false,hint=true,cycle=86,cycleR=27)#17.1512 fps
assumefps(17/1)#17 fps
InterFrame(NewNum=51, NewDen=1, cores=2)#51 fps
assumefps(50/1)#50 fps
Code:
assumetff() separatefields() selectevery(4,0,3) weave() What resize filter is recommended ? I always use lanczos but there is maybe better now. By the way, here is the video encoded with your script, I just added assumefps(18) at the end (this was before to know the source was 16 fps but it doesn't matter) ; http://www59.zippyshare.com/v/68994484/file.html And in 50p with the script I gave a few lines above ; http://www2.zippyshare.com/v/29161308/file.html They are encoded in Lagarith ; http://lags.leetcode.net/codec.html edit : I forgot to ask you how you found the values, especially cycle=86,cycleR=27. Are they common or you had to observe the video carefully to find it ? Last edited by Music Fan; 9th September 2014 at 11:36. |
|
|
|
|
|
#18 | Link | |
|
Registered User
Join Date: Feb 2002
Location: California
Posts: 2,783
|
Quote:
As for your choice to use Interframe, that is strictly a matter of personal taste. The result of interpolating frame will yield something that looks totally different than normal film, and more like video. Some people like this, others derisively call it the "soap opera effect" because it reminds them of the live video look that they associate with daytime TV soap operas. The one advantage is that horizontal camera pans will no longer "judder." The disadvantage is that you get morphing artifacts when objects enter and leave the frame; when the camera pans across vertical objects, like a picket fence; and when people walk across the field of view (their legs break). I am generally a fan of just using traditional pulldown, repeating fields, not entire frames, and encoding to interlaced. |
|
|
|
|
|
|
#19 | Link | |
|
Registered User
Join Date: Feb 2002
Location: California
Posts: 2,783
|
Quote:
To make sure, I first re-visited the DGPulldown page: DGPulldown DGPulldown simply adds a pulldown flag to an MPEG-2 stream (it is only useful when encoding MPEG-2 video). This flag tells an NTSC DVD player to add fields to a 24p stream so that it plays at the correct speed on a 29.97 interlaced ("60i") monitor. It can also be used to take 25 fps material and play it on NTSC monitors without doing the usual hard conversion. This is described in this epic thread: Pulldown of 25 fps to NTSC I think that the idea fails for two reasons when applied to the OP's video. First, the ratio is wrong. 24p-->60i pulldown has a nominal ratio of 30/24 = 1.25. The OP needs to go from 16 fps to 25 fps. That ratio is 1.56. Using a 1.25 ratio will only get him to 20 fps, so the video will definitely look very slow. The bigger issue is that the whole "flag" concept only applies to NTSC, AFIK. I don't think that the DVD standard has a concept of a flag when playing PAL video. I guess that many PAL DVD players also play NTSC discs, and some PAL TV sets can also play NTSC, but even if the OP has that equipment, the video will still play too slowly. And, as already mentioned, it only works for MPEG-2 video, and only when that is encoded onto a DVD. Last edited by johnmeyer; 9th September 2014 at 15:34. Reason: Added "DVD" to "player" so that it reads "DVD player" |
|
|
|
|
|
|
#20 | Link |
|
Registered User
Join Date: Dec 2002
Location: UK
Posts: 1,673
|
IIRC DGPulldown does work for this, and can use any ratio you want. It's a while since I used it, but I'm sure I used it exactly like this.
There's no way I'd use Interframe, or any other motion interpolation, for the only final version of this. It'll look totally wrong, and since the AVIsynth motion interpolations options aren't very good, it'll introduce artefacts. Plus (depending on the ratio) the original frames are partly/mostly gone forever. However, if you want that look, many modern TVs will create it for you in real time, even from pulled-down 16fps sources, and some of them are better at avoiding artefacts than current AVIsynth scripts+functions. That said, I'd happily create a second copy/version with frame interpolation, and put that on DVD as well. No harm in that. Just preserve the original properly first. Cheers, David. |
|
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|