Log in

View Full Version : Damaged dv, how to extract part of video while keeping aspect ratio ?


cd090580
27th September 2008, 18:18
Hi,

I had some problem with my mini dv camera while shooting a holiday film :( My camera was displaying "head cleaning required" or "Error E04: Unit in safe mode. Please remove and reattache battery". While I got error E04, I eared the motor spinning in full speed like if it was overvolted or not connected to any mechanism.

So when I tried to play my tape, my camera was just showing an empty screen :( SO I had to borrow a friend's camera which plays the tape but with lot of artifacts. That's the best I got.

Now my camera is dead, no power at all from PSU or battery.

Here is what I got:

http://img227.imageshack.us/img227/770/samplejt4.png

Source PAL DV 720*576 shooted in 4:3 format.

So now, I'm trying to keep only the right part of the screen. But I don't know how to crop it to keep aspect ratio. Do I need to select a size which make a ratio of 1.25 ??? (like the 720*576).

Second, do I need to deinterlace before doing this king of crop ???

My final purpose if to keep the video from the right part of the clip by cropping and resizing to make it full screen again. To do this I know I will loose top and bottom of the video.

Also, is there any filter than can remove the colored macroblocks appearing ??? (there are white on the first screen, colored on the second part) ????

http://img157.imageshack.us/img157/6339/image1qy7.jpg

Thanks.

hanfrunz
29th September 2008, 14:34
You can check if the artifacts are only on one field. If so just deinterlace your video and discard the "bad" field. (use virtualdub or a avisynth script).

cd090580
29th September 2008, 14:42
The artifacts are unfortunately on both fields.

Bottom field:
http://img101.imageshack.us/img101/8563/bottomfield0000zq7.png

Top field:
http://img101.imageshack.us/img101/5229/topfieldfield0000ap8.png

Deinterlaced:
http://img101.imageshack.us/img101/7371/deinterlaced0000fo0.png

2Bdecided
30th September 2008, 10:04
I looked into solving a very similar problem (though not quite as dramatic!).

Here is what I learnt:

1. if you were recording in LP, don't. Ever. Stick to SP. LP compatibility between different camcorders can be poor, and as you've found, you might not always have your original camcorder available to play back the tape.

2. head clogging is head clogging - if that's how it was recorded, that's how it is. However, things are not always so simple - play it back a few times, and you might get errors in slightly different place (temporally and spatially) - this can be really useful for patching things.

3. Some mis-tracking, alignment and tape tension problems can be simulated on another machine - professionals can adjust a "good" machine to make it track like a "bad" machine, so giving better playback of a tape recorded on a bad machine.

4. Cedocida can output a binary mask which indicates where errors exist in the DV bitstream. Where content can't be read from the tape, the camcorder inserts flags to say so, instructing the DV decoder to guess or interpolate or copy from past/future frames/fields. So, in theory, Cedocida can give you a great map of where the errors are which need fixing. In practice, I didn't find this map was accurate enough with my damaged content to be used reliably. You might have more luck!

5. I gave up - the "best" I could imagine was correctly identifying the damaged areas (couldn't do it) and using motion compensation to fill them in from any nearby "good" frames (couldn't grab only good areas, couldn't avoid motion compensation being interrupted by bad areas) - but even that, if possible, is going to fail due to a lack of suitable match or poor motion compensation often enough to make the result unusable.


So, if you just want to deinterlace and crop your footage, that's quite easy. However, you will lose a lot of the picture, and the result will be really low resolution.

avisource("whatever.avi")
bob()
crop(360,144,360,288)
lanczosresize(720,576)

The result will be quite ugly I'm afraid.

If you're happy to slow things down dramatically, replace bob by mcbob() or similar for better deinterlacing results.
Also, replace lanczosresize(...) by nnedi(field=-1,dh=true).turnright().nnedi(field=-1,dh=true).turnleft() for better resizing results.

Change the value 144 in the crop statement to change the part of the picture that you keep: 0 = keep top, 144 = keep middle, 288=keep bottom etc.

Hope this helps.

Cheers,
David.