oyvindln/vhs-decode

Sync detection error ntsc-j vhs tape

Infrid opened this issue · 4 comments

Infrid commented

There is something that upsets the sync algorithm, I've been discussed about this problem on discord for a while, seems worth to open an issue here.

This Japanese tape has been transferred with DoD by Mighty @harrypm , so I assume at this stage everything was done correctly 😅, at some point there is a very visible sync issue

ac3-mission00-sync-error.mp4

command used

./decode.py vhs --debug -f 40 --tape_format vhs --system NTSC --recheck_phase --threads 8 debug/ac3-mission00-sample-sync-error.ldf debug/ac3-sample-plain

Things are a bit better if I append --level_detect_divisor 6 but still not optimal result

ac3-sample-level_detect_divisor6.mp4

./decode.py vhs --debug -f 40 --tape_format vhs --system NTSC --recheck_phase --threads 8 --level_detect_divisor 6 debug/ac3-mission00-sample-sync-error.ldf debug/ac3-sample-plain

You can find the sample .LDF file here https://mega.nz/folder/p4RSAIAA#LzBCNH_NkIac-Ob-CodvHA

I am using the latest version of the decoder from vhs_decode branch

To be fair, @harrypm managed to pull out a stable image eventually using this command

decode.exe vhs --debug --tape_format vhs --system ntsc --recheck_phase --chroma_trap --threads 8 --high_boost 6

ac3-decode-no-error.mp4

but that version doesn't retain the detail I wanted and it was a compromise to fix another problem on high frequencies. I can give you details on that, but it's not related to this sync error.

thanks!

Infrid commented

Additional notes from the chat, especially for me, so they won't get lost in discord

hmm something is screwing with level detection on those frames for whatever reason, if you use
--use_saved_levels
it doesn't happen

Infrid commented

thank you so much, here a before/after comparison for the users out there!

ac3-mission00-sync-error.mp4
ac3-mission00-sync-fix.mp4

Something in the signal causes the vsync serration algorithm to interpret something as vertical sync that isn't, and detect the completely wrong levels, and something with the fallback/failsafe logic is failing. I'm not entirely sure what but looking at it I think some of this code needs a bit of rework.

If you just want to decode it for now running with ----use_saved_levels should bypass the problem since it just re-uses the detected levels from the first good field.