kixelated / moq-rs

Rust library for Media over QUIC

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Loop disk source

kixelated opened this issue · comments

The current media source reads until the end of the file, where it presumably exits.

To loop the media source, we need to restart from the beginning of the file and rewrite any timestamps. Alternatively, we could create new tracks, and somehow signal a discontinuity, but I don't think that's viable or a good idea. The ffmpeg fragmentation command should already remove any byte offsets so those shouldn't be a problem.

Note that the MP4 crate can produce atoms, but it doesn't work very well. The problem is that the decode step throws out any unknown atoms/fields so they're lost on the re-encode. I would personally modify the raw bytes directly; it should be as simple as replacing a uint32.

Made some progress on this in a branch, but there are still issues for connected clients when looping.
New clients successfully pick up the looped stream.

We wanted to remove the built in file source and deploy the relay as purely a relay.

It was also going to be tedious to modify the timestamps in each moof after looping, so this is being tabled in favor of work on a ffmpeg publisher CLI.

Meant to close this as WONTFIX before. Closing now.