English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Besides the standard ratio calculations using 30000:1001 for NTSC is there a good algorythm for converting NTSC frames to time (or pixel mapped to time) that doesn't produce noticable rounding errors? (I'm drawing a time line with video and audio tracks, occasionally the vid track is offset by a frame due to the above approximate).

2006-09-15 03:09:49 · 2 answers · asked by Pirate AM™ 7 in Computers & Internet Programming & Design

2 answers

Here are the ntsc subcarrier parameters that determine frame timing:
Subcarr. frequency (MHz) 3.579545
Subcarr. cycles per line 227.5

This gives a line frequency of 15,734.264Hz
Now the NTSC field is 262.5 lines, giving a field rate of
15,734.264 % 262.5 = 59.940053333 exactly.
Give me 50Hz PAL any day of the week, it is actually sane.

With audio at 48Khz sr, you are looking at 800.800088266 samples per field.

Personally I would maintain a reference to an arbitary origin time then compute audio sample and video field as

Video field = (int)(59.940053333 * seconds) (possibly in a fixed point long long like this:

f = (unsigned long long) (59940053333LL * (unsigned long long) miliseconds)/1000000000000LL;

Doing the audio or going the other way should be trivial.

I dont know if you are having to preserve the subcarrier phase information in your app, but don't forget this syncs across 4 fields...

Oh, and some BB generators also provide wordclock that may of may not obay the exact ratios described here, just to add to the fun.

HTH.

Regards, Dan.

2006-09-15 07:08:09 · answer #1 · answered by Dan M 3 · 0 0

That's why it's called Time Base Correction.

Unless you could manage an impossibly high sampling rate, I don't see any way of rounding off without inducing errors... but then what do I know?

When it comes to TBC's... I don't design them, I just buy the best ones I can find on the market and install them. Whatever artifacts remain, generally the Frame Sync will clean it up.

2006-09-15 03:17:21 · answer #2 · answered by Anonymous · 0 0

fedest.com, questions and answers