View Full Version : Retouch mpeg2 video
bairradino
14th February 2008, 12:49
I ordered a professional studio a DVD made from a 33 years old film.
Now I have an interlaced PAL mpeg2 video file that I want to retouch because there are a certain number of frames with scratches. The process I thought to use is:
1. separate fields
2. export all frames (even and odd) to a folder.
3. retouch the necessary frames (in pairs of even+odd frames) that have scratches.
4. reload all frames in the same order.
5. reencode with the same field dominance.
So, I ask you if you agree with this method and, in that case, how to make it, or do you suggest another better way.
I know that my method is time consuming but the film is really important.
neuron2
14th February 2008, 15:04
If it's a film, it's likely progressive, so why do you need to split it into fields?
bairradino
14th February 2008, 15:15
It was a filme, so, progressive.
Now I have a ".m2v" file in the DVD that is interlaced, that's for sure (I don't know the converting's process made by the studio).
neuron2
14th February 2008, 15:21
A "professional" studio converted film into interlaced PAL? That is perverse.
Not that I doubt you, but can you post a link to a clip of *unprocessed* source with high motion? Load the VOB into DGIndex, set a range and then demux the video with Save Project and Demux Video. Then post a link to the resulting M2V.
I'm thinking you have a one-field phase shift that can be easily corrected to get the original progressive frames back. You can test that theory by filtering with Telecide() or TFM().
scharfis_brain
14th February 2008, 15:37
@neuron2: the HAVE to create interlaced MPEG2.
cause most films are 24, 18 or 16 fps.
so called 'professional' studios don't know of solutions like arbitrary Pulldown flags.
@bairradino: provide an unprocessed sample of your MPEG2
neuron2
14th February 2008, 15:56
I beg to differ. What about the 4% speedup method?
scharfis_brain
14th February 2008, 16:01
they dismiss it as nonsense, cause it would 'alter' the movie.
actually they even capture all movies at 25p and then slow them down to their original speed using blending...
that's why I wrote 'so-called professionals'.
They also advertise not to do film speedup.
That's why they 'have' to go interlaced...
neuron2
14th February 2008, 16:22
Then let's see what the OP actually has when he posts his sample.
bairradino
15th February 2008, 10:20
S. Valentine's night took me some time...
Here you have a sample (http://www.filefactory.com/file/ddf8bc)
scharfis_brain
15th February 2008, 11:22
I had success with this script:
LoadPlugin("c:\x\DGDecode.dll")
LoadPlugin("c:\x\tdeint.dll")
LoadPlugin("c:\x\tivtc.dll")
LoadPlugin("c:\x\unblend.dll")
LoadPlugin("c:\x\removedirts.dll")
LoadPlugin("c:\x\mvtools.dll")
# Load video and smooth out blocking
Mpeg2Source("C:\forum\bairradino\film.demuxed.d2v", CPU=6)
# IVTC the video to its original 18fps
TDeint(Mode=1, TryWeave=True, Full=False)
UnBlend()
TDecimate(Mode=2, Rate=18)
# Apply automated colour correction
Crop(16, 4, 0, -4)
Tweak(bright=-16)
Coloryuv(AutoGain=True, AutoWhite=True)
# reduce dirt and scratches
vf=Last.MVAnalyse(isb=False, BlkSize=16)
vb=Last.MVAnalyse(isb=True, BlkSize=16)
cf=Last.MVFlow(vf)
cb=Last.MVFlow(vb)
Interleave(cf,last,cb)
RemoveDirt()
SelectEvery(3,1)
AddBorders(8, 4, 8, 4)
Here is the sample:
18fps-deshaked.m2v.pulldown.m2v 22MB
http://www.filefactory.com/file/99fc38/
I also applied deshaking and pulldown flags to avoid interlaced encoding.
bairradino
15th February 2008, 13:27
At the "first sight" it seems very good.
In this weekend I'll do a test.
You, guys, are genius!...
bairradino
15th February 2008, 15:58
@scharfis_brain
By the way... At line 27 you call the plugin RemoveDirt but you loaded RemoveDirts.
How can it be?
scharfis_brain
15th February 2008, 16:06
DLL names aren't the same as function names....
as you probably see with dgdecode vs mpeg2source.
btw.: get the old version of removedirt.
bairradino
15th February 2008, 18:22
Let's see if I understood...
1. There's a plugin RemoveDirt.dll
2. There's a plugin RemoveDirtS.dll
3. There's a function RemoveDirt? Searching I found more than one scripts for this function.
Are you suggesting me to load the plugin RemoveDirt.dll instead of RemoveDirtS.dll?
Or is better to use the function RemoveDirt (wich is the correct sript?) and maintain the RemoveDirtS.dll?
So much to learn...
scharfis_brain
15th February 2008, 20:05
removedirt.dll and removedirts.dll
contain exactly the same alorithms and functions, but the first one is dynamically linked (thus needs some external libraries) and the latter one is statically linked and has no dependencies to other files(libraries).
take this version of removedirt: http://home.pages.at/kassandro/RemoveDirt/RemoveDirt.zip
bairradino
15th February 2008, 20:54
Another dificulty...
It seems that UnBlend only works in YV12 colorspace.
Changing colorspaces twice will generate a quality degradation isn't it?
scharfis_brain
15th February 2008, 20:56
I don't see the problem.
MPEG2Source() delivers YV12 per default!
So yiu don't need to convert the colourspace.
bairradino
16th February 2008, 12:53
The results are brilliant.
However the film contains several frames with deffects that I wanted to eliminate (see picture)
http://mfborras.com.sapo.pt/downloads/picture.jpg
It seems to me that the only method of retouch such a thing is through an image editor like Photoshop.
What do you think?
foxyshadis
16th February 2008, 23:22
Now that you're this far, look up despot or descratch.
bairradino
18th February 2008, 11:54
As i want to make a PAL DVD with this material, for watching in a TV set, must I add a final line in the scipt with
ConvertToYUY2(interlaced=true)
before reencoding?
foxyshadis
18th February 2008, 19:10
Only when using old versions of CCE. Most encoders can directly take YV12 these days.
Wilbert
18th February 2008, 19:28
Only when using old versions of CCE. Most encoders can directly take YV12 these days.
Afaik also recent versions of CCE convert to YUY2 before converting back to YV12 again.
Blue_MiSfit
20th February 2008, 01:54
:rolleyes: lovely.
One more reason to use HC or QuEnc.
Nice work with the recovery though. Healing butchery is always a good thing.
~MiSfit
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.