Save Images From RFC6184Stream

Topics: Question
Oct 26, 2016 at 9:09 AM
Hello,

First of all thx. for your kind work.

Is it possible to decode and save RFC6184Stream frames to disk with latest version of library(112204).

Could you give me a clue haw to do this? My sample code is below.
int i1 = 0;
        static void Client_RtpFrameChanged(object sender, RtpFrame frame, RtpClient.TransportContext tc, bool final)
        {           
            if (frame.IsComplete)
            {
                i1++;

                var str = new StringBuilder(30);
                str.AppendFormat("{0} OK: {1}", DateTime.Now.ToString("dd.MM.yyyy hh:mm:ss"), i1);

                Console.WriteLine(str);
                
                try
                {
                    using (RFC6184Media.RFC6184Frame profileFrame = new RFC6184Media.RFC6184Frame(frame))
                    {
                        profileFrame.Depacketize();
                        if (profileFrame.HasDepacketized)
                        {
                            //TODO: SAVE PIC to disk

                            //SAMPLE CODE FROM RFC2435Frame
                            //var t = new RFC2435Media.RFC2435Frame(frame);
                            //using (Image jpeg = t)
                            //{
                            //    jpeg.Save(@"C:\imgs\result" + i1 + ".jpg", ImageFormat.Jpeg);
                            //}

                        }
                        else
                        {
                            Console.WriteLine("Depacketize failed!");
                            return;

                        }
                        
                    }
                    
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                }

            }
            
        }
Coordinator
Oct 30, 2016 at 7:43 AM
This should be fine; there are known issues in the latest released code which I am not fixing at this time.

Thanks for your kind words and best of luck.