<br>
<div class="gmail_quote">2010/5/17 Mike Perkins <span dir="ltr"><<a href="mailto:mikep@randomtraveller.org.uk" target="_blank">mikep@randomtraveller.org.uk</a>></span><br>
<blockquote class="gmail_quote" style="padding-left: 1ex; margin: 0px 0px 0px 0.8ex; border-left: 1px solid rgb(204, 204, 204);">
<div>Thomas Pontoppidan wrote:<br>
<blockquote class="gmail_quote" style="padding-left: 1ex; margin: 0px 0px 0px 0.8ex; border-left: 1px solid rgb(204, 204, 204);"><br>Any hints on where to look for a solution to this problem?<br><br>I have trawled through the mytharchive script searching for code regarding<br>
identification of subtitles, but I only found code related to the handling<br>of DVB subtitles *after* they were selected for processing:( Where is the<br>code that selects the relevant subtitle streams?<br><br>I can't understand why teletext is treated as a subtitle stream in the first<br>
place? - I know it can contain subtitles, but there is no way Mytharchive<br>can tell which page holds the subtitles anyway, so in my opinion it never<br>makes sense to include it in a DVD project?<br><br></blockquote></div>
By convention, teletext subtitles are always on page 888.<br><br></blockquote></div>
<div><br>Problem is solved! To skip my ramling see bottom of message:-)<br><br>Hmm, conventions are fine, but in this case neither Danish nor Swedish national television broadcasters seem to adhere to conventions - DR teletext subtitles are on page 399, and SVT are on page 199 (SVT1) and 299 (SVT2). But I can see now that the correct page is actually specified in the ProjectX log (PID: 0x853(dan_i100 dan_s.hip399) so that shouldn't be a problem:) However, afaik, in Denmark teletext subtitles are only used for hearing impaired (i.e. shows with danish audio) so when a show is already subtitled either with "burned" subtitles or DVB, there are no teletext subtitles!</div>
<div> </div>
<div>I found the part of the script where the subtitles are selected in mythburn.py. But when I read the code it already seems to prefer dvbsub in this piece of code:</div>
<div> </div>
<div>04504 <span># first try to find a stream with preferred language 1</span><br><a name="128a65862d6644d2_l04505"></a>04505 <span>for</span> node <span>in</span> nodes:<br>
<a name="128a65862d6644d2_l04506"></a>04506 index = int(node.attributes[<span>"ffmpegindex"</span>].value)<br><a name="128a65862d6644d2_l04507"></a>04507 lang = node.attributes[<span>"language"</span>].value<br>
<a name="128a65862d6644d2_l04508"></a>04508 format = string.upper(node.attributes[<span>"codec"</span>].value)<br><a name="128a65862d6644d2_l04509"></a>04509 pid = int(node.attributes[<span>"id"</span>].value)<br>
<a name="128a65862d6644d2_l04510"></a>==>04510 <span>if</span> <span>not</span> found <span>and</span> lang == preferredlang1 <span>and</span> format == <span>"dvbsub"</span>:<br>
<a name="128a65862d6644d2_l04511"></a>04511 subtitle = (index, format, pid, lang)<br><a name="128a65862d6644d2_l04512"></a>04512 found = <span>True</span><br></div>
<div><br>Only if that (and the second preferred language) fails will it select the first stream:</div>
<div> </div>
<div>04525 <span># finally use the first subtitle stream</span><br><a name="128a65862d6644d2_l04526"></a>04526 <span>if</span> <span>not</span> found:<br><a name="128a65862d6644d2_l04527"></a>04527 <span>for</span> node <span>in</span> nodes:<br>
<a name="128a65862d6644d2_l04528"></a>04528 index = int(node.attributes[<span>"ffmpegindex"</span>].value)<br><a name="128a65862d6644d2_l04529"></a>04529 format = string.upper(node.attributes[<span>"codec"</span>].value)<br>
<a name="128a65862d6644d2_l04530"></a>04530 pid = int(node.attributes[<span>"id"</span>].value)<br><a name="128a65862d6644d2_l04531"></a>04531 <span>if</span> <span>not</span> found:<br>
<a name="128a65862d6644d2_l04532"></a>04532 subtitle = (index, format, pid, lang)<br><a name="128a65862d6644d2_l04533"></a>04533 found = <span>True</span><br></div>
<div><br>I found it strange that "format" is defined in upper-case (04508) and then compared to the lower case string in 04510 so I changed "dvbsub" => "DVBSUB" and now it chooses the right stream! I guess this should be reported as a bug, but I don't know how...<br>
</div>
<div style="visibility: hidden; display: inline;" id="avg_ls_inline_popup"></div><style type="text/css">#avg_ls_inline_popup { position:absolute; z-index:9999; padding: 0px 0px; margin-left: 0px; margin-top: 0px; width: 240px; overflow: hidden; word-wrap: break-word; color: black; font-size: 10px; text-align: left; line-height: 13px;}</style>