-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for catalog in common catalog format #103
Conversation
commit to support common catalog format for moqtransport
Thanks for this, @TilsonJoji (and @gwendalsimon) - the catalog support we have right now is still mostly a placeholder and the format is left over from before the current common catalog spec existed, so I see no reason not to update it both here and in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The catalog draft is pretty rough and I need to file a lot of issues.
The catalog draft was adopted by the WG so we should be implementing the latest version. Unfortunately I just noticed that so my review was for the 02 draft you linked.
lib/media/catalog/index.ts
Outdated
@@ -21,6 +21,7 @@ export class Catalog { | |||
const str = decoder.decode(raw) | |||
|
|||
try { | |||
if (typeof JSON.parse(str).packaging !== "string") throw new Error("invalid catalog") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will JSON parse the catalog twice. Also the isCatalog
function should perform this check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO Catalog
should be an interface now that there's actually stuff in the root.
export interface Catalog {
version: number,
sequence: number,
streamingFormat: number,
streamingFormatVersion: string,
renderGroup: number,
packaging: string,
// etc?
tracks: Track[],
}
It means you'll need to move the other functions into the root but that's fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed
lib/media/catalog/index.ts
Outdated
} | ||
|
||
export interface Mp4Track extends Track { | ||
container: "mp4" | ||
init_track: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
init_track: string | |
initTrack: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed
@@ -60,63 +61,68 @@ export function isCatalog(catalog: any): catalog is Catalog { | |||
} | |||
|
|||
export interface Track { | |||
kind: string | |||
container: string | |||
name: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a few other fields that should be defined here, basically anything with Location = T.
Unfortunately some of these fields will be optional and default to the value in the root. ex.
let packaging = catalog.tracks[0].packaging ?? catalog.packing;
I think we should automatically populate the track using the default values so you don't have to perform the above every time. But that can be a future PR.
lib/media/catalog/index.ts
Outdated
bit_rate?: number | ||
} | ||
|
||
export interface SelectionParamsAudio { | ||
bit_rate: number; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bit_rate: number; | |
bitrate?: number; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed
lib/media/catalog/index.ts
Outdated
codec: string; | ||
height: number; | ||
width: number; | ||
frame_rate: number |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
frame_rate: number | |
framerate?: number |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed
lib/media/catalog/index.ts
Outdated
export interface SelectionParamsAudio { | ||
bit_rate: number; | ||
channel_count: number; | ||
codec: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
codec: string; | |
codec?: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed
lib/media/catalog/index.ts
Outdated
bit_rate: number; | ||
channel_count: number; | ||
codec: string; | ||
sample_rate: number; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sample_rate: number; | |
samplerate?: number; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed
lib/media/catalog/index.ts
Outdated
channel_count: number; | ||
codec: string; | ||
sample_rate: number; | ||
sample_size: number; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't exist?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed
lib/media/catalog/index.ts
Outdated
height: number | ||
frame_rate: number | ||
bit_rate?: number | ||
name: "video" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the track name, not the kind. We can't use "audio"
or "video"
because that would only allow one track of each type.
There's no equivalent to kind
in draft-02, which I think is a big oversight. There is only supposed to be a single SelectionParams
type instead of splitting them into audio/video.
lib/playback/index.ts
Outdated
@@ -100,8 +100,8 @@ export class Player { | |||
} | |||
|
|||
async #runTrack(track: Mp4Track) { | |||
if (track.kind !== "audio" && track.kind !== "video") { | |||
throw new Error(`unknown track kind: ${track.kind}`) | |||
if (!(track.name.toLowerCase().includes("audio")) && !(track.name.toLowerCase().includes("video"))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isAudioTrack(track)
or isVideoTrack(track)
is the way you're supposed to determine the type now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed
Thank you @englishm. Thank you @kixelated for the detailed review and the feedback . I will address the comments and update the PR. |
This is related to previous PR : #1 Addressing review comments received on kixelated#103 and making the catalog compliant with https://www.ietf.org/archive/id/draft-ietf-moq-catalogformat-01.html Related PR in moq-js : TilsonJoji/kixelated-moq-rs#2
Hello Luke @kixelated , Mike @englishm , i have attempted to address the comments and followed the latest version of the spec , kindly review and let me know your thoughts. |
Thanks @TilsonJoji , I'll take a look hopefully tomorrow. |
Untested because I have to get back to work. :x
@TilsonJoji I pushed some changes inline. It passes the typescript checks ( |
I made some issues on the catalog Github if you want to voice any opinions after having implemented this: https://github.com/moq-wg/catalog-format |
Commit to address an glitch observed in UT with commit kixelated/moq-js@7baad29 part of PR kixelated#103
Hello Luke @kixelated , thank you for the refactoring the code with commit 7baad29. Regarding moq-rs , I performed a test and have updated the RUST PR . The commits in moq-rs have passed the PR build check. Kindly have a look at the moq-rs PR as time allows and let me know your thoughts. Regarding moq-js , Have done a minor tweak to your commit to fix issue observed in UT and have pushed the changes in this UT1 commit and this UT2 commit UT1 performed:
UT2
|
Commit to address an glitch observed in UT ( broadcast and watch ) with commit kixelated/moq-js@7baad29 part of PR kixelated#103
Commit to make namespace fetch compatible with RS commit kixelated/moq-rs@73bad56 and kixelated/moq-rs@f05c00e in PR : kixelated/moq-rs#174
Hello Luke @kixelated , pushed a commit b8d5a80/511ad99 to update moq-js with regards to namespace access, to make it compatible with commit 73bad56 f05c00e in PR : kixelated/moq-rs#174 |
committosupport-commoncatalogformat-fix-to-workwithRScommit-73bad56-f…
Hello Luke @kixelated , thank you for your work, we ( Gwendal Simon , Tilson Joji ) from Synamedia would like to convey our interest in contributing.
With this PR have attempted to support formatting the catalog as per common catalog format defined in spec https://datatracker.ietf.org/doc/html/draft-wilaw-moq-catalogformat-02
A PR has been requested in moq-rs as well to support this change, here is the link to the PR kixelated/moq-rs#174
Kindly review and let us know your thoughts.