Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

The “test*Streamer” test programs read from a file. Can I modify them so that they take input from a MPEG encoder instead, so I can stream live (rather than prerecorded) video and/or audio?

0
Posted

The “test*Streamer” test programs read from a file. Can I modify them so that they take input from a MPEG encoder instead, so I can stream live (rather than prerecorded) video and/or audio?

0

Yes. The easiest way to do this is to change the appropriate “test*Streamer.cpp” file to read from “stdin” (instead of “test.*”), and then pipe the output of your encoder to (your modified) “test*Streamer” application. (Even simpler, if your operating system represents the MPEG input device as a file, then you can just use the name of this file (instead of “test.*”).) Alternatively, if your encoder presents you with a sequence of frames, rather than a sequence of bytes, then a more efficient solution would be to write your own “FramedSource” subclass that encapsulates your encoder, and delivers audio or video frames directly to the appropriate “*RTPSink” object. This avoids the need for an intermediate ‘framer’ filter that parses the input byte stream. (If, however, you are streaming MPEG-4 or MPEG-2 video with “B” frames, then you should include the appropriate “*DiscreteFramer” filter, in order to generate correct presentation times.) For a model of how to do that, see “liveMedia/Dev

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123