moq-wg / catalog-format

A common catalog format for streaming formats operating over moq-transport
Other
5 stars 0 forks source link

commonTrackFields is a premature optimization #53

Open kixelated opened 2 months ago

kixelated commented 2 months ago

I understand the goal of commonTrackFields is to reduce the file size by eliminating some duplication, but is it necessary? It makes decoding more difficult, as some languages don't have a way of merging JSON structs. I'm not sure how to implement it in Go/Rust off the top of my head. It also makes it more difficult to merge catalogs, as you may need to unset commonTrackFields.

I don't think we should be worried about file size right now and there are many other (easy) techniques we could use instead, like gz compression. The JSON encoding should be the verbose, easy to parse, human readable encoding. We should eventually have an alternative binary encoding that can be converted 1:1 with the JSON encoding, utilizing lookup tables to avoid redundancy.

wilaw commented 2 months ago

Fair point. If others vote this opinion up, we can remove commonTrackFields.

gwendalsimon commented 1 month ago

I agree. Furthermore, it may also make catalog updates easier (no need to revise the CommonTrackFields if a new field invalidate some common fields)