Giter Site home page Giter Site logo

Comments (23)

dstieglitz avatar dstieglitz commented on August 19, 2024

Is it possible to get PTS from the underlying stream through the API?

from hls.js.

mangui avatar mangui commented on August 19, 2024

@nireshkumar regarding https://developer.apple.com/library/ios/documentation/AudioVideo/Conceptual/HTTP_Live_Streaming_Metadata_Spec/HTTP_Live_Streaming_Metadata_Spec.pdf, extracting ID3 PES is not a big deal. they could eventually be parsed and returned along with their PTS through a specific event.
currently we have FRAG_PARSING_DATA that handles Audio/Video,
we could add a FRAG_PARSING_METADATA event, that would return an array of ID3 PES, along with their PTS

from hls.js.

mangui avatar mangui commented on August 19, 2024

then it would be up to your application to listen to this event and handle those metadatas (parse, and display them )

from hls.js.

dstieglitz avatar dstieglitz commented on August 19, 2024

@mangui is the PTS available on a frame-by-frame basis (for video) even if there no ID3 metadata? For example, is it possible to implement a video.currentTimePTS() call or similar?

from hls.js.

mangui avatar mangui commented on August 19, 2024

PTS reported by hls.js events are always relative to start position, and expressed in ms.
basically you will always have video.currentPTS = 1000*video.currentTime
so that it will be straightforward to sync metadata and video.

from hls.js.

dstieglitz avatar dstieglitz commented on August 19, 2024

Is it possible to obtain the PTS from the decoding (the PTS written by the encoder, for example)?

from hls.js.

mangui avatar mangui commented on August 19, 2024

the real PTS is parsed, but not exposed. just curious, why would you need it ?

from hls.js.

dstieglitz avatar dstieglitz commented on August 19, 2024

One of our use cases involves tagging live-DVR streams. Relative PTS has no meaning in this scenario, however, typically the CDN will cycle the encoding PTS every 24 hours so we'd like to experiment using the frame PTS plus date data to get frame accurate tagging.

from hls.js.

mangui avatar mangui commented on August 19, 2024

I see, indeed it make sense in that case.
anyway the values are there, it is just a matter of exposing them.

from hls.js.

dstieglitz avatar dstieglitz commented on August 19, 2024

Can you advise on how this might be accomplished? I'd like to give it a go.

from hls.js.

mangui avatar mangui commented on August 19, 2024

@dstieglitz, please find guidelines below :

from hls.js.

mangui avatar mangui commented on August 19, 2024

also, if you just want to expose absolute PTS, you need to play with
this._initPTSand this._initDTS
https://github.com/dailymotion/hls.js/blob/master/src/demux/tsdemuxer.js#L824-L828

from hls.js.

dstieglitz avatar dstieglitz commented on August 19, 2024

@mangui thanks!

from hls.js.

nireshkumar avatar nireshkumar commented on August 19, 2024

@mangui Thanks for the reply. Guidelines for implementation looks great.

from hls.js.

dstieglitz avatar dstieglitz commented on August 19, 2024

Is there a test manifest for a live-dvr playlist?

from hls.js.

mangui avatar mangui commented on August 19, 2024

http://dailymotion.github.io/hls.js/demo/?src=http%3A%2F%2Fonline.video.rbc.ru%2Fonline%2Frbctv.m3u8

on Chrome with https://chrome.google.com/webstore/detail/allow-control-allow-origi/nlfbmbojpeacfghkpbjhddihlkkiljbi

from hls.js.

nireshkumar avatar nireshkumar commented on August 19, 2024

@mangui, Our live encoder inject ID3 tags into stream every second. We used to listen to flashls's ‘HLSEvent.ID3_UPDATED’ event and consume ID3 tag data, its working fine. When I added 'case 0x15' here https://github.com/dailymotion/hls.js/blob/master/src/demux/tsdemuxer.js#L179 and played the same stream, ID3 tag id detected only once at the beginning stream or on bitrate switch. Am I missing something ? is it possible replicate the same behaviour as in flashhls in hls.js as well?

from hls.js.

mangui avatar mangui commented on August 19, 2024

ID3 tags should be parsed and dispatched through an event; but it is not hls.js responsability to dispatch individual event at the right timings. it is up to the application to do it.
the difference is that flash allows to inject custom metadata in the NetStream. NetStream will trigger an event with each individual tag at the right timings. but MediaSource does not support this.

from hls.js.

nireshkumar avatar nireshkumar commented on August 19, 2024

Got it. Thanks
Any pointers on how I can extract injected ID3 Tags ?

from hls.js.

mangui avatar mangui commented on August 19, 2024

for tags extraction from tsdemuxer, plz refer to my yesterday's comment.
for id3 tag parsing, i guess there should be JS libs available around.

from hls.js.

nireshkumar avatar nireshkumar commented on August 19, 2024

@mangui I followed the implementation guidelines and its working. As well added FRAG_INIT_SEGMENT_TS_CHANGED event which fires when _initPTS and _initDTS gets set, this exposes absolute PTS.
Here is the change set link : nireshkumar@d8617bc

I would be glad to raise a PR if you want to add metadata parsing feature. Let me know if I need to make more changes to make it PR ready.

from hls.js.

mangui avatar mangui commented on August 19, 2024

@nireshkumar nice !
regarding absolute timestamps, do you need them only for ID3 ?
you should already have absolute PTS/DTS in your ID3 PES packets, dispatched by FRAG_PARSING_METADATA

I would suggest to:
either convert all timestamps to relative ones, and add initPTS/initDTS in FRAG_PARSING_INIT_SEGMENT, no need to create a new event

from hls.js.

mgw-sbex avatar mgw-sbex commented on August 19, 2024

Hey, could you give me a call to discuss syncing multiple HLS streams together ? 805.499.1994

from hls.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.