Skip to content

Test application simulating a live MoQ video+audio publisher. Includes a subscriber app.

License

Notifications You must be signed in to change notification settings

Eyevinn/moqlivemock

Repository files navigation

moqlivemock

Test Coverage Status GoDoc Go Report Card license

moqlivemock is a simple media test service for MoQ (Media over QUIC) and the WARP streaming format by providing a server which publishes an asset with wall-clock synchronized multi-bitrate video and audio, as well as a client that can receive these streams and even multiplex them for playback with ffplayh like mlmsub -muxout - | ffplay -.

The input media is 10s of video and audio which is then disassembled into frames. Each frame is sent as a MoQ object as a CMAF chunk, but it should be easy to combine a few frames into a chunk to lower the packaging overhead. LOC is currently not supported, but one possible scenario is to send LOC over the wire and then reassamble CMAF on the receiving side again.

You can configure how many frames should be sent in every MoQ object/CMAF chunk using the -audiobatch and -videobatch options. This allows you to control the packaging overhead by batching multiple frames into a single chunk.

This project uses moqtransport for the MoQ transport layer. As the MoQ transport layer is still work in progress, this project is also work in progress.

Session setup

The first things that happens after the session establishmend is that the namespace is announced by the server. The client will subscribe for a WARP catalog. Once it has the catalog, it will subscribe to the first video and audio track from the catalog.

It should later be possible to switch bitrate by unsubscribing to one track and subscribing to another, with no repeated or lost frames.

Requirements

  • Go 1.23 or later

Installation and Usage

As usual with Go, run

go mod tidy

to get up and running.

There are two commands

  • mlmpub is the server and publisher
  • mlmsub is the client and subscriber

The content used is in the content directory, and was generate using the code in utils/videogen.

To run the system, first start the publisher

cd cmd/mlmpub
go run .

You can also build the binary and then run it

cd cmd/mlmpub
go build .
./mlmpub

You can also specify options for the publisher:

./mlmpub -audiobatch 4 -videobatch 2

In another shell, start the subscriber and choose if the video, the audio, or a muxed combination should be output, e.g.

cd cmd/mlmsub
go run . -muxout - | ffplay -

or build it similarly to mlmpub before you run it. This time with some other options

cd cmd/mlmsub
go build .
./mlmsub -videoname 600 -audioname scale -loglevel debug -muxout - | ffplay -

to directly play with ffplay. There are more options to change the loglevel, choose track etc.

The subscriber will connect to the publisher and start receiving video and audio frames if some tracks are selected.

There is currently no working unsubscribe mechanism, so the closing of the subscribed tracks is not clean.

Development

Use plain Go environment, with go 1.23 or later. The Makefile helps out with some tasks.

Contributing

See CONTRIBUTING

License

This project is licensed under the MIT License, see LICENSE. Some code is based on [moqtransport][moqtransport which is also licensed under MIT]

Support

Join our community on Slack where you can post any questions regarding any of our open source projects. Eyevinn's consulting business can also offer you:

  • Further development of this component
  • Customization and integration of this component into your platform
  • Support and maintenance agreement

Contact sales@eyevinn.se if you are interested.

About Eyevinn Technology

Eyevinn Technology is an independent consultant firm specialized in video and streaming. Independent in a way that we are not commercially tied to any platform or technology vendor. As our way to innovate and push the industry forward we develop proof-of-concepts and tools. The things we learn and the code we write we share with the industry in blogs and by open sourcing the code we have written.

Want to know more about Eyevinn and how it is to work here. Contact us at work@eyevinn.se!

About

Test application simulating a live MoQ video+audio publisher. Includes a subscriber app.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published