Compare two frames » Wypoczynek a praca » Forum


  Users   Rejestracja   Wejście
Dzisiaj: 19.04.2025 - 17:47:03
Strony:  1  2  

Compare two frames

Ogłoszenie

.
AutorWiadomość

cargo

users




Statystyka:
Wiadomości: 26
Rejestracja: 10 maja 2010, 19:29

In another forum someone asked if it was possible to check for dropped frames in an MPEG-2 file captured with ATI MMC. When capturing directly to MPEG-2, ATI MMC automatically repeats the previous frame when a frame is dropped, so it should be possible to find dropped frames by scanning the MPEG-2 file and comparing each frame with the previous one. Even when the picture is static, two consecutive frames are never identical because of the noise, so if both frames are completely identical it would mean a frame was dropped. I'm wondering if finding and counting dropped frames in an MPEG-2 file that way is possible with an Avisynth script.

---------------------
Wiadomość # 1 25.01.25 - 19:11:12
RE: Compare two frames

culturepl

users




Statystyka:
Wiadomości: 92
Rejestracja: 08 lip 2011, 23:15

Basic concept: Code:

---------------------
Wiadomość # 2 25.01.25 - 19:15:25
RE: Compare two frames

europrzyjaciel2008

users




Statystyka:
Wiadomości: 86
Rejestracja: 22 lip 2008, 10:33

It works. I'm impressed. But I'm an Avisynth newbie (I've only used it for noise reduction) so I'd like to know how I can count the dropped frames and then create a text file with the number of dropped frames and the actual frame numbers. A text file containing something like this: Dropped frames: 3 (48,114,310)

---------------------
Wiadomość # 3 25.01.25 - 19:19:08
RE: Compare two frames

Flis

users




Statystyka:
Wiadomości: 128
Rejestracja: 24 lut 2012, 0:02

It might be possible if you can have a variable be incremented everytime the conditional hits true, and then check when the framenumber is the last (currentframenumber == framecount) and throw an error with the amount of duplicate frames found. But I am far too AVISynth noob to know if this is possible or not without extensively reading the manual and cursing at AVISynth for plaguing me with errors that I will have caused 90% of the time :D.

---------------------
Wiadomość # 4 25.01.25 - 19:26:35
RE: Compare two frames

Bartek0912

users




Statystyka:
Wiadomości: 32
Rejestracja: 28 gru 2007, 17:00

OK - I'm guessing here - I cannot test anything. (If it works at all) - load it into vdub. Let it run from start to end, and you should have the total number of drops. Code:

---------------------
31% produkcji Telewizji Polskiej finansowane jest z abonamentu [br]
Wiadomość # 5 25.01.25 - 19:31:42
RE: Compare two frames



users




Statystyka:
Wiadomości:
Rejestracja:

---------------------
Wiadomość # 6 01.01.70 - 00:00:00
RE: Compare two frames

CamilloVip

users




Statystyka:
Wiadomości: 56
Rejestracja: 12 sty 2015, 13:44

Yes, it works, but I noticed now that it reports one dropped frame too many. If I open the script in VirtualDubMod it always counts 1 dropped frame as soon as I hit the right arrow, although there is no dropped frame at the beginning of the file. All the other dropped frames are counted correctly. (This also happened with the first draft of the script.) Very interesting so far though. Edit: After adding "after_frame=true" it now counts the extra dropped frame when I hit the right arrow twice.

---------------------
Moje źródło o serwisach VOD i e-video w Polsce i na Świecie >>>
Wiadomość # 7 25.01.25 - 19:35:18
RE: Compare two frames

ziolo

users




Statystyka:
Wiadomości: 78
Rejestracja: 28 sie 2008, 22:31

I removed "after_frame=true" again. With "after_frame=true" it augments the counter one frame late. For example. If frame #107 is an exact copy of frame #106 the counter is augmented when I reach frame #108. Without "after_frame=true" the counter is augmented when I reach frame #107.

---------------------
Wiadomość # 8 25.01.25 - 19:41:41
RE: Compare two frames

spn

users




Statystyka:
Wiadomości: 2
Rejestracja: 07 kwie 2009, 10:44

oh right - frame 0 will always count as a duplicate, as it will compare itself to frame -1, which is then corrected to frame 0 (itself). Just initialize it to "-1", and you'll get the correct count. The "after_frame" funtionality is to be expected, as it will make the framescript evaluate after the frame with the counter has been drawn. I know other people here will be able to help you print out frame numbers to a file.

---------------------
Wiadomość # 9 25.01.25 - 19:48:18
RE: Compare two frames

Willyouth

users




Statystyka:
Wiadomości: 11
Rejestracja: 06 gru 2017, 18:59

For outputting frames to a textfile, try using , use the Write() function (you'll need to download the chr_25_dll_20030920 version). The example given in the readme (slightly modified): Code:

---------------------
Wiadomość # 10 25.01.25 - 19:51:39
RE: Compare two frames
7 Questions about textures & motion vectors... : Poprzedni tematNastępny temat: Session with "bad spots"?
Strony:  1  2  

Administrator zabronił gościom odpowiadać na wiadomości! Aby się zarejestrować, kliknij link: rejestr


Uczestnicy