0

I am using Bass.Net in my application to read .mp4 data. If i use normal .mp4 file which is limited to 700MB, It works fine. But if it exceeds the limit like 1GB that is actually 2.30 hours of data. I am getting an exception and it does not allow me to make any process further. Can you please help me in this to resolve the problem ?

Attached the exception screenshot and stacktrace.

enter image description here

System.Reflection.TargetInvocationException was unhandled
  _HResult=-2146232828
  _message=Exception has been thrown by the target of an invocation.
  HResult=-2146232828
  IsTransient=false
  Message=Exception has been thrown by the target of an invocation.
  Source=mscorlib
  StackTrace:
       at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
       at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
       at System.Reflection.RuntimeMethodInfo.UnsafeInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
       at System.Delegate.DynamicInvokeImpl(Object[] args)
       at System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme)
       at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)
       at System.Windows.Forms.Control.InvokeMarshaledCallbacks()
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
       at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.Run(Form mainForm)
       at WaveformGenerator.Program.Main() in d:\samples\WaveformGenerator_demo\WaveformGenerator\Program.cs:line 16
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: System.ArgumentException
       _HResult=-2147024809
       _message=Parameter is not valid.
       HResult=-2147024809
       IsTransient=false
       Message=Parameter is not valid.
       Source=System.Drawing
       StackTrace:
            at System.Drawing.Bitmap..ctor(Int32 width, Int32 height, PixelFormat format)
            at System.Drawing.Bitmap..ctor(Int32 width, Int32 height)
            at WaveformGenerator.WaveformGenerator.CreateHorizontalWaveformImage(WaveformDirection direction, WaveformSideOrientation sideOrientation, Int32 width, Int32 height, Single peakValue, Int32 numFullRenderFrames, Single[] leftLevelArr, Single[] rightLevelArr, Brush leftSideBrush, Brush rightSideBrush, Brush centerLineBrush) 
            at WaveformGenerator.WaveformGenerator.CreateWaveformImage(WaveformDirection direction, WaveformSideOrientation sideOrientation, Int32 width, Int32 height, Single peakValue, Int32 numFullRenderFrames, Single[] leftLevelArr, Single[] rightLevelArr, Brush leftSideBrush, Brush rightSideBrush, Brush centerLineBrush) 
            at WaveformGenerator.WaveformGenerator.CreateWaveform(Int32 width, Int32 height) 
            at WaveformGenerator.Form1.ReloadWaveform() 
            at WaveformGenerator.Form1.wg_ProgressChanged(Object sender, ProgressChangedEventArgs e) 
            at WaveformGenerator.WaveformGenerator.<DetectWaveformLevelsInnerAsync>b__3(ProgressChangedEventArgs value)
            at System.Progress`1.InvokeHandlers(Object state)
       InnerException: 
David Bekham
  • 2,175
  • 3
  • 27
  • 56
  • 1
    What exception do you get. Please post some code. – DWright Apr 27 '15 at 03:39
  • @DWright Hi, Stacktrace and exception screenshot is added – David Bekham Apr 27 '15 at 16:12
  • Ok, that's getting better, although usually it also helps to have the code that fired off whatever is throwing the exception. In this case, the inner exception is showing you that it's having a problem drawing the wave form, because the exception is getting thrown from a call to System.Drawing.Bitmap. Maybe the Waveform visualizer is not set to handle this much data. Can you try to turn off the visualizer and process without visualizer, and see if things work? – DWright Apr 27 '15 at 16:17
  • i need the implementation using waveform generator only. So better I need the solution with that – David Bekham Apr 27 '15 at 17:43
  • Maybe check Bass.Net documentation and see what the largest file size is that it can handle? – DWright Apr 27 '15 at 18:11

0 Answers0