Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.


Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Development

Thread Tools Search this Thread Display Modes
Old 2nd August 2010, 02:40   #1  |  Link
Registered User
Join Date: Sep 2007
Posts: 17
ShowSMPTE - Rounding Error Discovered when used in ProTools.


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%
cjplay is offline   Reply With Quote
Old 5th August 2010, 01:46   #2  |  Link
Multimedia Grunt
SynchronousArts's Avatar
Join Date: Apr 2008
Location: People's Republic of Kaulifonnia
Posts: 29
  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

to get your text to read 29.970?

Grunt: 4b- one who does routine unglamorous work
SynchronousArts is offline   Reply With Quote

bat script, dos script, showsmpte, timecode

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +1. The time now is 14:05.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.