This forum contains outdated content and is available for reading only. Please contact technical support if you have any questions.

Notification

Icon
Error

Options
Go to last post Go to first unread
phether  
#1 Posted : Tuesday, March 6, 2012 2:29:47 PM(UTC)
phether

Rank: Member

Groups: Guest
Joined: 3/6/2012(UTC)
Posts: 10

Thanks: 1 times
Hi,
I am trying to evaluate the AVI processor for inclusion in my application.
I made a small sample project (VS 2010, c#)

And I keep getting a null reference error when I try to instantiate the aviwriter object.

System.NullReferenceException was unhandled
Message=Object reference not set to an instance of an object.
Source=Aurigma.GraphicsMill
StackTrace:
at Aurigma.GraphicsMill.Codecs.FormatWriter._Close()
at Aurigma.GraphicsMill.Codecs.FormatWriter.Dispose(Boolean disposing)
at Aurigma.GraphicsMill.Codecs.AviWriter.Dispose(Boolean disposing)
at Aurigma.GraphicsMill.SyncHandler.Finalize()
at Aurigma.GraphicsMill.Codecs.FormatWriter.{dtor}()
at Aurigma.GraphicsMill.Codecs.AviWriter..ctor()


Attached is my sample project.
It was designed to take a serieas of images (all ready created) and stitch them together into an AVI file
File Attachment(s):
GraphicsMillCreateAviTest.rar (10kb) downloaded 22 time(s).
Dmitry.Obukhov  
#2 Posted : Wednesday, March 7, 2012 1:02:34 AM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

Groups: Guest
Joined: 5/29/2010(UTC)
Posts: 1,310

Thanks: 8 times
Was thanked: 111 time(s) in 111 post(s)
Hello Paul,
Quote:
It was designed to take a serieas of images (all ready created) and stitch them together into an AVI file

Could you please provide me with created series of PNG images?
Best regards,
Dmitry Obukhov
Technical Support. Aurigma, Inc.
phether  
#3 Posted : Wednesday, March 7, 2012 10:12:21 AM(UTC)
phether

Rank: Member

Groups: Guest
Joined: 3/6/2012(UTC)
Posts: 10

Thanks: 1 times
Hi Dmitry,

see attached

thanks.
phether  
#4 Posted : Wednesday, March 7, 2012 10:38:43 AM(UTC)
phether

Rank: Member

Groups: Guest
Joined: 3/6/2012(UTC)
Posts: 10

Thanks: 1 times
attachment failed, trying again with a smaller sample
File Attachment(s):
recordings201236112055.rar (10,573kb) downloaded 16 time(s).
Dmitry.Obukhov  
#5 Posted : Friday, March 9, 2012 12:14:49 AM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

Groups: Guest
Joined: 5/29/2010(UTC)
Posts: 1,310

Thanks: 8 times
Was thanked: 111 time(s) in 111 post(s)
Hello,

Thank you for these files. I investigated the problem. AviWriter supports Format24bppRgb 24 and
Format32bppRgb pixel formats. Your PNG images are Format32bppArgb. You should converted them to one of the support formats before adding them to avi file.

Edited by user Friday, March 9, 2012 2:49:42 AM(UTC)  | Reason: Not specified

Best regards,
Dmitry Obukhov
Technical Support. Aurigma, Inc.
phether  
#6 Posted : Thursday, March 29, 2012 3:31:27 PM(UTC)
phether

Rank: Member

Groups: Guest
Joined: 3/6/2012(UTC)
Posts: 10

Thanks: 1 times
Dmitry.Obukhov wrote:
Hello,

Thank you for these files. I investigated the problem. AviWriter supports Format24bppRgb 24 and
Format32bppRgb pixel formats. Your PNG images are Format32bppArgb. You should converted them to one of the support formats before adding them to avi file.


Hi Dmitry,
I'm not even getting to the stage of being able to add the files to the avi writer.
It is erroring out on this line of code

_aviWriter = new Aurigma.GraphicsMill.Codecs.AviWriter();

Dmitry.Obukhov  
#7 Posted : Friday, March 30, 2012 12:25:33 AM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

Groups: Guest
Joined: 5/29/2010(UTC)
Posts: 1,310

Thanks: 8 times
Was thanked: 111 time(s) in 111 post(s)
Hi Paul,

I investigated this problem. It occurs if trial license key has been expired or has not been set at all. I generated trial key for 30 days - please read PM. Please specify it through License Key Registration Wizard which you can find in the folder where GM was installed. Sorry for the inconvenience.
Best regards,
Dmitry Obukhov
Technical Support. Aurigma, Inc.
phether  
#8 Posted : Friday, March 30, 2012 6:55:45 AM(UTC)
phether

Rank: Member

Groups: Guest
Joined: 3/6/2012(UTC)
Posts: 10

Thanks: 1 times
Hi Dmitry,
Ok I got past that stage now I'm having some different issues.
Using XVidMpeg4 I kept getting a

Aurigma.GraphicsMill.Codecs.MediaProviderException was unhandled
Message=Cannot set video stream format.

My source images were 1102x517, but I then changed the aviwriter to specifically create it at 1280x720 and resize the frames and it worked.
When I recreated my source images at 1644x852 it worked as well without me having to specify another size.

Does this mean that XVid recordings can ONLY be created at specific sizes? Or is this kind of a 'driver/operating system' thing becuase I have seen them created on other cmputers here in the office without issue (using on of 3 different avi creators)
Turns out none of the 3 work on my computer though. So i'm wondering if XVid has some graphics card specific limitations?
I have a good graphics card (ATI Mobility Radeon HD 5830), and I know one of the computers XVid is working on is a really crappy card.

This was one of the reasons I was trying out GraphicsMill, was to see if the issues with recording to xvid on my machine could be gotten around. Certain clients of the existings system have problems as well, while others don't.

I was able to get MSVideo1 to record an avi without a problem, except that the quality is very sub-par, especially compared to xvid.

thanks
paul
Dmitry.Obukhov  
#9 Posted : Monday, April 2, 2012 2:04:35 AM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

Groups: Guest
Joined: 5/29/2010(UTC)
Posts: 1,310

Thanks: 8 times
Was thanked: 111 time(s) in 111 post(s)
Hello Paul,

Actually Avi Processor Add-on is based on obsolete library VfW (Video for Windows). Unfortunately many modern codec do not support it. I assume that the machines where you get good results, have codec supporting VFW. Please check it and try another codec.
Best regards,
Dmitry Obukhov
Technical Support. Aurigma, Inc.
thanks 1 user thanked Dmitry.Obukhov for this useful post.
phether on 4/2/2012(UTC)
phether  
#10 Posted : Tuesday, June 19, 2012 1:19:08 PM(UTC)
phether

Rank: Member

Groups: Guest
Joined: 3/6/2012(UTC)
Posts: 10

Thanks: 1 times
Hi Dimitry.
I went ahead and purchasd the Graphics Mill component.
Now I am getting a different kind of error.

A first chance exception of type 'Aurigma.GraphicsMill.UnexpectedException' occurred in Aurigma.GraphicsMill.dll
'GraphicsMillCreateAviTest.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Aurigma.GraphicsMill.UnexpectedException: Unable to commit memory.
at Aurigma.GraphicsMill.Thread.FireStoppedEvent(Object object, ErrorEventArgs args)
at Aurigma.GraphicsMill.Thread.TimerEventProcessor()
at Aurigma.GraphicsMill.Thread.ChangeActivityStatus(ActivityStatus status)
at Aurigma.GraphicsMill.Thread.EntryPoint()
at Aurigma.GraphicsMill.Thread.Start()
at Aurigma.GraphicsMill.Codecs.FormatWriter._FrameSaveBitmap(Frame frame)
at Aurigma.GraphicsMill.Codecs.FormatWriter._AddFrame(Frame frame)
at Aurigma.GraphicsMill.Codecs.FormatWriter.AddFrame(IFrame frame)
at GraphicsMillCreateAviTest.Form1.CreateAvi() in D:\projects\prototype\GraphicsMillCreateAviTest\GraphicsMillCreateAviTest\Form1.cs:line 74



Using the attached project and these recording files
(http://www.aras360.com/customer360.com/recordings.rar) (~250mb)

It is 255 frames of pngs at 1280x720.
It gets to about frame 243 and then errors out (and errors for the rest of the frames as well)
Some smaller sets of frames I was able to do fine.
In further testing I found it seems to be memory-related.
Watching in my Task-Manager the memory being used steadly climbs and when it hits roughly 1.5 GB is when it crashes.


File Attachment(s):
GraphicsMillCreateAviTest.rar (1,907kb) downloaded 2 time(s).
Dmitry.Obukhov  
#11 Posted : Tuesday, June 19, 2012 11:57:23 PM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

Groups: Guest
Joined: 5/29/2010(UTC)
Posts: 1,310

Thanks: 8 times
Was thanked: 111 time(s) in 111 post(s)
Hi Paul,

According to the error stack trace and your description you have "Unable to commit memory" problem.
32 bit applications can access only 2 GB of RAM. Sometimes, this memory is not enough to handle loaded images and run other applications. Thus you get the “Unable to commit memory” error. To resolve the problem, you need to use 64-bit system with 64-bit Graphics Mill.
Best regards,
Dmitry Obukhov
Technical Support. Aurigma, Inc.
phether  
#12 Posted : Wednesday, June 20, 2012 6:22:04 AM(UTC)
phether

Rank: Member

Groups: Guest
Joined: 3/6/2012(UTC)
Posts: 10

Thanks: 1 times
Hi Dimitry,
so that being said I can't use Graphics Mill to create an avi as 1280x720 that is longer than roughly 10 seconds?
Seems to me that the memory usage is bloating too fast.
the amount of memory that increases when each frame is added is more then 2x what the image is (assuming an um-compressed bmp) and never gets cleared.
Now I know other 32-bit programs are able to create avi's much large than this without the memory issue. Though none of them have an SDK available to use.

Is there something I need to do differently in creating the avi?

Here is my main worker function
Code:

    void CreateAvi()
        {
            List<string> files = GetFiles();

            _aviWriter = new Aurigma.GraphicsMill.Codecs.AviWriter();

            _aviWriter.CompressorHandler = Aurigma.GraphicsMill.Codecs.AviCompressor.XvidMpeg4;

            _aviWriter.ResizeFrame = false;

            _aviWriter.FramesPerSecond = 30;
            _aviWriter.BytesPerSecond = 128;
            _aviWriter.KeyFrameRate = 160;

          
            _aviWriter.Open(_aviFile);
            for (int i = 0; i < files.Count; i++)
            {
                try
                {
                    Aurigma.GraphicsMill.Codecs.AviFrame frame = new Aurigma.GraphicsMill.Codecs.AviFrame(new Aurigma.GraphicsMill.Bitmap(files[i]));
                    _aviWriter.AddFrame(frame);
                }
                catch (Exception ex)
                {
                    System.Diagnostics.Debug.WriteLine(ex.ToString());
                }
                
            }
            _aviWriter.Close();

        }


I've tried closing,disposing the aviwrite every 50 frames, with the intent of re-opening to append more frames. but the memory doesn't clear up when I close and dispose the aviwriter.

Any thoughts on this?

thanks
Paul
phether  
#13 Posted : Wednesday, June 20, 2012 6:46:11 AM(UTC)
phether

Rank: Member

Groups: Guest
Joined: 3/6/2012(UTC)
Posts: 10

Thanks: 1 times
Hi Dmitry,
Ok I might have found a method that works.more testing required but it appears I need to explictly dipose of each and every frame after it is added to the avi writer
Code:
          for (int i = 0; i < files.Count; i++)
            {
                try
                {
                    Aurigma.GraphicsMill.Bitmap bmp = new Aurigma.GraphicsMill.Bitmap(files[i]);
                    Aurigma.GraphicsMill.Codecs.AviFrame frame = new Aurigma.GraphicsMill.Codecs.AviFrame(bmp);
                    _aviWriter.AddFrame(frame);
                    frame.Dispose();
                    bmp.Dispose();
                }
                catch (Exception ex)
                {
                    System.Diagnostics.Debug.WriteLine(ex.ToString());
                }
                
            }


this reduces the memory footprint substantially.

cheers
paul
Users browsing this topic
Guest (6)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.