Log in

View Full Version : ShowSMPTE - Rounding Error Discovered when used in ProTools.


cjplay
2nd August 2010, 02:40
All,

The below is from my 1080p 23.976 to NTSC and PAL conversion DOS BAT script. I have to use Dropframe in my NTSC portion of the script, so I'm stuck using 29.970 as my framerate in this script.

Source = The source is a 23.976 (NTSC Film) AVI file in either UYVY, YUY2, or I420 formats.

Goal = I need to produce 3 streams (one for 1080p24, one for NTSC, and one for PAL) from it for subtitle and audio conforming at the other parts of my facility. Audio conforming is done in ProTools, just like a whole other bunch of places in the world. The subtitle conforming works fine and plays great using ShowSMPTE().

Issue = For the audio conforming, using ShowSMPTE will show a 6 frame drift with the PT's Session's timecode by the end of a 2-hour movie. While the tape captures in Digital Rapids work using the deck's burnt-in timecode to the same QT ingest profile, the file to file conversions will drift using AVS or a AVS-sourced rendered AVI as a source to the QT ingest profile. The drift would suggest the QT file is being interpreted as 29.970024 to create this and that its creation could also be subject to another rounding error.

Help? = Maybe my issue is the method of Render using Digital Rapids to make the 29.970 DF Quicktime file (I'm about to try FFMPEG), but is there any comment on this being a ShowSMPTE issue? My review of the CPP code (text-overlay.cpp) does suggest a possibility of a rounding error, but my algebraic determination of how to fix it is still in progress.

echo ########## create NTSC EVD AVS file ##########
set avsdestNTSCEVD=%filename%_NTSC_EVD.avs
echo # AVS for NTSC EVD version of %fileonly% # > %avsdestNTSCEVD%
echo av = AVISource^("%wholefile%",true^).ConvertToYUY2^(^).PointResize^(720,480^).Trim^(%trimmer%,0^) >> %avsdestNTSCEVD%
echo starttime = "%startTC%" >> %avsdestNTSCEVD%
echo ntscconv = SeparateFields^(av^).SelectEvery^(8, 0,1, 2,3,2, 5,4, 7,6,7^).Weave^(^).assumefps^(29.971^) >> %avsdestNTSCEVD%
echo FR1st = FrameRate^(ntscconv^) >> %avsdestNTSCEVD%
echo framrte = Round^(FR1st^) >> %avsdestNTSCEVD%
echo TCrate = 29.970 >> %avsdestNTSCEVD%
echo wide = width^(ntscconv^) >> %avsdestNTSCEVD%
echo high = height^(ntscconv^) >> %avsdestNTSCEVD%
echo Subtitle^(ntscconv,String^(FR1st-0.001,"%%5.3f"^) + " fps" + ", " + String^(wide^) + " x " + String^(high^) + " DFTC", x=round^(wide/2^),align=5, y=round^(high/7^), font="arial", size=round^(wide/32^), text_color=$ffffff, halo_color=$000000, interlaced=false^) >> %avsdestNTSCEVD%
echo ShowSMPTE^(fps=TCrate, offset=starttime, x=round^(wide/2^), y=round^(high/36^)+36, font="arial", size=round^(wide/16^), text_color=$ffffff, halo_color=$000000^) >> %avsdestNTSCEVD%

SynchronousArts
5th August 2010, 01:46
echo ntscconv = SeparateFields^(av^).SelectEvery^(8, 0,1, 2,3,2, 5,4, 7,6,7^).Weave^(^).assumefps^(29.971^) >> %avsdestNTSCEVD%

Everything here looks good except for your Fps of 29.971 should be 29.970.

then you're kludging the subtitle output with

FR1st-0.001

to get your text to read 29.970?

SA