<div dir="ltr">That was the part I was missing. Thanks!</div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Nov 7, 2015 at 11:17 PM, Jim Stichnoth <span dir="ltr"><<a href="mailto:stichnot@gmail.com" target="_blank">stichnot@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><div class="h5">On Sat, Nov 7, 2015 at 5:39 PM, Mike Atkinson <span dir="ltr"><<a href="mailto:kdx7214@gmail.com" target="_blank">kdx7214@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">I need to maintain closed captions when transcoding. I'm using MythTV 0.28 and right now mythtranscode is not working properly (leaves garbage for video and vastly reduced volume on audio). I've written a little script using HandbrakeCLI to reduce file size and transcode, and then convert to mkv for use with MythVideo. I can even add the captions back in at any time. I use ccextractor to convert the captions into an srt file just fine.<div><br></div><div>My problem is this. When I read the cutlist and convert the frame numbers into the hh:mm:ss format I need for the srt file changes, I end up with incorrect values. For example, one of my recordings has a cutpoint at frame 45166. According to the front end, this is at 27:43.852 in the recording. When I do the math, I end up with 27:07.040. The further into the recording you go the worse the difference gets (as much as 8 minutes in a 60 minute recording).</div><div><br></div><div>I suspect there is some kind of conversion going on with the frame numbers, but for the life of me I can't find it. I tried digging through the source thinking that if I could find the code that converts frames to hh:mm:ss for the front end display during editing of a recording I could figure that out. A few hours later and I've still not found that code lol - I'm sure it's buried in a support lib or something, but damned if I can find it.</div><div><br></div><div>Anyone able to point me in the right direction to resolve this? I've basically got the entire script completed if I can get this working.</div></div></blockquote><div><br></div></div></div><div> It's possible you're getting bitten by recordings with non-constant frame rates. This can happen when the broadcaster splices 720p ads into a 1080i recording, or vice versa. And there are other more obscure ways for these kinds of things to happen.</div><div><br></div><div>MythTV deals with this by accumulating the timecode of every frame as it is recorded (or during mythtranscode or mythcommflag --rebuild), and then writing out the timecode for every keyframe into the seek table. You can access this data using "mythutil --chanid xxx --starttime yyy --getmarkup mymarkup.xml". If you look at the resulting mymarkup.xml, you will see stuff like this:</div><div><br></div><div><div> <seek data="130931" type="33" frame="3924"/></div><div> <seek data="256851428" type="9" frame="3969"/></div><div> <seek data="132432" type="33" frame="3969"/></div><div> <seek data="258378740" type="9" frame="3998"/></div><div> <seek data="133400" type="33" frame="3998"/></div><div> <seek data="260446364" type="9" frame="4030"/></div></div><div><br></div><div>Ignore the type="9" entries which are for file seek offsets. The type="33" entries give mappings between millisecond timecodes (data="130931" ==> 02:10.931) and frame numbers. Mythfrontend linearly interpolates between adjacent entries for calculations like "what timecode is frame 3980", which is pretty much always good enough.</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>Jim</div></font></span></div></div></div>
<br>_______________________________________________<br>
mythtv-users mailing list<br>
<a href="mailto:mythtv-users@mythtv.org">mythtv-users@mythtv.org</a><br>
<a href="http://lists.mythtv.org/mailman/listinfo/mythtv-users" rel="noreferrer" target="_blank">http://lists.mythtv.org/mailman/listinfo/mythtv-users</a><br>
<a href="http://wiki.mythtv.org/Mailing_List_etiquette" rel="noreferrer" target="_blank">http://wiki.mythtv.org/Mailing_List_etiquette</a><br>
MythTV Forums: <a href="https://forum.mythtv.org" rel="noreferrer" target="_blank">https://forum.mythtv.org</a><br>
<br></blockquote></div><br></div>