Comments (5)
given that the payload of PacketTypeMetadata
is a sequence of pairs (key:string, value:any) (with only one defined key so far), i can imagine a potential intent that subsequent PacketTypeMetadata
messages would override/supersede only the named metadata items, rather than all of them, to give functionality similar to @setDataFrame
. if that's the case, that expands and complicates the semantics of this message, and should be called out and described precisely.
from enhanced-rtmp.
Heya just saw this, thank you so much for all the great feedback here and in other issues. It's like you have done this before;). Stay tuned for multiple responses.
from enhanced-rtmp.
my recommendation on how PacketTypeMetadata should work is:
it MUST come before the start of the sequence to which it appliesonly one of them is in force at a timea new one completely supersedes and replaces a previous oneit MUST be followed immediately by a sequence start message (if needed by the codec) and a key frame / IDR -- that is, receipt of PacketTypeMetadata implies a decoder reset including resetting its start/init data
the last point simplifies the logic for live forwarders, particularly ones that want to do a "fast start and catch up" for a new subscriber that joins between in that critical window, since otherwise the old metadata, old start/init, and any frames to be replayed need to be remembered along with the new metadata, and then cleared out if/when the new start/init arrives. the alternative isn't super onerous, but the decoder and forwarder semantics would need to be more complicated than probably ever needed for practical uses of this message.
EDIT: recommendation withdrawn after learning more about this message's intended use.
from enhanced-rtmp.
on the understanding that PacketTypeMetadata messages can arrive at any point and each applies to messages following it (potentially including sequence start/init messages, keyframes, and predicted frames), i implemented the following heuristic in my server (an SFU/live-forwarder):
- keep "Before Sequence Start" and "Latest" metadata messages, each initialized to empty
- on receiving a PacketTypeMetadata message, set "Latest" to that message
- on receiving a Sequence Start message, remember the Sequence Start message; then if there's a non-empty "Latest" metadata message, set the "Before Sequence Start" metadata message to the current Latest, and clear Latest.
- when a client subscribes to a stream, send the "Before Sequence Start" metadata message if not empty, then the Sequence Start message if any, then the "Latest" metadata message if not empty.
this accounts for a PacketTypeMetadata message that needs to be known before processing a Sequence Start, as well as allowing the metadata to be updated after the sequence starts. in cases where there's ever only one PacketTypeMetadata in a stream, this retains the original order of the PacketTypeMetadata vs Sequence Start messages as sent by the publisher.
from enhanced-rtmp.
great discussion here. We have added some language to clarify the current behavior. You will see it in the next drop of the spec. Closing the issue...
from enhanced-rtmp.
Related Issues (20)
- connect command fourCcList is video specific but doesn't have "video" in its name HOT 6
- connect response doesn't indicate support for Enhanced RTMP HOT 9
- please clarify meaning and semantics of PacketTypeMPEG2TSSequenceStart HOT 4
- fourCcList description should explicitly state support for receiving those codecs HOT 1
- fourCcList definition should provide for a wildcard HOT 4
- consider enabling Discussions on this repo HOT 1
- Additional Audio Codec: FLAC HOT 7
- enchanced HOT 1
- Hakiiii
- Support for QUIC? HOT 3
- Hi HOT 1
- Support CodecID 12 for HEVC HOT 6
- Fgvh
- AudioPacketType.SequenceEnd is not defined HOT 11
- Opus Sequence Headers HOT 13
- Standardized way to signal audio track language? HOT 2
- FLAC sequence start message should include a "fLaC" marker. HOT 1
- latest enhanced-rtmp-v2.pdf has an improperly framed page HOT 1
- Typo in ExAudioTagBody section HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from enhanced-rtmp.