In hls,How to use #EXT-X-DISCONTINUITY-SEQUENCE for client? - http-live-streaming

4.3.3.3. EXT-X-DISCONTINUITY-SEQUENCE
The EXT-X-DISCONTINUITY-SEQUENCE tag allows synchronization between
different Renditions of the same Variant Stream or different Variant
Streams that have EXT-X-DISCONTINUITY tags in their Media Playlists.
what`s Variant Streams?
I think means one of Master Playlist,like http://example.com/low.m3u8 right?
Master Playlist
> #EXTM3U
> #EXT-X-STREAM-INF:BANDWIDTH=1280000,AVERAGE-BANDWIDTH=1000000
> http://example.com/low.m3u8
> #EXT-X-STREAM-INF:BANDWIDTH=2560000,AVERAGE-BANDWIDTH=2000000
> http://example.com/mid.m3u8
> #EXT-X-STREAM-INF:BANDWIDTH=7680000,AVERAGE-BANDWIDTH=6000000
> http://example.com/hi.m3u8
> #EXT-X-STREAM-INF:BANDWIDTH=65000,CODECS="mp4a.40.5"
> http://example.com/audio-only.m3u8
each time server remove a EXT-X-DISCONTINUITY from the playlist you
must increment the EXT-X-DISCONTINUITY-SEQUENCE
each time server removea segment from the playlist you must increment
#EXTM3U
#EXT-X-DISCONTINUITY-SEQUENCE:0
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-ALLOW-CACHE:NO
#EXT-X-VERSION:2
#EXT-X-TARGETDURATION:8
#EXTINF:8,
fragment1.ts
#EXTINF:8,
fragment2.ts
#EXTINF:8,
fragment3.ts
#EXTINF:8,
fragment4.ts
#EXTINF:8,
fragment5.ts
#EXTINF:8,
fragment6.ts
#EXTINF:4,
fragment7.ts
#EXT-X-DICONTINUITY
#EXTINF:8,
fragment0.ts
when i playback hls live,server reload m3u8(playlist) and remove #EXT-X-DISCONTINUITY,EXT-X-DISCONTINUITY-SEQUENCE plus one,what do client should?
I can`t understand why EXT-X-DISCONTINUITY-SEQUENCE tag can synchronization in different Variant
Streams.please

Related

Concatenate long strings from multiple records into one string

I have a situation where I need to concatenate long strings from multiple records in an Oracle database into a single string. These long strings are portions of a larger XML string, and my ultimate goal is to be able to convert this XML into something resembling query results and pull out specific values.
The data would look something like this, with the MSG_LINE_TEXT field being VARCHAR2(4000). So if the total message is less than 4000 characters, then there'd only be one record. In theory, there could be an infinite number of records for each message, although the highest I've seen so far is 14 records, which means I need to be able to handle strings that are at least 56000 characters long.
MESSAGE_ID MSG_LINE_NUMBER MSG_LINE_TEXT
---------- --------------- --------------------------------
17415414 1 Some XML snippet here
17415414 2 Some XML snippet here
17415414 3 Some XML snippet here
17415414 4 Some XML snippet here
The total XML for one MESSAGE_ID might look something like this. There could be many App_Advice_Error tags, although this specific example only contains one.
<tXML>
<Header>
<Source>MANH_prod_wmsweb</Source>
<Action_Type />
<Sequence_Number />
<Company_ID>1</Company_ID>
<Msg_Locale />
<Version />
<Internal_Reference_ID>17415414</Internal_Reference_ID>
<Internal_Date_Time_Stamp>2021-02-09 13:45:22</Internal_Date_Time_Stamp>
<External_Reference_ID />
<External_Date_Time_Stamp />
<User_ID>ESBUSER</User_ID>
<Message_Type>RESPONSE</Message_Type>
</Header>
<Response>
<Persistent_State>0</Persistent_State>
<Error_Type>2</Error_Type>
<Resp_Code>501</Resp_Code>
<Response_Details>
<Application_Advice>
<Shipper_ID />
<Imported_Object_Type>ASN</Imported_Object_Type>
<Response_Type>Error</Response_Type>
<Transaction_Date>2/9/21 13:45</Transaction_Date>
<Application_Ackg_Code>TE</Application_Ackg_Code>
<Business_Unit></Business_Unit>
<Tran_Set_Identifier_Code></Tran_Set_Identifier_Code>
<Transaction_Purpose_Code>11</Transaction_Purpose_Code>
<Imported_Message_Id></Imported_Message_Id>
<Imported_Object_Id>Reference Number Here</Imported_Object_Id>
<Additional_References>
<Additional_Reference_Info>
<Reference_Type>BusinessPartner</Reference_Type>
<Reference_ID></Reference_ID>
</Additional_Reference_Info>
</Additional_References>
<App_Advice_Errors>
<App_Advice_Error>
<App_Error_Text>Some error text here</App_Error_Text>
<Error_Message_Tokens>
<Error_Message_Token>Object that errored out</Error_Message_Token>
</Error_Message_Tokens>
<App_Err_Cond_Code>6100234</App_Err_Cond_Code>
</App_Advice_Error>
</App_Advice_Errors>
<Imported_Data></Imported_Data>
</Application_Advice>
</Response_Details>
</Response>
</tXML>
The values that I'm most interested in pulling out are the App_Err_Cond_Code, Error_Message_Token, and App_Error_Text tags. I had tried using something like this:
extractvalue(xmltype(msg_line_text), '//XPath of Tag')
This works beautifully for stuff where the entire XML is less than 4000 characters, i.e. the entire XML is stored in a single record. The problem comes when there are multiple records, because each individual snippet of XML isn't a valid XML string on its own, and so XMLTYPE throws an error, hence the reason I'm trying to concatenate them all into a single string, which I can then use with the above method.
I've tried a variety of ways to do this - LISTAGG, XMLAGG, SYS_CONNECT_BY_PATH, as well as writing a custom function something like this:
with
function get_messages(pTranLogID number) return string
is
xml varchar2;
begin
xml := '';
for msg in (
select r.msg_line_text
from tran_log_response_message r, tran_log t
where
t.message_id = r.message_id
and t.tran_log_id = pTranLogID
order by r.msg_line_number
)
loop
xml := xml || msg.msg_line_text;
end loop;
return 'test';
end;
select
tran_log_id, get_messages(tran_log_id)
from
tran_log
where
tran_log_id = '20633610';
/
The problem is that every one of these methods complained that the string was too long. Does anyone have any other ideas? Or maybe a better approach to this problem?
Thanks.

separate texts from a href in same td with XPath python

I have an HTML webpage like this:
<tr><td style="text-align:center;">7</td><td class="multi_row" style="line-height:15px;">Loaded on 'NYK LEO 303W' at Port of Loading<br> NYK LEO 303W</td><td class="multi_row" style="line-height:15px;">VANCOUVER, BC ,CANADA<br> 3891 DELTAPORT GCT</td><td class="ico_e">2018-10-26 23:30</td></tr>
I want to separate the <a href>'s string part in one variable and have a pure text like 'bla bla bla' in another variable.
this is what i have done till now:
event_path = driver.find_elements_by_xpath("//table[#id='detail']//tr/td[2]")
event = [cell.text for cell in event_path]
its for the text part
and this one is for the string in :
vessel_path = driver.find_elements_by_xpath("//table[#id='detail']//tr/td[2]/a")
vessel = [cell.text.split(' ')[:2] for cell in vessel_path]
the split(' ')[:2] is cuz the data is sth like this : NYK LEO 303W and i just need words not the number (it can be done more reliable with regex)
Try to use below to get only first text node from td
event = [driver.execute_script('return arguments[0].firstChild.textContent;', cell).strip() for cell in event_path]
Please try following code :
elements = driver.find_elements_by_classname("multi_row")
for element in elements
print(element.text)
In your case, I see vessel that you are expecting is already present in title attribute of anchor.
If it is a valid case, then you can get it directly from attibutes like,
vessel_path = driver.find_elements_by_xpath("//table[#id='detail']//tr/td[2]/a")
vessel = [cell.get_attribute("title") for cell in vessel_path]

How to create custom Font Awesome 5 SVG definition?

I want to add a new custom SVG icon to Fontawesome 5 and assume that I need to create a definition for it in the JavaScript file.
var icons = {
"address-book": [448, 512, [], "f2b9", "M436 160c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12h-20V48c0-26.51-21.49-48-48-48H48C21.49 0 0 21.49 0 48v416c0 26.51 21.49 48 48 48h320c26.51 0 48-21.49 48-48v-48h20c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12h-20v-64h20c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12h-20v-64h20zm-228-32c44.183 0 80 35.817 80 80s-35.817 80-80 80-80-35.817-80-80 35.817-80 80-80zm128 232c0 13.255-10.745 24-24 24H104c-13.255 0-24-10.745-24-24v-18.523c0-22.026 14.99-41.225 36.358-46.567l35.657-8.914c29.101 20.932 74.509 26.945 111.97 0l35.657 8.914C321.01 300.252 336 319.452 336 341.477V360z"],
In the example code for "address-book" what do each of the items represent?
448=Width?
512=Height?
[]=?
f2b9=?
Last item=SVG Path?
The whole object you would feed to fontawesome.library.add(…iconDefinitions) actually looks like this:
{
"prefix": "fa", // probably better to use a custom one
"iconName": "user",
"icon": [
512, // viewBox width
512, // viewBox height
[], // ligatures
"f007", // unicode codepoint - private use area
"M962…-112z" // path
]
}
I can't point out documentation to support the interpretation, but in the source code fields are used accordingly.
The symbol viewBox is always rendered as "0 0 <width> <height>", so no x/y offsets are possible.
I haven't found any js code actually rendering ligatures, or icons defining them, so I am not sure what the content of that array would be. As they would be used for a search order, probably its meant to take a list of iconNames or codepoints. If this is related to the desktop ligature support, it is moot outside DTP applications and having the .otf files installed, anyway.
Unicode codepoints are used for the CSS Pseudo-elements method. and should be unique. All fontawesome codepoints seem to be above U+F000, so the range U+E000…U+EFFF looks to be good for custom entries.

MIGX Event Calendar

I have created a custom Eventcalendar with the following structure:
- Event 1 (Modx-Ressource 1)
Date/Time 1 (Migx-TV-Record) (i.e. 01-02-2016)
Date/Time 2 (Migx-TV-Record) (i.e. 01-03-2016)
...
- Event 2 (Modx-Ressource 2)
Date/Time 1 (Migx-TV-Record) (i.e. 01-04-2016)
Date/Time 2 (Migx-TV-Record) (i.e. 01-01-2016)
...
That means that the Modx-Ressource has some Information about the Event (like Ticketprice, Description, Title...) and multiple Eventdates/-times stored in a Migx-TV.
That worked so far... But i try to make a Output which i can sort by date, limit and so on... Maybe the output looks like this:
Event 2, Date/Time 2 (i.e. 01-01-2016)
Event 1, Date/Time 1 (i.e. 01-02-2016)
Event 1, Date/Time 2 (i.e. 01-03-2016)
Event 2, Date/Time 1 (i.e. 01-04-2016)
How can i get this done? Sorry for my bad English.
Using the MIGX getImageList snippet you can sort and filter:
[[!getImageList?
&tvname=`YourEventsTV`
&tpl=`YourEventTpl`
&sort=`[{"sortby":"your_event_start_date","sortdir":"asc"}]`
&where=`{"your_event_limit:>=":"100"}`
]]
Add a sort clause or a where clause (uses JSON strings for both). The MODX manual has some more information on all the options available.

cvShowImage my image color was changed

I got strange condition when showing my video using cvShowImage or even when appending image data on IPLImage, I'm not quite sure.
The image/frame should be like this:
but the imaged was displayed like this:
As you can see, some parts of frame are also moved to the leftside.
Is there anyone encounter similar issue?
while(1){
m_IPLimg1 = m_pFrameCapture->GrabOneFrame();
if(m_IPLimg1 == NULL) break;// no more frames, exit the loop
cvFlip(m_IPLimg2, NULL, 0 );
cvShowImage("Original Video", m_IPLimg1);
cvShowImage("GMM Result Video", m_IPLimg2);
char c = cvWaitKey(20);
if (c==27) break;
}
Really thanks in advance.
It looks like you're trying to flip m_IPLimg2 in place but are not setting its contents first. Try:
cvFlip(m_IPLimg1, m_IPLimg2, 0 );
This will flip m_IPLimg1 and place the results into m_IPLimg2.
I got the solution, I need to format my .avi first using mencoder , since the video above I generated from image sequence, the codec seems broken. Thanks for all responses however.

Resources