Questions about injecting media into mediasoup

I could inject media from a video file to a mediasoup router using ffmpeg and plain RTP transport and consume it by the client and it works like a charm. :star_struck::ok_hand:

I wonder is there a way by mediasoup to detect when the video is ended and close the producer accordingly or I need to signal from the ffmpeg side?

You definitely need to tell mediasoup to close the producer whenever you want to.

You can periodically check the server side Producer’s stats, or monitor its score events as a way to detect RTP inactivity. However, you’d rather detect it at the sender side and signal closure to the server. mediasoup does not care if your Producer has ended sending a “video file” or not. It’s designed to expect continuous streams that can be paused, resumed, active, inactive, at any time.

One more question, although is not much related to mediasoup but I’m just looking for ideas:

I found this technique very useful for sharing an audio or video clip in a meeting or webinar. However lack of pause/seek capabilities over the media to be used by the presenter makes it less useful. At least I could not find a solution.

I tried to simulate the seek functionality by pausing the producer first, restarting the ffmpeg command with -ss <time> argument and then resuming the producer, with no luck and mediasoup is complaining for “bad sequence number” and “invalid packet”. Any idea on this?

Absolutely no idea, sorry. I just do real-time :slight_smile: