<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: SMPTE 12M Timecode Support for Silverlight</title>
	<atom:link href="http://blog.johndeutscher.com/2009/02/18/smpte-12m-timecode-support-for-silverlight/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.johndeutscher.com/2009/02/18/smpte-12m-timecode-support-for-silverlight/</link>
	<description>Ideas on technology and media</description>
	<lastBuildDate>Fri, 02 Dec 2011 17:17:27 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: ltheonel</title>
		<link>http://blog.johndeutscher.com/2009/02/18/smpte-12m-timecode-support-for-silverlight/#comment-264</link>
		<dc:creator><![CDATA[ltheonel]]></dc:creator>
		<pubDate>Fri, 02 Dec 2011 17:17:27 +0000</pubDate>
		<guid isPermaLink="false">http://johndeutscher.wordpress.com/2009/02/18/smpte-12m-timecode-support-for-silverlight/#comment-264</guid>
		<description><![CDATA[Hi John,

I want to offer an alternative to the timecode struct, I had issues when I needed to roll timecode across the midnight hour: I solved it by adding code to the bad format error code, it was a quick (ugly) fix. 

recently I was playing with extention methods and thought that it might be simpler to create timecode from the DateTime and Timespan classes in the CLR, in my case I am only interested in PAL 25fps so I created a couple of extention methods. I wondered if this would be a simpler approach?  So here are the few lines of code which I worte to extend DateTime and Timespan, hopefully it may be of use to someone.

public static partial class DateTimeExtentions
    {
        public static string ToTimecodeString(this DateTime DateTime)
        {
            return GetTimeCodeAsString(DateTime.TimeOfDay);
        }

        public static string ToTimecodeString(this TimeSpan TimeSpan)
        {
            return GetTimeCodeAsString(TimeSpan);
        }

        private static string GetTimeCodeAsString(TimeSpan TimeOfDay)
        {

            long framecount = AbsoluteTimeToFrames(TimeOfDay.TotalSeconds);
            int hours = Convert.ToInt32((framecount / 90000) % 24);
            int minutes = Convert.ToInt32((framecount - (90000 * hours)) / 1500);
            int seconds = Convert.ToInt32(((framecount - (1500 * minutes) - (90000 * hours)) / 25));
            int frames = Convert.ToInt32(framecount - (25 * seconds) - (1500 * minutes) - (90000 * hours));

            return FormatTimeCodeString(hours, minutes, seconds, frames);
        }

        private static string FormatTimeCodeString(int hours, int minutes, int seconds, int frames)
        {
            string framesSeparator = &quot;:&quot;;

            return string.Format(&quot;{0:D2}:{1:D2}:{2:D2}{4}{3:D2}&quot;, hours, minutes, seconds, frames, framesSeparator);
        
        }

        private static long AbsoluteTimeToFrames(double totalSeconds)
        {
            return Convert.ToInt64(25 * totalSeconds);
        }
    }]]></description>
		<content:encoded><![CDATA[<p>Hi John,</p>
<p>I want to offer an alternative to the timecode struct, I had issues when I needed to roll timecode across the midnight hour: I solved it by adding code to the bad format error code, it was a quick (ugly) fix. </p>
<p>recently I was playing with extention methods and thought that it might be simpler to create timecode from the DateTime and Timespan classes in the CLR, in my case I am only interested in PAL 25fps so I created a couple of extention methods. I wondered if this would be a simpler approach?  So here are the few lines of code which I worte to extend DateTime and Timespan, hopefully it may be of use to someone.</p>
<p>public static partial class DateTimeExtentions<br />
    {<br />
        public static string ToTimecodeString(this DateTime DateTime)<br />
        {<br />
            return GetTimeCodeAsString(DateTime.TimeOfDay);<br />
        }</p>
<p>        public static string ToTimecodeString(this TimeSpan TimeSpan)<br />
        {<br />
            return GetTimeCodeAsString(TimeSpan);<br />
        }</p>
<p>        private static string GetTimeCodeAsString(TimeSpan TimeOfDay)<br />
        {</p>
<p>            long framecount = AbsoluteTimeToFrames(TimeOfDay.TotalSeconds);<br />
            int hours = Convert.ToInt32((framecount / 90000) % 24);<br />
            int minutes = Convert.ToInt32((framecount &#8211; (90000 * hours)) / 1500);<br />
            int seconds = Convert.ToInt32(((framecount &#8211; (1500 * minutes) &#8211; (90000 * hours)) / 25));<br />
            int frames = Convert.ToInt32(framecount &#8211; (25 * seconds) &#8211; (1500 * minutes) &#8211; (90000 * hours));</p>
<p>            return FormatTimeCodeString(hours, minutes, seconds, frames);<br />
        }</p>
<p>        private static string FormatTimeCodeString(int hours, int minutes, int seconds, int frames)<br />
        {<br />
            string framesSeparator = &#8220;:&#8221;;</p>
<p>            return string.Format(&#8220;{0:D2}:{1:D2}:{2:D2}{4}{3:D2}&#8221;, hours, minutes, seconds, frames, framesSeparator);</p>
<p>        }</p>
<p>        private static long AbsoluteTimeToFrames(double totalSeconds)<br />
        {<br />
            return Convert.ToInt64(25 * totalSeconds);<br />
        }<br />
    }</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Deutscher</title>
		<link>http://blog.johndeutscher.com/2009/02/18/smpte-12m-timecode-support-for-silverlight/#comment-242</link>
		<dc:creator><![CDATA[John Deutscher]]></dc:creator>
		<pubDate>Wed, 17 Aug 2011 21:29:23 +0000</pubDate>
		<guid isPermaLink="false">http://johndeutscher.wordpress.com/2009/02/18/smpte-12m-timecode-support-for-silverlight/#comment-242</guid>
		<description><![CDATA[Oded,

Yes, still active. Just busy.  Depending on where you picked the timecode.cs file up from that was definitely a known issue.  I think it was fixed in the Microsoft Media Platform Editor code drops and if not I can try to post an updated version that I have. It was basically a rounding issue.]]></description>
		<content:encoded><![CDATA[<p>Oded,</p>
<p>Yes, still active. Just busy.  Depending on where you picked the timecode.cs file up from that was definitely a known issue.  I think it was fixed in the Microsoft Media Platform Editor code drops and if not I can try to post an updated version that I have. It was basically a rounding issue.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: odedshafran</title>
		<link>http://blog.johndeutscher.com/2009/02/18/smpte-12m-timecode-support-for-silverlight/#comment-236</link>
		<dc:creator><![CDATA[odedshafran]]></dc:creator>
		<pubDate>Sat, 06 Aug 2011 15:44:54 +0000</pubDate>
		<guid isPermaLink="false">http://johndeutscher.wordpress.com/2009/02/18/smpte-12m-timecode-support-for-silverlight/#comment-236</guid>
		<description><![CDATA[Hi John,

I am not sure this blog is still active, but I have implemented your suggestion with TimeCode.cs for subtitle editor purposes.

When using 29.97 it works great, but in 24fps i have sometimes 1-2 frame offset between the real frame and the calculated frame from TimeCode. (I have watermarked frame counter on the movie itself - so I can compare results).

Any idea what can cause this? can this be related to this comment here where the calculation takes time more than 1 frame???

Thanks!]]></description>
		<content:encoded><![CDATA[<p>Hi John,</p>
<p>I am not sure this blog is still active, but I have implemented your suggestion with TimeCode.cs for subtitle editor purposes.</p>
<p>When using 29.97 it works great, but in 24fps i have sometimes 1-2 frame offset between the real frame and the calculated frame from TimeCode. (I have watermarked frame counter on the movie itself &#8211; so I can compare results).</p>
<p>Any idea what can cause this? can this be related to this comment here where the calculation takes time more than 1 frame???</p>
<p>Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vimal</title>
		<link>http://blog.johndeutscher.com/2009/02/18/smpte-12m-timecode-support-for-silverlight/#comment-175</link>
		<dc:creator><![CDATA[Vimal]]></dc:creator>
		<pubDate>Tue, 31 Aug 2010 15:18:54 +0000</pubDate>
		<guid isPermaLink="false">http://johndeutscher.wordpress.com/2009/02/18/smpte-12m-timecode-support-for-silverlight/#comment-175</guid>
		<description><![CDATA[Just to add, got an input file from a colleague. The input file was created using the Windows Media Encoder and had embedded timecode object, which I can check from asf viewer and windows media player, however when I transcode this .wmv using Expression encoder my output file doesn&#039;t have this timecode object. 

For Input wmv file the ASF viewer shows:
1) Header Object
2) Data Object
3) Simple Index Object
4) Timecode Index Object

For Expression Encoder generated file wmv file show:
1) Header Object
2) Data Object
3) Simple Index Object

Don&#039;t know if this helps]]></description>
		<content:encoded><![CDATA[<p>Just to add, got an input file from a colleague. The input file was created using the Windows Media Encoder and had embedded timecode object, which I can check from asf viewer and windows media player, however when I transcode this .wmv using Expression encoder my output file doesn&#8217;t have this timecode object. </p>
<p>For Input wmv file the ASF viewer shows:<br />
1) Header Object<br />
2) Data Object<br />
3) Simple Index Object<br />
4) Timecode Index Object</p>
<p>For Expression Encoder generated file wmv file show:<br />
1) Header Object<br />
2) Data Object<br />
3) Simple Index Object</p>
<p>Don&#8217;t know if this helps</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vimal</title>
		<link>http://blog.johndeutscher.com/2009/02/18/smpte-12m-timecode-support-for-silverlight/#comment-174</link>
		<dc:creator><![CDATA[Vimal]]></dc:creator>
		<pubDate>Tue, 31 Aug 2010 13:18:27 +0000</pubDate>
		<guid isPermaLink="false">http://johndeutscher.wordpress.com/2009/02/18/smpte-12m-timecode-support-for-silverlight/#comment-174</guid>
		<description><![CDATA[So far I can see the discussion had been about reading and displaying timecode in the player. 

I was wondering if there is a way to add the timecode using expression encoder as was possible earlier with windows media encoder sdk as stated in

http://discussms.hosting.lsoft.com/SCRIPTS/WA-MSD.EXE?A2=ind0511b&amp;L=wmtalk&amp;P=2441

I will be grateful to any suggestions/pointers]]></description>
		<content:encoded><![CDATA[<p>So far I can see the discussion had been about reading and displaying timecode in the player. </p>
<p>I was wondering if there is a way to add the timecode using expression encoder as was possible earlier with windows media encoder sdk as stated in</p>
<p><a href="http://discussms.hosting.lsoft.com/SCRIPTS/WA-MSD.EXE?A2=ind0511b&#038;L=wmtalk&#038;P=2441" rel="nofollow">http://discussms.hosting.lsoft.com/SCRIPTS/WA-MSD.EXE?A2=ind0511b&#038;L=wmtalk&#038;P=2441</a></p>
<p>I will be grateful to any suggestions/pointers</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Curtis</title>
		<link>http://blog.johndeutscher.com/2009/02/18/smpte-12m-timecode-support-for-silverlight/#comment-154</link>
		<dc:creator><![CDATA[Curtis]]></dc:creator>
		<pubDate>Wed, 28 Apr 2010 16:23:38 +0000</pubDate>
		<guid isPermaLink="false">http://johndeutscher.wordpress.com/2009/02/18/smpte-12m-timecode-support-for-silverlight/#comment-154</guid>
		<description><![CDATA[Your technique is fine if the timecode of the video is continuous, but I have a customer that will supply video with discontinuous timecode (stuff still only roughly edited with starts and stops). Is there any Windows compatible library for reading the timecode stream rather than just doing calculation based on start time?]]></description>
		<content:encoded><![CDATA[<p>Your technique is fine if the timecode of the video is continuous, but I have a customer that will supply video with discontinuous timecode (stuff still only roughly edited with starts and stops). Is there any Windows compatible library for reading the timecode stream rather than just doing calculation based on start time?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Deutscher</title>
		<link>http://blog.johndeutscher.com/2009/02/18/smpte-12m-timecode-support-for-silverlight/#comment-130</link>
		<dc:creator><![CDATA[John Deutscher]]></dc:creator>
		<pubDate>Wed, 06 Jan 2010 17:03:16 +0000</pubDate>
		<guid isPermaLink="false">http://johndeutscher.wordpress.com/2009/02/18/smpte-12m-timecode-support-for-silverlight/#comment-130</guid>
		<description><![CDATA[Gern geschehen. Lassen Sie mich wissen, wenn Sie irgendwelche Fragen zu sehen.
Danke]]></description>
		<content:encoded><![CDATA[<p>Gern geschehen. Lassen Sie mich wissen, wenn Sie irgendwelche Fragen zu sehen.<br />
Danke</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Polling Video – A Viable sub-second alternative? - Jesse Liberty - Silverlight Geek</title>
		<link>http://blog.johndeutscher.com/2009/02/18/smpte-12m-timecode-support-for-silverlight/#comment-129</link>
		<dc:creator><![CDATA[Polling Video – A Viable sub-second alternative? - Jesse Liberty - Silverlight Geek]]></dc:creator>
		<pubDate>Thu, 31 Dec 2009 04:27:52 +0000</pubDate>
		<guid isPermaLink="false">http://johndeutscher.wordpress.com/2009/02/18/smpte-12m-timecode-support-for-silverlight/#comment-129</guid>
		<description><![CDATA[[...] regard to my intended use of embedded “heartbeat” markers.&#160; Mike Loynd (WL) referred me to this fascinating article by John Deutscher (PM for IIS Media).&#160; That caused me to experiment with [...]]]></description>
		<content:encoded><![CDATA[<p>[...] regard to my intended use of embedded “heartbeat” markers.&#160; Mike Loynd (WL) referred me to this fascinating article by John Deutscher (PM for IIS Media).&#160; That caused me to experiment with [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: [Silverlight] TimeCode aus .wmv auslesen - Forum Fachinformatiker.de</title>
		<link>http://blog.johndeutscher.com/2009/02/18/smpte-12m-timecode-support-for-silverlight/#comment-122</link>
		<dc:creator><![CDATA[[Silverlight] TimeCode aus .wmv auslesen - Forum Fachinformatiker.de]]></dc:creator>
		<pubDate>Fri, 06 Nov 2009 16:05:51 +0000</pubDate>
		<guid isPermaLink="false">http://johndeutscher.wordpress.com/2009/02/18/smpte-12m-timecode-support-for-silverlight/#comment-122</guid>
		<description><![CDATA[[...]  [...]]]></description>
		<content:encoded><![CDATA[<p>[...]  [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Deutscher</title>
		<link>http://blog.johndeutscher.com/2009/02/18/smpte-12m-timecode-support-for-silverlight/#comment-120</link>
		<dc:creator><![CDATA[John Deutscher]]></dc:creator>
		<pubDate>Thu, 29 Oct 2009 18:51:25 +0000</pubDate>
		<guid isPermaLink="false">http://johndeutscher.wordpress.com/2009/02/18/smpte-12m-timecode-support-for-silverlight/#comment-120</guid>
		<description><![CDATA[There are no current workarounds other than to stretch out the length of the file and put in a marker where you want the end to be and to pause / stop when you reach that point. However, this workaround will change other behaviors. For instance, you won’t get MediaEnded events using that technique since you’ve effectively invented you own MediaEnded event that happens before MediaEnded.

Beyond that, the only other workaround that even remotely comes to mind is build a &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.windows.media.mediastreamsource%28VS.95%29.aspx&quot; rel=&quot;nofollow&quot;&gt;MediaStreamSource &lt;/a&gt;   and handle all of the samples yourself, but that is a fair amount of work.]]></description>
		<content:encoded><![CDATA[<p>There are no current workarounds other than to stretch out the length of the file and put in a marker where you want the end to be and to pause / stop when you reach that point. However, this workaround will change other behaviors. For instance, you won’t get MediaEnded events using that technique since you’ve effectively invented you own MediaEnded event that happens before MediaEnded.</p>
<p>Beyond that, the only other workaround that even remotely comes to mind is build a <a href="http://msdn.microsoft.com/en-us/library/system.windows.media.mediastreamsource%28VS.95%29.aspx" rel="nofollow">MediaStreamSource </a>   and handle all of the samples yourself, but that is a fair amount of work.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

