0

We are using Media constructor to create media from buffer (C# .NET memory stream) but no video is displayed

_mediaPlayer.Play(new Media(_libVLC, buffer, "--demux h264"));

Our stream works perfectly when testing with standalone VLC windows app where we need to specify h264 demuxer (--demux h264) to get video decoded properly, so we assume we need to specify demux to libVLC in a similar way, but we can't find how to pass such options the proper way. Maybe some other options will have to be passed as well.

2 Answers2

0

Try new LibVLC("--demux=h264")

If that doesn't work, improve your question https://stackoverflow.com/help/mcve

mfkl
  • 1,914
  • 1
  • 11
  • 21
0

The API has changed recently, there is a new MediaInput class (and a StreamMediaInput implementation) that can be passed into the constructor, see the source code.

This API has a way to pass media arguments: try:

new Media(libVLC, mediaInput, ":demux=h264")

Note:

  • use :option instead of --
  • Don't separate option name from value with a space within the same string. either use = or split them in two arguments (":demux", "h264")
cube45
  • 3,429
  • 2
  • 24
  • 35