View Single Post
Old 14th August 2013, 18:52   #15  |  Link
MrJ
Registered User
 
Join Date: Jul 2013
Posts: 7
Quote:
Originally Posted by StainlessS View Post
# ERROR, Causes -ve crop at eg current_frame==0
Thanks Stainless Steel.

Well spotted with the zero frame error. I did my number crunching from the start of the clip. I had turned on the camera early while I fiddled around with the microphones. I'm glad you both posted different solutions. I always learn things that way. I've added a new parameter dv which should avoid this error even with crop and also reframes the video.

Quote:
Originally Posted by Gavino View Post
It will also give a smoother continuous pan than jumping by discrete pixels via Crop().
I like the results from Spline36Resize. I would never have thought of using it before posting here so thanks a lot.

Quote:
Originally Posted by IanB View Post
The resizers are implemented as separable horizontal and vertical functions. As the horizontal part is invariant for this application it may be worthwhile taking that element out of the ScriptClip.
This was an education. I only included data for the vertical motion in my earlier post because the the vertical motion was more pronounced and very displeasing to the eye. I've now included a horizontal correction too although I probably didn't need to as the panning is very slow and not particularly displeasing to the eye. All the same your post was really helpful in showing how the resizer works.

Quote:
Originally Posted by Gavino View Post
Good point, Ian.

It's also worth saying for Mr J's benefit that the script assumes a progressive source.
If the source is interlaced, it will have to be deinterlaced before the main processing.
The camera is a JVC GZ-HD7. It's an early Everio HDD model and heats up considerably when in use which is what caused the problem in the first place. I've used plasticine before with a DV tape camera and had no trouble whatsoever. I must remember to leave the quick release plate with the tripod. If I want to take stills it's attached to the video camera and vice versa. The camera is NTSC and I usually work with PAL so am not clear on deinterlacing to covert between formats. It's also complicated by the camera having about 3 dead pixels which I think the h264 is smearing around making it look like a whole cluster is bad. Unfortunately there's no way to remap the pixels on the camera without sending it back to the manufacturer. Any advice on deinterlacing and fixing dead pixels would be welcome although even with them the video is a million times better than it was a couple of days ago.

Quote:
Originally Posted by raffriff42 View Post
shouldn't you enlarge a bit at the same time - just enough to keep the project resolution of 1920x1080 after processing?
The video is probably heading for Vimeo or YouTube so 1920 x 1080 is a bit big for them. Having said that I might well resize for a 720 x 576 PAL DVD but that might give me problems deinterlacing. I might also make an AVCHD DVD if I feel like some extra effort. I've still not mastered the art of deinterlacing. Again any advice of where to read etc would be welcome.

Quote:
Originally Posted by StainlessS View Post
you can insert proper links in post by clicking on the little globe (auto link insertion is currently broken).
Fixed now thanks.

Code:
#LoadPlugins
mpeg2source("f:\....d2v")
ConvertToYUY2()
RemoveDeadPixels(869, 544, 15) # try to fix dead pixel YUY2 only
#separatefields?
#Bob?

orig = last
ScriptClip(PointResize(1280,720), """
    x = current_frame    #time dependant variable
    
    av = 0.0000000364  #constants for fixing vertical motion
    bv = 0.00176
    cv = -10.6
    dv = 110             #number of pixels to crop off the top of the 1080 frame to reframe shot.
    
    ah = 0.00000000952  #constants for fixing horizontal motion
    bh = 0.000477
    ch = -0.3
    dh = 320             #number of pixels to crop off the left edge of the 1920 frame to recentre frame

    
    pd = av*x*x+bv*x+cv    #number of pixels to crop off the top of the 1080 frame to remove accidental tilt (increasing quadratic)
    pdown = pd + dv         #number of pixels to crop off the top of the 1080 frame to remove accidental tilt and reframe.(value = 110 at frame zero then increasing quadratic)
    
    pl = ah*x*x+bh*x+ch    #number of pixels to ADD to left edge of the 1920 frame to remove accidental pan (increasing quadratic)
    pleft = dh - pl        #number of pixels to SUBTRACT from left edge of the 1920 frame to remove accidental pan and recentre. (value = 320 at frame zero then decreasing)
  
    orig.Spline36Resize(1280, 720, pleft, pdown, 1280, 720)
""")

converttoYV12.SmoothLevels(9,1,170,0,255,show=false,Lmode=3).SmoothTweak(0,1,0.9,0,3)
vid=last
#aCam=FFaudiosource("F:....mp2")                                                #audio from camera
aMic=wavsource("F:....wav")                              #audio from microphone
audiodub(vid,aMic).trim(4000,52903).FadeIn(30).FadeOut(60)
It's still not finished but I still haven't read all the deinterlacing stuff yet. I thought you might like to comment on the script so far.
Andy
MrJ is offline   Reply With Quote