LAV Codec crash

2 posters

Go down

LAV Codec crash Empty LAV Codec crash

Post by mOOmOOn Mon Feb 13, 2017 9:10 pm

Hi,

I have an issue with an application I developed when using the Basic setup ok K-Lite Codecs, hence LAV filter.
Basically, the application can play a MTS video file (from GoPro or whatever HD camcorder).
Playback is issued on a window that the user may drag and drop anywhere on the screen.
Computer is setup for extended desktop.

When playback is issued as the video window is on the secondary screen, the application hangs at start of the video.
I went to the conclusion that this is a LAV codec issue, as if I install K-Kite Full version and use ffdshow codecs as perfered codec, it works perfectly.
I have no problem with WMV files.
I have no problem when playback is issued on main screen, but only on second screen (desktop extended).
It is not a driver problem as I could verify the issue on 3 different machines. Two are Windows 7, one is Windows 10.
The issue occur systematically.

Moreover, here is the notification sequence from the GraphHandler :
evCode=0x53, param1=2, param2=0 (EC_VMR_RENDERDEVICE_SET)
evCode=0xd, param1=0, param2=0 (EC_CLOCK_CHANGED)
evCode=0x53, param1=2, param2=0 (EC_VMR_RENDERDEVICE_SET)
evCode=0xa, param1=70780800, param2=0 (EC_VIDEO_SIZE_CHANGED)
evCode=0xe, param1=0, param2=0 (EC_PAUSED)
This sequence corresponds to a working sequence.

When using LAV, I have the same sequence, except that the last code (EC_PAUSED) is never received and the application is hanged.
I must kill it with the task manager.

I tried with a simple snippet of code, that produces the same Handler sequence, and it works.
So I am convinced that the full application behaves a way that makes the crash be revealed in the codec. But the application is currently two complex to reduce the issue to a snippet.
You may find the application here : http://www.spotam.fr/portail/index.php/telechargements/category/3-logiciel-spotam
I can provide to you the exact procedure for reproducing the issue.
I also can generate some log to you if you tell me what to do.

Can you please help me in solving this issue that I definitely think it is a codec issue ?
This is annoying as I advise users to use K-Lite Basic package, but it does not work and I cannot tell them to change to ffdshow as it is not in the Basic package.

Also, do not hesitated to ask me if you need more inputs, but I guess that using my application you will point it out immediately.

With best regards.

mOOmOOn

Posts : 9
Join date : 2016-02-05

Back to top Go down

LAV Codec crash Empty Re: LAV Codec crash

Post by Admin Tue Feb 14, 2017 3:02 pm

Is hardware acceleration enabled in LAV? If so, does it work with that disabled?

Admin
Admin

Posts : 7632
Join date : 2011-06-17

https://codecs.forumotion.net

Back to top Go down

LAV Codec crash Empty Re: LAV Codec crash

Post by mOOmOOn Tue Feb 14, 2017 6:17 pm

No it is not.
Just in case, I tried to activate and still it hangs (tried all NVIDIA, Intel QuickSync, DVXA2 copy-back, DXVA2 native).

Is there a way I can generate a LAV log of the sequence ?

mOOmOOn

Posts : 9
Join date : 2016-02-05

Back to top Go down

LAV Codec crash Empty Re: LAV Codec crash

Post by Admin Tue Feb 14, 2017 8:22 pm

It is most likely a bug in your application. This issue does not exist with other players. The fact that is works with ffdshow does not mean everything you do is fully correct.

LAV behavior should not depend on which screen it is on (with software decoding). The screen only matters for the video renderer. Which renderer are you using? This is most likely the place where the problem is.

LAV doesn't do anything with regard to graph events, except from sometimes sending EC_VIDEO_SIZE_CHANGED. The rest is from the graphhandler.

You can build a debug version of LAV using its source code.
https://github.com/Nevcairiel/LAVFilters

Admin
Admin

Posts : 7632
Join date : 2011-06-17

https://codecs.forumotion.net

Back to top Go down

LAV Codec crash Empty Re: LAV Codec crash

Post by Admin Tue Feb 14, 2017 8:33 pm

This may be a helpful utility:
http://alax.info/blog/777

Admin
Admin

Posts : 7632
Join date : 2011-06-17

https://codecs.forumotion.net

Back to top Go down

LAV Codec crash Empty Re: LAV Codec crash

Post by mOOmOOn Wed Feb 15, 2017 11:21 pm

Hi,
Thanks for these advices. I'll have a look at all this.
I'm using VMR9, windowless mode.
Meanwhile, I did an interresting test :
My playback code basically is
...
GetClientRect(hwnd, &rc);
IVMRWindowlessControl9 -> SetVideoPosition(NULL, &rc)
...
IGraphBuilder -> RenderFile(...)

The strange thing is that if I remove SetVideoPosition call, the video starts as I can hear the audio, and I can see from my playback control that it ends correctly.
But of course I have no image displayed.

And of course, SetVideoPosition is the clue of setting the video on the second screen.

mOOmOOn

Posts : 9
Join date : 2016-02-05

Back to top Go down

LAV Codec crash Empty Re: LAV Codec crash

Post by Admin Thu Feb 16, 2017 12:19 am

What happens with a manual rect of {0,0,640,480} ?

Admin
Admin

Posts : 7632
Join date : 2011-06-17

https://codecs.forumotion.net

Back to top Go down

LAV Codec crash Empty Re: LAV Codec crash

Post by Admin Thu Feb 16, 2017 12:24 am


Admin
Admin

Posts : 7632
Join date : 2011-06-17

https://codecs.forumotion.net

Back to top Go down

LAV Codec crash Empty Re: LAV Codec crash

Post by mOOmOOn Thu Feb 16, 2017 6:46 am

Regarding manual DstRect init for SetVideoPosition, it still produces the same hang.
Interesting is that if I pass a SRCRect intead of NULL, it does not hang, but have the same beahiour as when removing SetVideoPosition call : sound, progress, but no image.
Here is my VMR init :

Code:

HRESULT InitWindowlessVMR9(
  IBaseFilter *pVMR,              // Pointer to the VMR
  HWND hwnd,                      // Clipping window
  IVMRWindowlessControl9** ppWC   // Receives a pointer to the VMR.
  )
{

  IVMRFilterConfig9 *pConfig = NULL;
  IVMRWindowlessControl9 *pWC = NULL;

  // Set the rendering mode.
  HRESULT hr = pVMR->QueryInterface(IID_PPV_ARGS(&pConfig));
  if (FAILED(hr))
    goto done;

  hr = pConfig->SetRenderingMode(VMR9Mode_Windowless);
  if (FAILED(hr))
    goto done;

  // Query for the windowless control interface.
  hr = pVMR->QueryInterface(IID_PPV_ARGS(&pWC));
  if (FAILED(hr))
    goto done;

  RECT rc;
  GetClientRect(hwnd, &rc);
  hr = pWC->SetVideoPosition(NULL, &rc);
  if (FAILED(hr))
    goto done;

  // Set the clipping window.
  hr = pWC->SetVideoClippingWindow(hwnd);
  if (FAILED(hr))
    goto done;

  // Preserve aspect ratio by letter-boxing
  hr = pWC->SetAspectRatioMode(VMR9ARMode_LetterBox);
  if (FAILED(hr))
    goto done;

  // Return the IVMRWindowlessControl pointer to the caller.
  *ppWC = pWC;
  (*ppWC)->AddRef();

done:
  SafeRelease(&pConfig);
  SafeRelease(&pWC);
  return hr;
}

mOOmOOn

Posts : 9
Join date : 2016-02-05

Back to top Go down

LAV Codec crash Empty Re: LAV Codec crash

Post by Admin Thu Feb 16, 2017 5:34 pm

I don't think you are supposed to call SetVideoPosition during init, but after you have connected the renderer to the graph.

Admin
Admin

Posts : 7632
Join date : 2011-06-17

https://codecs.forumotion.net

Back to top Go down

LAV Codec crash Empty Re: LAV Codec crash

Post by mOOmOOn Thu Feb 16, 2017 6:55 pm

Here we are bounce cheers
Calling SetVideoPosition only when EC_PAUSED is received works like a charm !
Thanks thanks thanks.
This bug had been turning me mad for almost 2 years, and produced bad effects when application crashed at midnight for the new year's day video  affraid
For my part, it's then OK.
Anyway, I guess there is anyway a bug it lower application layers, as it should not hang :-)
Also, let's admit all this was not clear from MSDN.
Moreover, I moved call of SetVideoPosition at EC_PAUSED reception, but maybe this is not the right place ?
We can mark this topic as fixed, and hopefully it may help someone some day.
Many thanks again.

mOOmOOn

Posts : 9
Join date : 2016-02-05

Back to top Go down

LAV Codec crash Empty Re: LAV Codec crash

Post by Admin Thu Feb 16, 2017 10:45 pm

Yes, MSDN documentation often lacks details and examples. I recommend doing a Google search on the interface and function names when things are unclear. That sometimes gives useful pieces of demo code.

Admin
Admin

Posts : 7632
Join date : 2011-06-17

https://codecs.forumotion.net

Back to top Go down

LAV Codec crash Empty Re: LAV Codec crash

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum