VideoHelp Forum




+ Reply to Thread
Page 1 of 2
1 2 LastLast
Results 1 to 30 of 38
  1. Hello.
    i captured a tape two times and now i want to run the two captures in an algorithm and the algorithm will return me the frames that not the same in one of the captures.

    at first i will must to trim one cupture so thiner frames numbers will provide the same picture if no problems ..
    but after that i need a avisynth algorithm in my avisynth script for this job..

    thanks for helpers!
    this is the best forum for video
    Quote Quote  
  2. Code:
    WhateverSource("video1.ext").Trim(x,0)
    WhateverSource("video2.ext").Trim(y,0)
    Subtract(v1,v2)
    You'll have to search manually/visually though.
    Quote Quote  
  3. Originally Posted by jagabo View Post
    Code:
    WhateverSource("video1.ext").Trim(x,0)
    WhateverSource("video2.ext").Trim(y,0)
    Subtract(v1,v2)
    You'll have to search manually/visually though.
    i want that it will create a log file for me.
    is this will create loge file?
    Quote Quote  
  4. Banned
    Join Date
    Oct 2004
    Location
    New York, US
    Search Comp PM
    What will you do with the log file?
    Last edited by sanlyn; 26th Mar 2014 at 06:55.
    Quote Quote  
  5. what jagabo gave me is not what i am looking.. i don't want to do this job with my eyes(see tow cuptures side by side)

    i want a script or algorithm for Avisynth that will load my tow captures and will create a log file which contains all the frames that not the same in one of my captures
    Quote Quote  
  6. Originally Posted by gil900 View Post
    Originally Posted by jagabo View Post
    Code:
    WhateverSource("video1.ext").Trim(x,0)
    WhateverSource("video2.ext").Trim(y,0)
    Subtract(v1,v2)
    You'll have to search manually/visually though.
    i want that it will create a log file for me.
    is this will create loge file?
    No. That's why I said you have to search manually. And it won't work if there are any dropped frames in the files. You might be able to use DeDup to generate a log file. It reports the opposite of what you want but you might be able to use that information.
    Quote Quote  
  7. Originally Posted by sanlyn View Post
    What will you do with the log file? If you refer to analog tape, tape never plays exactly the same way twice. Almost every frame will be "different" in some way. So it comes down to what you mean by "different" or "changed".
    i will use this info to know in where to fix the video - where to use only the good capture that not have a problem in this
    area with a problam
    Quote Quote  
  8. tape never plays exactly the same way twice. Almost every frame will be "different" in some way.
    I do not think so.

    I don't use only AVISynth to see what happens.
    i also using sony vegas for see tow Integrated captures (every on 50% opacity)
    and whwn played tow Integrated captures in that Settings, so i didn't have a sync problems for Hours of playback
    Quote Quote  
  9. Originally Posted by gil900 View Post
    tape never plays exactly the same way twice. Almost every frame will be "different" in some way.
    I do not think so.
    Then you think wrong. But the issue is "how different" they are each time and being able to set a threshold in your detection. DeDup has such options. But again, it returns the opposite of what you want (if you use it following Subtract()). You may still be able to use the output though (I've never looked at the log file).

    I verified will work for you.

    Code:
    v1=AviSource("video1.avi") 
    v2=AviSource("video2.avi") 
    Subtract(v1,v2)
    DupMC(log="dup.txt")
    Here's a sample of DeDup's log file:

    Code:
    DeDup 0.17 by Loren Merritt, based on Dup 2.20 beta 1 by Donald Graft/Klaus Post, Copyright 2004
    frm 0: diff from frm 1 = 0.0000% at (0,0)
    frm 1: diff from frm 2 = 0.0000% at (0,0)
    frm 2: diff from frm 3 = 0.0000% at (0,0)
    frm 3: diff from frm 4 = 0.0000% at (0,0)
    ...
    frm 433: diff from frm 434 = 0.0000% at (0,0)
    frm 434: diff from frm 435 = 0.0000% at (0,0)
    frm 435: diff from frm 436 = 47.9239% at (640,128)
    frm 436: diff from frm 437 = 47.9239% at (640,128)
    frm 437: diff from frm 438 = 0.0000% at (0,0)
    frm 438: diff from frm 439 = 0.0000% at (0,0)
    ...
    These two files were identical except for frame 435. With analog caps every frame will be a little different. You'll just have to look for the big differences. Of course, you'll still have to look through the video to determine which of the two is bad at each difference.
    Last edited by jagabo; 22nd Mar 2013 at 07:59.
    Quote Quote  
  10. Originally Posted by jagabo View Post
    Originally Posted by gil900 View Post
    tape never plays exactly the same way twice. Almost every frame will be "different" in some way.
    I do not think so.
    Then you think wrong. But the issue is "how different" they are each time and being able to set a threshold in your detection. DeDup has such options. But again, it returns the opposite of what you want (if you use it following Subtract()). You may still be able to use the output though (I've never looked at the log file).

    I verified will work for you.

    Code:
    v1=AviSource("video1.avi") 
    v2=AviSource("video2.avi") 
    Subtract(v1,v2)
    DupMC(log="dup.txt")
    Here's a sample of DeDup's log file:

    Code:
    DeDup 0.17 by Loren Merritt, based on Dup 2.20 beta 1 by Donald Graft/Klaus Post, Copyright 2004
    frm 0: diff from frm 1 = 0.0000% at (0,0)
    frm 1: diff from frm 2 = 0.0000% at (0,0)
    frm 2: diff from frm 3 = 0.0000% at (0,0)
    frm 3: diff from frm 4 = 0.0000% at (0,0)
    ...
    frm 433: diff from frm 434 = 0.0000% at (0,0)
    frm 434: diff from frm 435 = 0.0000% at (0,0)
    frm 435: diff from frm 436 = 47.9239% at (640,128)
    frm 436: diff from frm 437 = 47.9239% at (640,128)
    frm 437: diff from frm 438 = 0.0000% at (0,0)
    frm 438: diff from frm 439 = 0.0000% at (0,0)
    ...
    These two files were identical except for frame 435. With analog caps every frame will be a little different. You'll just have to look for the big differences. Of course, you'll still have to look through the video to determine which of the two is bad at each difference.
    I know that tape is never playing exactly the same.
    But the point is - I'm looking for just the big differences.


    From what you write, that's exactly what I was looking for.
    from what I understand from the script, I do not understand how it works.

    But thanks anyway .. I'll try this and if I have problems I will update.
    Quote Quote  
  11. Originally Posted by gil900 View Post
    From what you write, that's exactly what I was looking for.
    from what I understand from the script, I do not understand how it works.
    Subtract() subtracts one video from the other then adds 128 (so you can see "negative" results). If the frames are identical you get a flat medium grey image. If the frames are different you get something which is not a perfectly flat grey. Just look at the results of Subtract() alone and you'll get the idea.

    DupMC() compares successive frames in a video and reports how different they are. During sections where the original videos are identical you will get a long string of gray frames -- all detected as near-zero percent frame-to-frame changes by DupMC(). Where the videos are different Subtract() will give a bunch of noise and DupMC() will report that as a greater difference.
    Last edited by jagabo; 22nd Mar 2013 at 09:00.
    Quote Quote  
  12. By the way, if you can get three (or more) caps you can use a median filter to eliminate occasional playback hiccups. Things like comets, playback noise, etc.
    Quote Quote  
  13. Originally Posted by jagabo View Post
    By the way, if you can get three (or more) caps you can use a median filter to eliminate occasional playback hiccups. Things like comets, playback noise, etc.
    the trim part is the most hard part to do... in sony vegas it is very easy.
    how can know fast what number i need to write in the trim(X,0) ?
    Quote Quote  
  14. Originally Posted by gil900 View Post
    how can know fast what number i need to write in the trim(X,0) ?
    Open the two video and find some obviously identifiable frame. Subtract the frame number of one from the other. For example if frame 55 in video1 corresponds to frame 37 in video2, then trim 18 (55-37) frames off the start of video1.
    Quote Quote  
  15. Originally Posted by jagabo View Post
    Originally Posted by gil900 View Post
    how can know fast what number i need to write in the trim(X,0) ?
    Open the two video and find some obviously identifiable frame. Subtract the frame number of one from the other. For example if frame 55 in video1 corresponds to frame 37 in video2, then trim 18 (55-37) frames off the start of video1.
    I know this technique ..
    I will try to develop a technique that uses sony vegas

    EDIT:

    I succeeded invent a technique that uses sony vegas!

    Now it 's so easy to not have
    even to calculate anything!
    Last edited by gil900; 22nd Mar 2013 at 10:50.
    Quote Quote  
  16. Originally Posted by gil900 View Post
    I succeeded invent a technique that uses sony vegas!

    Now it 's so easy to not have
    even to calculate anything!
    Fantastic. Please share.
    Quote Quote  
  17. Originally Posted by smrpix View Post
    Originally Posted by gil900 View Post
    I succeeded invent a technique that uses sony vegas!

    Now it 's so easy to not have
    even to calculate anything!
    Fantastic. Please share.
    I will create a video later ..
    It's a little hard to explain but it is quite simple
    Quote Quote  
  18. Originally Posted by jagabo View Post
    Originally Posted by gil900 View Post
    tape never plays exactly the same way twice. Almost every frame will be "different" in some way.
    I do not think so.
    Then you think wrong. But the issue is "how different" they are each time and being able to set a threshold in your detection. DeDup has such options. But again, it returns the opposite of what you want (if you use it following Subtract()). You may still be able to use the output though (I've never looked at the log file).

    I verified will work for you.

    Code:
    v1=AviSource("video1.avi") 
    v2=AviSource("video2.avi") 
    Subtract(v1,v2)
    DupMC(log="dup.txt")
    Here's a sample of DeDup's log file:

    Code:
    DeDup 0.17 by Loren Merritt, based on Dup 2.20 beta 1 by Donald Graft/Klaus Post, Copyright 2004
    frm 0: diff from frm 1 = 0.0000% at (0,0)
    frm 1: diff from frm 2 = 0.0000% at (0,0)
    frm 2: diff from frm 3 = 0.0000% at (0,0)
    frm 3: diff from frm 4 = 0.0000% at (0,0)
    ...
    frm 433: diff from frm 434 = 0.0000% at (0,0)
    frm 434: diff from frm 435 = 0.0000% at (0,0)
    frm 435: diff from frm 436 = 47.9239% at (640,128)
    frm 436: diff from frm 437 = 47.9239% at (640,128)
    frm 437: diff from frm 438 = 0.0000% at (0,0)
    frm 438: diff from frm 439 = 0.0000% at (0,0)
    ...
    These two files were identical except for frame 435. With analog caps every frame will be a little different. You'll just have to look for the big differences. Of course, you'll still have to look through the video to determine which of the two is bad at each difference.
    i wrote a AutoIt3 script to reed this huge log and give me only the lines with Over different Percent i want.

    this is the script:
    Code:
    #Include <File.au3>
    
    $logfile = FileOpenDialog("Select Only the log file by DupMC()", ".", "Text files (*.txt)", 1)
    if @Error = 1 then exit
    Local $aFile 
    _FileReadToArray($logfile,$aFile)
    $file2 = "Output.txt"    
    
    $DifSet = 24 ; <---------------- put here the Number you want
    
    
    For $i = 2 to $aFile[0]
        $pres = ($i/$aFile[0])*100
        $pres2 = StringSplit($pres,".",1)
        If $pres2[0] = 2 Then $pres = $pres2[1]&"."&StringLeft($pres2[2],2)
        ToolTip($pres&"%")
        
        ConsoleWrite($aFile[$i] & @crlf)
        $var = StringSplit($aFile[$i]," = ",1)
        If $var[0] = 2 Then
            $var = StringSplit($var[2],"%",1)
            If $var[1] > $DifSet Then
                FileWriteLine($file2,$aFile[$i])
            EndIf
        EndIf
        
    Next
    MsgBox(0,"Done","Done!")
    this is make a Shorter log file with only what you need.
    i also want to write function to convert the frame number to time based on FPS rate that need to write in the script.

    i hope that it is helpful

    EDIT:
    Updated Script with frame to time conversion:

    Code:
    #Include <File.au3>
    
    $logfile = FileOpenDialog("Select Only the log file by DupMC()", ".", "Text files (*.txt)", 1)
    $logfile = "dup.txt"
    if @Error = 1 then exit
    Local $aFile 
    _FileReadToArray($logfile,$aFile)
    $file2 = "Output.txt"    
    
    $DifSet = 35 ; <---------------- put here the Number you want
    $FPSrate = 25 ; <--------------- put here the Frame Rate of your video
    
    For $i = 2 to $aFile[0]
        $pres = ($i/$aFile[0])*100
        $pres2 = StringSplit($pres,".",1)
        If $pres2[0] = 2 Then $pres = $pres2[1]&"."&StringLeft($pres2[2],2)
        ToolTip($pres&"%")
        
        ConsoleWrite($aFile[$i] & @crlf)
        $var = StringSplit($aFile[$i]," = ",1)
        If $var[0] = 2 Then
            $var2 = StringSplit($var[2],"%",1)
            
            If $var2[1] > $DifSet Then
                $var3 = StringSplit($var[1],":",1)
                $var3 = StringSplit($var3[1]," ",1)
                ; $var3[2] ----> frame Number
                $SEC = $var3[2]/$FPSrate
                FileWriteLine($file2,$aFile[$i]&" Time: "&Sec2Time($SEC))
            EndIf
        EndIf
        
    Next
    MsgBox(0,"Done","Done!")
    
    
    Func Sec2Time($nr_sec)
       $sec2time_hour = Int($nr_sec / 3600)
       $sec2time_min = Int(($nr_sec - $sec2time_hour * 3600) / 60)
       $sec2time_sec = $nr_sec - $sec2time_hour * 3600 - $sec2time_min * 60
       Return StringFormat('%02d:%02d:%02d', $sec2time_hour, $sec2time_min, $sec2time_sec)
    EndFunc   ;==>Sec2Time
    this make log like this:

    frm 52: diff from frm 53 = 44.5674% at (160,64) Time: 00:00:02
    frm 53: diff from frm 54 = 45.6558% at (480,0) Time: 00:00:02
    frm 325: diff from frm 326 = 43.1670% at (608,160) Time: 00:00:13
    frm 810: diff from frm 811 = 44.2079% at (224,544) Time: 00:00:32
    frm 811: diff from frm 812 = 45.8669% at (96,512) Time: 00:00:32
    frm 812: diff from frm 813 = 54.1498% at (480,544) Time: 00:00:32
    frm 813: diff from frm 814 = 46.2134% at (672,256) Time: 00:00:32
    frm 814: diff from frm 815 = 51.7441% at (672,512) Time: 00:00:32
    frm 816: diff from frm 817 = 57.3184% at (64,448) Time: 00:00:32
    frm 1163: diff from frm 1164 = 44.8142% at (480,320) Time: 00:00:46
    frm 1164: diff from frm 1165 = 42.6176% at (416,160) Time: 00:00:46
    frm 1167: diff from frm 1168 = 35.8070% at (416,256) Time: 00:00:46
    frm 1168: diff from frm 1169 = 53.4038% at (416,384) Time: 00:00:46
    frm 3424: diff from frm 3425 = 37.8462% at (0,192) Time: 00:02:16
    frm 3427: diff from frm 3428 = 42.3679% at (224,96) Time: 00:02:17
    frm 3428: diff from frm 3429 = 43.2060% at (128,192) Time: 00:02:17
    Originally Posted by sanlyn View Post
    What will you do with the log file? If you refer to analog tape, tape never plays exactly the same way twice. Almost every frame will be "different" in some way. So it comes down to what you mean by "different" or "changed".
    this is what i do with My Script log file:
    Click image for larger version

Name:	1.jpg
Views:	349
Size:	263.3 KB
ID:	16871

    i am using the times in my log file that the script create from the DupMC() log for vegas to know where to easily replace frames
    Last edited by gil900; 23rd Mar 2013 at 08:28.
    Quote Quote  
  19. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    Something about what you just showed and told us tells me that what you really need is just a good TBC.

    Scott
    Quote Quote  
  20. Originally Posted by gil900 View Post
    i am using the times in my log file that the script create from the DupMC() log for vegas to know where to easily replace frames
    You could also use them in AviSynth with something like:

    AviSource("video1.avi")
    v2=AviSource("video2.avi")
    ReplaceFramesSimple(last, v2, mappings="[53 53] [325 325] [434 434]...")
    Quote Quote  
  21. Originally Posted by Cornucopia View Post
    Something about what you just showed and told us tells me that what you really need is just a good TBC.

    Scott
    I start thinking about it seriously.
    But I looked here:
    https://forum.videohelp.com/threads/193619-TBC-buying-guide
    I did not see recommendations on models ..
    can you give me recommendations on something good and cheap? (Up to $ 50)

    Originally Posted by jagabo View Post
    Originally Posted by gil900 View Post
    i am using the times in my log file that the script create from the DupMC() log for vegas to know where to easily replace frames
    You could also use them in AviSynth with something like:

    AviSource("video1.avi")
    v2=AviSource("video2.avi")
    ReplaceFramesSimple(last, v2, mappings="[53 53] [325 325] [434 434]...")
    i know this Technique. But it's not as convenient as in sony vegas ..
    There are things that I'd rather to do in other programs.
    Quote Quote  
  22. Member DB83's Avatar
    Join Date
    Jul 2007
    Location
    United Kingdom
    Search Comp PM
    [QUOTE=gil900;2228968]
    Originally Posted by Cornucopia View Post
    Something about what you just showed and told us tells me that what you really need is just a good TBC.

    Scott
    I start thinking about it seriously.
    But I looked here:
    https://forum.videohelp.com/threads/193619-TBC-buying-guide
    I did not see recommendations on models ..
    can you give me recommendations on something good and cheap? (Up to $ 50)

    Did you read the topic ? $50 for a tbc did npt happen then and it will not happen now.

    The cheapest model is the AVT-8710 and you can read some more about this at:

    http://www.digitalfaq.com/forum/video-restore/1853-alternative-avt-8710-a.html
    Quote Quote  
  23. Banned
    Join Date
    Oct 2004
    Location
    New York, US
    Search Comp PM
    The AVT-8710 is not the type of tbc you want for VHS work. How many times do tbc's have to be described before the difference is understood? A line-level tbc or line tbc pass-thru is the tbc of choice for analog tape capture. Frame-level tbc's don't work the same way as line-level tbc's and do not improve many of the basic problems with VHS playback.

    You can find any of several used Panasonic or Toshiba DVD recorders from the 2000-2005 time period for around $50 that can be used for line-level tbc pass-thru. Camcorders with the same capabilty are not that numerous, and will cost more, but will accomplish the task.
    Last edited by sanlyn; 26th Mar 2014 at 06:55.
    Quote Quote  
  24. Member DB83's Avatar
    Join Date
    Jul 2007
    Location
    United Kingdom
    Search Comp PM
    @sanlyn

    Well I am really confused now. I just re-read LS's topic (link as above) and that seems to contradict your remarks.

    "Good standalone TBCs include You would do best to avoid old user TBCs found on eBay and other places -- many ancient 80s/90s TBCs work different than the ones specifically suggested here.

    S-VHS VCR Line TBC:

    Unlike the standalone TBC, this one will
    • NOT give a continual clean signal out from the VCR
    • NOT remove anti-copy signals, by replacing those often-dirty areas with new clean data
    • NOT help much with jitter -- in fact it can sometimes increase the amount of jitter "
    Quote Quote  
  25. Banned
    Join Date
    Oct 2004
    Location
    New York, US
    Search Comp PM
    If you don't know the difference between a scan line and a frame filled with scan lines, I don't know what to advise.

    When I mentioned line tbc, I'm not talking about the more crude SVHS built-in tbc's found in ancient VCR's. While they do help mitigate many problems, most of those vcr's can't play a tape without serious professional overhaul.

    line-level tbc: corrects line-by-line sync pulse of each frame. Does not correct frame-by-frame output.
    frame tbc: corrects frame sync pulse, does not correct line-by-line within each frame.

    Full-scale professional stand-alone tbc usually has complete correction. If you would like to buy one and the associated equipment required to operate it, see your banker.

    https://forum.videohelp.com/threads/319420-Who-uses-a-DVD-recorder-as-a-line-TBC-and-what-do-you-use
    Quote Quote  
  26. Member DB83's Avatar
    Join Date
    Jul 2007
    Location
    United Kingdom
    Search Comp PM
    OK. I will take you word for it but when I see an article/topic by another respected member I do also take note.

    On a side issue. My ADVC 300 has what is descibed as a Line TBC but more than one member on here states that this is not a adequate approach to VHS capture. Personally, I found a substantial improvement when using it.

    Now the majority of members on here, myself included, do not have friendly bank managers. We have to make do with compromises.

    So if neither of the stand-alones that are quoted in that topic will do the job then pray tell us, and without breaking the bank, what will.
    Quote Quote  
  27. Oops, wrong thread.
    Quote Quote  
  28. Banned
    Join Date
    Oct 2004
    Location
    New York, US
    Search Comp PM
    Originally Posted by DB83 View Post
    So if neither of the stand-alones that are quoted in that topic will do the job then pray tell us, and without breaking the bank, what will.
    You might want to browse the thread that I (and many many many others) have referred to many many many times: https://forum.videohelp.com/threads/319420-Who-uses-a-DVD-recorder-as-a-line-TBC-and-what-do-you-use

    jagabo and poisondeathray ahve posted capsule descriptions of the two types of tbc, and lordsmurf's digitalfaq site discusses the differences as well. To recap suggestions quoted many times as well (I really don't have time to look up all those posts, but they're all over the forum and go back several years), some units work well as pass-thru and some don't:

    Panasonic ES10, Toshiba "RD" and "RD-XS" series recorders up to 2005, a Philips unit discussed in several links (was that Mini-me's post? I don't remember), the DENON AVR-890 a/v receiver (which you will never find "cheap"), and a few cameras mentioned in the link posted above. I've posted a few myself from my own experience -- five videos, images, and two source videos shown here:
    https://forum.videohelp.com/threads/331681-s-video-artifacts?p=2141386&viewfull=1#post2141386
    Last edited by sanlyn; 26th Mar 2014 at 06:56.
    Quote Quote  
  29. Originally Posted by jagabo View Post
    By the way, if you can get three (or more) caps you can use a median filter to eliminate occasional playback hiccups. Things like comets, playback noise, etc.
    this filter can replace automatically the dropped/bads frames with replacement frames in the other caps?

    I did a search and I could not find it ..
    Can you give me a link to the guide of this?
    Quote Quote  
  30. Originally Posted by gil900 View Post
    Originally Posted by jagabo View Post
    By the way, if you can get three (or more) caps you can use a median filter to eliminate occasional playback hiccups. Things like comets, playback noise, etc.
    this filter can replace automatically the dropped/bads frames with replacement frames in the other caps?
    It works on a pixel-by-pixel basis, not frame-by-frame. Ie, for each pixel in a frame it looks at the three source videos and picks the median of the three. Comets and other occasional playback glitches will usually be an outlier so the median is usually a "good" pixel. The technique won't work for glitches that are on the tape itself. Those play back messed up every time so a median selection won't work.


    Originally Posted by gil900 View Post
    I did a search and I could not find it ..
    Can you give me a link to the guide of this?
    This post discusses it:
    https://forum.videohelp.com/threads/340963-Best-quality-and-speed-video-denoisers-2011?...=1#post2122313
    I changed the name of Median1() to MedianOf3(), and median2() to MedianOf5().
    Quote Quote  



Similar Threads

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