RFC6184Media throwing exeption "Only ARGB is currently supported" when call Packetize with bitmap PixelFormat.Format32bppArgb
p0w3r2100 opened this issue · 1 comments
Hi @juliusfriedman thanks for the net7mma it was a great library but i got a problem with the RFC6184Media
in my project i'm using nuget to get the library with version 0.111192.1 in here i want to send image from a NVR camera and convert it base on h.264 codec to rtsp server
public partial class MainForm : Form
{
private Camera _camera;
readonly Timer _timerRefreshUi = new Timer();
RtspServer server = new RtspServer()
{
Logger = new RtspServerConsoleLogger()
};
//open media to insert frame
RFC6184Media _media = new RFC6184Media(320, 256,"test");
public MainForm()
{
InitializeComponent();
_timerRefreshUi.Interval = 100;
_timerRefreshUi.Tick += _timerRefreshUi_Tick;
}
void _timerRefreshUi_Tick(object sender, EventArgs e)
{
Bitmap srcBmp = new Bitmap(320,256,System.Drawing.Imaging.PixelFormat.Format32bppArgb);
try
{
srcBmp = _camera.GetImage().Image;
}
catch (Exception exception)
{}
_media.Packetize(srcBmp);
}
private void ConnectCamera(CameraDeviceInfo cameraDeviceInfo)
{
//try to add media to server
server.TryAddMedia(_media);
//server begin
server.Start();
_timerRefreshUi.Start();
}
}
as in runing in debug the srcBmp pixel format was Format32bppArgb
and when i see in your sourcecode> unittests in there i find in RFC6184Media
line 993 if (thumb.PixelFormat != System.Drawing.Imaging.PixelFormat.Format32bppArgb) throw new NotSupportedException("Only ARGB is currently supported."); but the one i throw in was Format32bppArgb could you help me thanks
Encoding support was not completed.