VideoHelp Forum




+ Reply to Thread
Results 1 to 22 of 22
  1. The footage was shot with camera wich turned out had broken head.
    The video is recorded with many blocks appearing here and there.
    Is there a program or a VirtualDub filter which can recognize and remove large sqare blocks by their shape, light or color, or some other parameter?
    Or is there an easy way to select broken areas and fill them with information from good frames?
    Cann't tell it's possible don't tell anything.
    Quote Quote  
  2. Please post an example frame so we can see what kind of blocks you mean...
    John Miller
    Quote Quote  
  3. Here is a sample (a headless woman ):

    I have found different cameras show blocks in different places. I will make sevaral DV captures of entire tape with different cameras and combine them into one by Avisynth script. Because it appears each camera draws blocks in a different constant place throughout the footage. It will be kind of patchwork
    Cann't tell it's possible don't tell anything.
    Quote Quote  
  4. Member 2Bdecided's Avatar
    Join Date
    Nov 2007
    Location
    United Kingdom
    Search Comp PM
    Does the camcorder it was recorded on play the tape better?

    The DV decoder Cedocida can flag up the pixels+blocks with errors, but I didn't find this information as accurate as it should be.

    Cheers,
    David.
    Quote Quote  
  5. Originally Posted by 2Bdecided
    Does the camcorder it was recorded on play the tape better?
    No, actually its head has been replaced. Other cameras play the video better or at least different which give me hopes of success in combining different captures. I will post the same frame captured form other cameras when the client brings them to me.

    Thanks for the codec tip. Now I can at least open the DV capture in VirtualDubMod, not only in VirtualDub.
    Cann't tell it's possible don't tell anything.
    Quote Quote  
  6. I can't see the picture for some reason.
    John Miller
    Quote Quote  
  7. johhny - it's a gif not the usual jpg. what browser are you using?
    Quote Quote  
  8. I can see it now (weird).

    Anyhoo, the DV specification defines an error concealing scheme whereby corrupt blocks are replaced by those from previous frames. The bits of the chopped off head that repeat three times are slightly shifted with respect to each other. i.e., within those blocks, the solid grey/white part shifts to the left and more of the interlaced part shows up. Another clue as to what is going on is that the blocks appear in three horizontal bands on the video each three blocks high. Knowing the layout of blocks in the DV frame and comparing to the pattern on the video indicate that the errors are due to one of the two heads - most likely during the initial recording. Unfortunately, there's no way to recover the information unless, as you say, different camcorders give errors at fixed but different locations. You'd need three such sources to work out the bad one.
    Quote Quote  
  9. Now, when I have two captures from different cameras I see the errors are mostly in same places. But there are many which differ. In the sample the top frame is appearantly better but two circled group of blocks are better on the bottom one.
    It would be great if there was a program which could see if block has errors and look at the another file and see if it is without. Then it could take the block from the errorless version.

    I don't think that most of the errors are permanent and gathered during filming. There are no gray blocks. I mean they all have data from previous frames.

    I even think that if there was a way to capture the film slower (e.g. 2 times slower) the camera would read the tape without errors.

    Both frames are shot and now captured with two Sony DVR-TVR460E PAL cameras. They are not shot on DV tapes, but on High8. The guy who shot the video told me they are twice as cheeper but both record digitally.

    If I use AviSynth StackHorizontal command the frames match flawlessly throughout the video (I mean there are no missing frames).

    There is one another problem. The sound is flawless only when captured through analog port. In DV it is kind of stopped and resumed every each few seconds. I will capture audio in analog. The video device motors are usualy quite precise. I have added a language audio track recorded from old VHS tape to DVD rip. Suprisingly the 3 hour footage matched ideally except for some 1-2 sec delay at 5-10 places at scene change.



    P.S. I use GIF, because JPEG would not be too smart at figuring out how to compress interlace. Also the number of colors here hardly exceeds 255. I mean, it is kind of lossless way to present those frames.
    This time I put image on american host for it opens faster to you.

    Originally Posted by JohnnyMalaria
    You'd need three such sources to work out the bad one.
    Why three?

    Originally Posted by 2Bdecided
    The DV decoder Cedocida can flag up the pixels+blocks with errors
    How can this information be used to alter correction of the bad pixels/blocks?

    If the information is presented in text format with number of frame and coordinates of suspicious blocks/pixels I could write a Word Macro which compares the information and writes a rather huge AviSynth script file with defeniton of every frame how it is combined from both videos.
    Cann't tell it's possible don't tell anything.
    Quote Quote  
  10. Without the error information from inside the DV stream to identify bad blocks (as 2Bdecided refers to with Cedocida), it isn't possible to tell which is the bad block when comparing two frames captured from the same tape played in different camcorders. Our brains can work it out but unless you resort to extremely complex artificial intelligence, a computer cannot. With three frames to work with, two will (should) give very similar block content while the third will be much different. I say 'should' because there may be very slight differences. You would use a root mean square approach to choose the most errant block of the three. Armed with the error flag info from the DV data, it would be much more straightforward. Based on your samples, the error-flagging approach is viable and actually quite simple(ish). A DirectShow filter could do the job. Are you familiar with DirectShow programming at all?
    Quote Quote  
  11. Member 2Bdecided's Avatar
    Join Date
    Nov 2007
    Location
    United Kingdom
    Search Comp PM
    The first thing you need to do is check where cedocida flags errors, and see if it matches those you're seeing. It's "easy" enough with AVIsynth.

    If it works properly, it's possible to use mask tools to replace the problem areas.

    However, as I said, when I tried this, the errors cedocida flagged weren't exactly matched to the actual visible errors in the video, so I gave up.

    Cheers,
    David.
    Quote Quote  
  12. Originally Posted by JohnnyMalaria
    Without the error information from inside the DV stream
    Since the bad blocks are replaced with ones from previous frames how can it be the codec is unaware of them?
    Does it by default points to last good block in case of absence of information and throws the bad data out during the capture?
    Or the information is still present in DV capture in "unreadable" condition. I have four 21Gb files of two 90 minute recordings in DV format. Do you mean the error information is present only on tape?

    The idea of comparing 3 recordings sounds good and interesting. But I actually do not have any notion of "DirectShow programming". I remember the name of square root or square method from studies of Economics in Riga Technical University, but I do not remember what was the method's point.

    Originally Posted by 2Bdecided
    It's "easy" enough with AVIsynth.
    I can't find a way to ask Ceocida report the errors. There are no guides or manuals for Cedocida. I have no clue how you figured out about options of this codec. Are they kind of AviSource parameters...
    I tryed open in VirtualDubMod with show additional options check box selected during open, but didn't see meaningful options. VirtualDubMod's Error reporting tool does not reveal any "unreadable" frames.
    May there be any luck by accessing the DV AVI like uncompressed text document?

    Originally Posted by 2Bdecided
    to use mask tools
    Mask tool sounds more promising then combining the clips with crop and stack methods...
    But this means the Cedocida codec has to be able produce a "mask" clip.
    Cann't tell it's possible don't tell anything.
    Quote Quote  
  13. Member 2Bdecided's Avatar
    Join Date
    Nov 2007
    Location
    United Kingdom
    Search Comp PM
    Sorry, it's quite obscure, here's how to do it:

    http://forum.doom9.org/showthread.php?t=106238

    Hope this helps.

    Cheers,
    David.
    Quote Quote  
  14. That was quick one.
    Thanks, so far so good - I downloaded the codec & analyzer, found binary in release folder and installed.
    But I do not understand how do you bring up the dialog:

    Or how the line
    "errors=converttoyv12(avisource("filename.avi",pix el_type="yuy2"))"
    brings up errors?
    I wrote line:
    StackHorizontal(Trim(Avisource("Oleg 1A.avi"),570,0), Trim(converttoyv12(avisource("Oleg 1A.avi",pixel_type="yuy2")),570,0))
    wich gave me identicaly looking samples.

    Adding "errors=levels(errors,150,1,200,0,255)" kind of line do not bring up results any close to expected.

    If you configure what kind of stream is displayed in dialog then how do you manage to show both streams together?
    Cann't tell it's possible don't tell anything.
    Quote Quote  
  15. Originally Posted by kurbads
    Originally Posted by JohnnyMalaria
    Without the error information from inside the DV stream
    Since the bad blocks are replaced with ones from previous frames how can it be the codec is unaware of them?
    Does it by default points to last good block in case of absence of information and throws the bad data out during the capture?
    Or the information is still present in DV capture in "unreadable" condition. I have four 21Gb files of two 90 minute recordings in DV format. Do you mean the error information is present only on tape?
    The DV specification gets a bit woolly in places but it does define how to indicate bad blocks. Very few software codecs take it into account. i.e., they just look at the video block data and decompress them blindly. It makes sense since if there are bad blocks, there's not much that can really be done. The camcorder usually takes care of managing the bad blocks and, typically, this is at the time of reading back from the tape. A significant proportion of data on the tape is for error correction, especially the audio. It is easier to mask video errors than audio so the audio gets more error correction information. When the camcorder plays the tape, it can determine from the error correction information whether data are corrupt. For the video, this usually means an entire 8x8 block is damaged or, in worse cases, a macroblock (32 x 8 for NTSC) or a superblock (5 macroblocks scattered across the screen). The camcorder either replaces the bad block(s) with those from a previous (or even subsequent) frame or leaves them as-is. It sets the error flag in the DV stream and sends it on to the PC etc.

    Re the Cedocida error display, the decoded frame is displayed as a standard RGB frame. DV uses a method whereby the black-and-white information (luma) is separated from the color information (chroma). The color information is stored at a lower (half) resolution but still as 8x8 blocks (a pair, actually). To see where the errors really are, decoded video frame should be displayed as separate images - luma and chroma. I can't remember if the Cedocida codec can decode to a suitable format or not. It would be important if you want to use it for helping find bad blocks.

    The error flags are actually quite simple to extract from the DV file and it would be possible to build a text file containing a list of co-ordinates for bad blocks for each frame. I don't know the finer points of AviSynth/VDub but I suspect something could be written to take that information and use it to specify a mask. If I get a chance, I'll have a quick fiddle around to come up with something to scan a DV file and generate a list of erroneous blocks. I think it might be useful for others.
    John Miller
    Quote Quote  
  16. Originally Posted by JohnnyMalaria
    A significant proportion of data on the tape is for error correction, especially the audio.
    If analog audio capture is fine and digital is not, does it mean the error corection of audio on camera is done better than on PC? Is the capturing software is responsible for defective PCM where nothing can be done? I tryed digital capture with different apps like Pinnacle Studio 9 and 11, Movie Maker and some freeware apps, all they recorded faulty audio. But audio is fine when played on camera and when captured in analog.

    Can I alter the way the digitally captured audio is decoded on PC?

    Originally Posted by JohnnyMalaria
    The error flags are actually quite simple to extract from the DV file and it would be possible to build a text file containing a list of co-ordinates for bad blocks for each frame.
    How? And I wonder what would be the format - lines with comma delimited values? Then the list of numbers of 8x8 pixel block. I assume there would be 6480 blocks per frame (720x576/8/8). One list could be made for luma and other for chroma damaged blocks.
    Cann't tell it's possible don't tell anything.
    Quote Quote  
  17. Most (if not all) software-based DV decoders ignore any/all error flags in the DV stream - both audio and video.

    DV hardware carrying the DV logo is required to correct data according to the errors reported. So, your camcorder may simply be applying correction to the audio before converting it to analog. An interesting test would be to send your captured video back to the camcorder and listen to the analog audio. If it still sounds okay then it does strongly suggest that the camcorder applies its own correction prior to D/A conversion.

    Re the format for bad block reporting, I would most likely implement it in two stages - one to generate the information in a binary format and a second to take that and display/use it as required.
    Quote Quote  
  18. Member 2Bdecided's Avatar
    Join Date
    Nov 2007
    Location
    United Kingdom
    Search Comp PM
    Originally Posted by kurbads
    But I do not understand how do you bring up the dialog:
    There are several ways.

    On Windows XP, one way is Start>Control Panel (classic view) > Sounds and Audio Devices > Hardware > Video Codecs > Properties > Properties > Cedocida DV codec > properties > settings

    and there it is!

    (I bet there's a quicker way - right click my computer > device manager - is an easier way through half of that - but some strange people delete my computer)

    Or how the line
    "errors=converttoyv12(avisource("filename.avi",pix el_type="yuy2"))"
    brings up errors?
    That's easy. In the dialogue, you tick the box and select the button to show the block errors via YUY2 (for example) and this leaves normal video via another colour space (YV12 for example). Then when AVIsynth requests YUY2 data from the DV codec, it gives it the error information, and when it requests YV12 data from the DV codec, it gives it the normal video. It's a clever way of using the same codec twice.

    I wrote line:
    StackHorizontal(Trim(Avisource("Oleg 1A.avi"),570,0), Trim(converttoyv12(avisource("Oleg 1A.avi",pixel_type="yuy2")),570,0))
    wich gave me identicaly looking samples.
    Which is what will happen unless you tell it to send the error information via YUY2 in the dialogue box.

    If you configure what kind of stream is displayed in dialog then how do you manage to show both streams together?
    I think I've explained this above.

    Hope this helps.

    Cheers,
    David.
    Quote Quote  
  19. I was finally able to see reported errors. They realy are not too acurate.

    To see if using blocks from one video reported as errors in another I tryed to apply Mask and Layer commands.
    But I could not figure out how to use them. All those commands have only two clips as parametes. Maybe some of commands make some parts of video transparent and some opaque then applying such semitransparent video to another would reveal masked areas. But I could not figure out how to do it. Maybe somebody can help me.
    I am not sure what the next script does. It certainly removes one bad block in one frame.

    Code:
    Video1 = Trim(Avisource("Oleg 1A.avi"),570+4780,0) #The better video
    
    Error1 = Levels(Trim(converttoyv12(avisource("Oleg 1A.avi",pixel_type="yuy2")),570+4780,0),150,1,200,0,255) #Errors of the better video
    
    Video2 = Trim(Avisource("Oleg 1.avi"),877+4780,0) #Worse video
    
    Error2 = Levels(Trim(converttoyv12(avisource("Oleg 1.avi",pixel_type="yuy2")),877+4780,0),150,1,200,0,255) #Errors of the Worse video
    
    Video1RGB = ConvertToRGB(Video1) #Convert all to RGB for use with mask
    
    Error1RGB = ConvertToRGB(Error1)
    
    Video2RGB = ConvertToRGB(Video2)
    
    Error2RGB = ConvertToRGB(Error2)
    
    Mask1 = Mask(Video2RGB, Error1RGB)
    
    Result = Layer(Video1RGB, Mask1, "add")
    
    StackHorizontal(Error1RGB,Video1RGB,Error2RGB,Video2RGB,Result)
    Interestingly that one large block which reported in video1 and is not visible there is clearly visible in video2 and is not reported.
    Would anybody be interested if I post a 3600x576 result video screenshot which barely fits on my multimonitor 3200x1080 pixel desktop?

    Also it was good if it was possible to remove from mask reported errors in places where the same error from both videos is reported to leave mask blank in those places. Then try to apply masks in both directions to see which one is better if it is.

    Could somebody skilled in the mentioned DirectShow programming look into the source code of Cedocida mod and see if maybe there is some simple mistake why it is reporting errors so wrongly?

    If I get a chance, I'll have a quick fiddle around to come up with something to scan a DV file and generate a list of erroneous blocks.
    When would you possibly could get a chance? You see, the cost of effort I have made in the direction of recovery of those tapes have already greatly exceded any possible revenue I could gain. It means I can not offer you any more tangable incentives than glory and fame.
    Cann't tell it's possible don't tell anything.
    Quote Quote  
  20. Bump... I can't believe nobody in whole world has never tryed to recover faulty DV video with apparently different results from different cameras and has no experience to share.
    Cann't tell it's possible don't tell anything.
    Quote Quote  
  21. OK, I can finally summarize the results:

    What I tryed:
    -I tryed to use error information from one file to replace the erroneous places from another file.

    What I got:
    -A managed to write an AviSynth script which does that. And indeed some errors are corected.

    The conclusion:
    -The error report is so inacurate it reports good parts as bad which when replaced in case the second video in these places is bad become bad. Also many bad places ar not replaced with good ones from second file because they are not reported as errors. Thirdly there are good places which are reported as errors, but they are good in both videos so they do not count.

    Here is my latest script:

    Code:
    Video1 = Trim(Avisource("Oleg 1A.avi"),570+4780,0) #The better video
    
    Error1 = Levels(Trim(converttoyv12(avisource("Oleg 1A.avi",pixel_type="yuy2")),570+4780,0),150,1,200,0,255) #Errors of the better video
    
    Video2 = Trim(Avisource("Oleg 1.avi"),877+4780,0) #Worse video
    
    Error2 = Levels(Trim(converttoyv12(avisource("Oleg 1.avi",pixel_type="yuy2")),877+4780,0),150,1,200,0,255) #Errors of the Worse video
    
    Video1RGB = ConvertToRGB(Video1) #Convert all to RGB for use with mask
    
    Error1RGB = ConvertToRGB(Error1)
    
    Video2RGB = ConvertToRGB(Video2)
    
    Error2RGB = ConvertToRGB(Error2)
    
    Fast1 = Layer(Video1RGB, Error1RGB, "fast") #Quick preview of error report as semitransparent layer over the video
    
    Fast2 = Layer(Video2RGB, Error2RGB, "fast")
    
    Mask1 = Mask(Video2RGB, Error1RGB) #The cool feature of avisynth which makes "holes" in video according to mask
    
    Result = Layer(Video1RGB, Mask1, "add") #Now the first video reported errors are covered with parts of second video
    
    StackHorizontal(Fast1, Video1RGB, Video2RGB, Result)
    So it is fifty/fifty improvment/worsening.

    I do not see how to proceed without help of JohnnyMalaria and 2Bdecided.
    Cann't tell it's possible don't tell anything.
    Quote Quote  
  22. Member 2Bdecided's Avatar
    Join Date
    Nov 2007
    Location
    United Kingdom
    Search Comp PM
    I can't help you kurbads - that's exactly where I got stuck!

    The person who might be able to help is the author of the modified cedocida which flags the errors. I've tried and failed to contact him several times.

    IIRC there's source code available, but I'm no programmer.

    Maybe JohnnyMalaria has product opportunity here!

    Chers,
    David.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!