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. |
5th October 2013, 13:55 | #1 | Link |
Registered User
Join Date: Jul 2008
Posts: 131
|
repair frames
I though my encode had corrupted two frames, but now I've looked at the source and they are there too
What can I do to repair those 2 frames? Here's the rest of my script: Code:
tfm(mode=0, PP=2, cthresh=2, mi=60, mChroma=false, blockx=16, blocky=16).tdecimate() Smoothlevels(preset="tv2pc",TVrange=false) McDegrainSharp() |
6th October 2013, 08:54 | #3 | Link |
Registered User
Join Date: Jul 2008
Posts: 131
|
Thanks, for your reply.
Here's a sample: https://dl.dropboxusercontent.com/u/...25.demuxed.m2v the frames are between 5-6 seconds. Last edited by cybersharky; 6th October 2013 at 08:59. |
6th October 2013, 10:10 | #4 | Link |
Moderator
Join Date: Oct 2001
Location: Hawaii
Posts: 7,406
|
You don't just have 2 corrupted frames but a bunch of missing frames, over a second's worth I would guess. Maybe create a scene change using FreezeFrame or use the BadFrames.dll to blend them together.
ReplaceFramesMC(290,3)#could have just used FreezeFrame BadFrames(294,295) Sample.mp4 |
6th October 2013, 13:59 | #5 | Link | |
Aging Video Hobbyist
Join Date: Dec 2004
Location: Off the Map
Posts: 2,461
|
Quote:
|
|
6th October 2013, 19:59 | #6 | Link |
Moderator
Join Date: Oct 2001
Location: Hawaii
Posts: 7,406
|
To use FreezeFrame to freeze two frames after the first:
FreezeFrame(X,X+2,X)#where X is the frame to be frozen As for this ReplaceFramesMC, it's a bit better than Morph, but not a whole lot. If you get artifacts with Morph, you might with ReplaceFramesMC as well. It was modded by jagabo at videohelp.com from an earlier function called RX. It uses the SVPFlow1 and 2 DLLs, and I can't remember all what else. Here it is: function ReplaceFramesMC(clip Source, int N, int X) { # Replace X frames, starting at N, with motion interpolated frames # N is number of the 1st frame in Source that needs replacing. # X is total number of frames to replace #e.g. RX(101, 5) would replace 101,102,103,104,105 , by using 100 and 106 as reference points for mflowfps interpolation start=Source.trim(N-1,-1) #one good frame before, used for interpolation reference point end=Source.trim(N+X,-1) #one good frame after, used for interpolation reference point start+end AssumeFPS(1) #temporarily FPS=1 to use mflowfps super = MSuper(pel=2, hpad=0, vpad=0, rfilter=4) backward_1 = MAnalyse(super, chroma=false, isb=true, blksize=16, searchparam=3, plevel=0, search=3, badrange=(-24)) forward_1 = MAnalyse(super, chroma=false, isb=false, blksize=16, searchparam=3, plevel=0, search=3, badrange=(-24)) backward_2 = MRecalculate(super, chroma=false, backward_1, blksize=8, searchparam=1, search=3) forward_2 = MRecalculate(super, chroma=false, forward_1, blksize=8, searchparam=1, search=3) backward_3 = MRecalculate(super, chroma=false, backward_2, blksize=4, searchparam=0, search=3) forward_3 = MRecalculate(super, chroma=false, forward_2, blksize=4, searchparam=0, search=3) MBlockFps(super, backward_3, forward_3, num=X+1, den=1, mode=0) AssumeFPS(FrameRate(Source)) #return back to normal source framerate for joining Trim(1, framecount-1) #trim ends, leaving replacement frames Source.trim(0,-N) ++ last ++ Source.trim(N+X+1,0) } function InsertFramesMC(clip Source, int N, int X) { # Insert X motion interpolated frames at N # N is the insertion point # X is the number of frames to insert # the frames will be interpolated with Source frames N-1 and N as references loop(Source, X+1, N, N) ReplaceFramesMC(N, X) } But it's no cure all for motion artifacts when interpolating. |
7th October 2013, 20:06 | #8 | Link | |
Moderator
Join Date: Oct 2001
Location: Hawaii
Posts: 7,406
|
Quote:
If you just want to replace X+1 and X+2 with X, then the results are usually better if you use the built in FreezeFrame. FreezeFrame(X,X+2,X) It has nothing to do with I, P, or B frames. |
|
|
|