RenderHeads / UnityPlugin-AVProVideo

AVPro Video is a multi-platform Unity plugin for advanced video playback
https://www.renderheads.com/products/avpro-video/
238 stars 28 forks source link

The infamous general error, but I have solid information for you... #1964

Closed jsquared90 closed 1 month ago

jsquared90 commented 2 months ago

I am getting the infamous general issue (might be bad path, bad codec, too high resolution, etc...). However, I have a lot of very specific information for you to help understand how and why the error is being thrown.

I am building a cross-platform application that loads video media at runtime. So, all my instantiation of the MediaPlayer class is done with using the AbsolutePathOrURL path type when invoking the OpenMedia method.

Long story short... my app uses multiple connected/networked devices that can be Windows or MacOS environments. My issue particular pertains to use of the Hap codec. Quite frankly, my interest in your plugin is very specifically tied to the fact that your plugin supports Hap on both operation systems and especially NotchLC on Windows! That is - by far - the most attractive feature(s) of the plugin.

I am currently evaluating your plugin for usage in our application, so I am using your trial version while we determine if it is a viable option.

For MacOS devices, ProRes or Hap files are options for the user. They essentially point the application to files on the local file system. I am currently using the native Unity VideoPlayer class for ProRes files. I am experimenting with your plugin for Hap playback. I am able to get successful playback of Hap files on MacOS.

Because there is no solution for playback of ProRes files on Windows, I am currently using FFmpeg to convert any files to Hap on Windows systems (when user chooses a ProRes file). The command I am using for the conversion is:

PATH_TO_FFMPEG_EXE -i PATH_TO_SOURCE -s RESOLUTION -c:v hap -format hap_q -c:a pcm_s16le -ar 48000 PATH_TO_TARGET

On Windows, your generic error is thrown. To troubleshoot, I manually created a .mov file using the H264 encoder and replaced the Hap file so that the file + extension would be an exact match. No error thrown and video rendered just fine. So, it definitely pertains to the Hap encoding and only on Windows. Resolution for my testing is UHD (3840x2160).

My testing on Windows is NOT with the editor!! It is using a build. I do all my IDE work on MacOS!!

Also - If we move forward with the use of this plugin in our application, I want to make sure we are honoring the licensing agreement correctly. I reached out to Unity via our Unity Industry license account and they said licensing related inquiries have a 2 month back log for response. We are not lawyers and we just want to confirm with a human that we are following the rules. I have read all the EULA documentation and related articles but would just love to confirm with your team!

Thx,

JJ Myers

Chris-RH commented 2 months ago

Hi,

For Windows are you using the Media Foundation or DirectShow API? You need to make sure that you have enabled "Use HAP/NotchLC" option in the Windows component and then enable "Use Custom MOV Parser" More info on HAP in our documentation.

jsquared90 commented 2 months ago

Hey there,

I was able to make progress with the provided notes and Hap Codec documentation. I also went ahead and purchased a license as I am now confident this plugin will provide the solution I am looking for. However, I have now run into a new issue. Although the plugin seems to be visually and audibly working as intended, an error is being thrown immediately after a debug statement that appears to be relevant to the error. Here are the 2 statements of relevancy:

d3d11: Creating a default shader resource view with dxgi-fmt=87 for a texture that uses dxgi-fmt=88 Unsupported D3D format 0x58

I found a bug report pertaining to the error, but it was a very old post (2019):

https://github.com/RenderHeads/UnityPlugin-AVProVideo/issues/85

In that report, it appeared the issue involved a locked DLL file. Even with it being outdated, I ruled out a locked DLL as the culprit by following the same recommendations in the report, to no avail…

I could not find anything else helpful pertaining to this issue. Here is some more context that will hopefully provide more useful information…

My IDE is running on an Intel-based Mac. Everything runs fine in Unity Editor there. I made all the recommended settings in the component for Windows. I am using the Media Foundation API. I am then compiling to Windows Intel 64-bit, moving the compiled app to a Windows device over a network file share, and then running the app for final testing. The 2nd device is another Intel-based Mac that is running Windows natively via Boot Camp.

Let me know if there is any other information you need, and thanks in advance for your help!

Regards,

JJ Myers Pixel Mosaic | Director

T: +1 (312) 481-7979 M: +1 (847) 924-7983 @. @.> | www.pixelmosaic.com http://www.pixelmosaic.com/ 2415 W. 19th St., Suite 2B Chicago, IL 60608

On Aug 9, 2024, at 2:00 AM, Chris-RH @.***> wrote:

Hi,

For Windows are you using the Media Foundation or DirectShow API? You need to make sure that you have enabled "Use HAP/NotchLC" option in the Windows component and then enable "Use Custom MOV Parser" More info on HAP in our documentation https://renderheads.com/content/docs/AVProVideo-v3/articles/feature-hap-codec.html.

— Reply to this email directly, view it on GitHub https://github.com/RenderHeads/UnityPlugin-AVProVideo/issues/1964#issuecomment-2277274681, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACRKV4BNDZEVJ76U6LOHHMLZQRSIZAVCNFSM6AAAAABMHWE7ZCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENZXGI3TINRYGE. You are receiving this because you authored the thread.

Chris-RH commented 2 months ago
  1. Does the same issue occur if you use D3D12?
  2. Are you using the built-in render pipeline, URP, or HDRP?
  3. Is it reproducible in a new project, running only AVPro Video?
jsquared90 commented 2 months ago

I had not even put 2 and 2 together until you mentioned it… I did not realize the “d3d11” prompt indicated DirectX 11.

When I run dxdiag is states that the installed version of DirectX is DiectX 12. So I am confused. Also, I read all the platform notes in your documentation and I am definitely meeting the minimum Unity requirements for DirectX 12. I am going to perform some updates on the device to see if that affects anything, but other than that, do you have any further words of wisdom?

Thanks,

JJ Myers Pixel Mosaic | Director

T: +1 (312) 481-7979 M: +1 (847) 924-7983 @. @.> | www.pixelmosaic.com http://www.pixelmosaic.com/ 2415 W. 19th St., Suite 2B Chicago, IL 60608

On Aug 12, 2024, at 5:16 AM, Chris-RH @.***> wrote:

Does the same issue occur if you use D3D12?

— Reply to this email directly, view it on GitHub https://github.com/RenderHeads/UnityPlugin-AVProVideo/issues/1964#issuecomment-2283586045, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACRKV4FWAJVAHNOXEP7TDM3ZRCDRHAVCNFSM6AAAAABMHWE7ZCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOBTGU4DMMBUGU. You are receiving this because you authored the thread.

Chris-RH commented 2 months ago

Hi,

In Unity, if you go to Edit -> Project Settings -> Player In the Windows tab, you can switch the graphics API from Direct3D11 to Direct3D12

gfxapi

jsquared90 commented 2 months ago

I was not aware of that setting. When I switch to D12, upon load/initialization of the Media Player component, the main thread now hangs (spinning wheel). There are no exceptions generated before it locks up. It looks as though some steps get through in the loading process, but it ultimately hangs indefinitely.

Previously when using D11, there would be sluggish behavior (dropped frames, etc..) upon initialization and then the unsupported format exception would fire. After first initialization, any subsequent use of the plugin would work with intended visual and audible results, but the exception continues to fire for each instance. Now with D12, it looks at first like the same similar sluggish behavior occurs, but then hangs. It looks like it gets through maybe a dozen or so thread cycles before it just locks up.

Not sure this would provide any help, but this is my code that causes the lockup:

mediaPlayer.OpenMedia( new MediaPath( source, MediaPathType.AbsolutePathOrURL), false);

“source” is a string object of an absolute path to a local file that is validated before getting to this step. The only additional context I can think that would be helpful is that this gets called multiple times at once. That is because there are multiple “layers” of a Hap video being presented in the application.

Thanks!

JJ Myers Pixel Mosaic | Director

T: +1 (312) 481-7979 M: +1 (847) 924-7983 @. @.> | www.pixelmosaic.com http://www.pixelmosaic.com/ 2415 W. 19th St., Suite 2B Chicago, IL 60608

On Aug 13, 2024, at 8:48 AM, Chris-RH @.***> wrote:

Hi,

In Unity, if you go to Edit -> Project Settings -> Player In the Windows tab, you can switch the graphics API from Direct3D11 to Direct3D12

gfxapi.jpg (view on web) https://github.com/user-attachments/assets/da8b39c4-6cc4-4278-b18a-c7498c7778ee — Reply to this email directly, view it on GitHub https://github.com/RenderHeads/UnityPlugin-AVProVideo/issues/1964#issuecomment-2286304598, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACRKV4APSHUUHYPZV3R4NW3ZRIFENAVCNFSM6AAAAABMHWE7ZCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOBWGMYDINJZHA. You are receiving this because you authored the thread.

jsquared90 commented 2 months ago

Good afternoon (or evening, or possibly morning…)

I went into our office today so I could try out my code on some better hardware. The Intel based MBP I had been trying on is something I carry around for convenience. I wanted to rule out anything from a Boot Camp or insufficient video hardware standpoint. So I ran my app on a server grade device we use for high performance video playback for events. This is a device we have installed and run “media server” software for the events we produce for years (eg. WATCHOUT) using Hap files. Some quick, important specs:

I am encountering the same exact issues I did with the MBP:

I have to do some more benchmarking, but it is looking like the current state is usable, as long as I don’t leave development mode on in the build. That is also assuming there is no consequence to just catching the exceptions and ignoring them. One question I have for you - would it be helpful if I put a profiler in place? I do not have any experience with profiling, but am happy to do so if it is helpful for you. Any tips/leads on how to do that properly and how to capture would be greatly appreciated. I am a self-taught developer, so everything I have learned has been online, through ChatGPT, etc...

Thanks,

JJ Myers Pixel Mosaic | Director

T: +1 (312) 481-7979 M: +1 (847) 924-7983 @. @.> | www.pixelmosaic.com http://www.pixelmosaic.com/ 2415 W. 19th St., Suite 2B Chicago, IL 60608

On Aug 13, 2024, at 8:48 AM, Chris-RH @.***> wrote:

Hi,

In Unity, if you go to Edit -> Project Settings -> Player In the Windows tab, you can switch the graphics API from Direct3D11 to Direct3D12

gfxapi.jpg (view on web) https://github.com/user-attachments/assets/da8b39c4-6cc4-4278-b18a-c7498c7778ee — Reply to this email directly, view it on GitHub https://github.com/RenderHeads/UnityPlugin-AVProVideo/issues/1964#issuecomment-2286304598, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACRKV4APSHUUHYPZV3R4NW3ZRIFENAVCNFSM6AAAAABMHWE7ZCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOBWGMYDINJZHA. You are receiving this because you authored the thread.

RichRH commented 2 months ago

Hi @jsquared90,

Thanks for all of the info - I'll try and answer what I can here:

Hopefully that helps a bit but do shout if you've any other specific issues..

Cheers,

jsquared90 commented 2 months ago

Thanks. I will send a sample file, as well as the command line to ffmpeg I am using in my app to convert files to hap. I will send that to the unity support email in a moment. As for the initial frame drops, there is definitely some more work to be done on my end, in terms of optimizing the initialization of game objects, doing some pre-loading at start up, and general recycling of game objects that I believe will ultimately help with this and general app performance. For now, it is easy to navigate around in the app. The user just needs to understand after the first cue gets loaded, things then level out and become stable.

PS - I also just recently learned of your other Unity plugin/product that interfaces Unity projects with Blackmagic Decklink hardware. Super cool! I definitely feel like I will need to add that to my app’s functionality down the road as well. I really love what you guys are doing. I am hoping our paths can cross in person sometime in the future!

Thanks!

JJ Myers Pixel Mosaic | Director

T: +1 (312) 481-7979 M: +1 (847) 924-7983 @. @.> | www.pixelmosaic.com http://www.pixelmosaic.com/ 2415 W. 19th St., Suite 2B Chicago, IL 60608

On Sep 2, 2024, at 11:27 AM, Richard Turnbull @.***> wrote:

Hi @jsquared90 https://github.com/jsquared90,

Thanks for all of the info - I'll try and answer what I can here:

D3D11 exception regarding incorrect format thrown on any usage of plugin - Occasionally some of the native formats conflict with what Unity (thinks) it supports leading to these 'errors'. Generally you're fine to ignore these as the formats still actually render and I try and fix them as I find them - e.g. I've literally just fixed another HAP-related one. D3D12 lockup - I've just tried a HapQ video here and it played fine so wonder whether it's something specific to the videos you're creating. If possible, would you be able to send a sample to: @. @.>? Inital frame drops - It's quite possible during initialisation/loading some frames are dropped if threads are starved etc.. and as you say seems to stabalise afterwards. You could try attaching the profiler and looking for spikes at startup but if you've not much experience in this area it could be a bit of a rabbit hole! (You primarily want to avoid starving the main thread - large loops, waiting on state etc..) Hopefully that helps a bit but do shout if you've any other specific issues..

Cheers,

— Reply to this email directly, view it on GitHub https://github.com/RenderHeads/UnityPlugin-AVProVideo/issues/1964#issuecomment-2325069280, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACRKV4EMX7SVS2QXENJG3PLZUSGW3AVCNFSM6AAAAABMHWE7ZCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMRVGA3DSMRYGA. You are receiving this because you were mentioned.

RichRH commented 2 months ago

Hi @jsquared90,

Thanks for sending through the video - I've fixed a couple of issues primarily related to the Trial/watermarking which I hope will address the oddities you were seeing related to format errors and D3D12 locking up. These will be in the next release.

Also, thanks for your kind words re: our plugins and hopefully they all work out for you!

Cheers,

Ste-RH commented 1 month ago

AVPro Video v3.0.10 has now been released. Do let us know if this fixes the issue for you.

jsquared90 commented 1 month ago

Hello Renderheads!

Just wanted to let you know I saw the notice about the update to AVPro. I am planning on updating my IDE once I get past an event I am using my app for next week. I didn’t want to make any significant changes to my build in such close proximity to the upcoming usage. I will update it as soon as I am clear from this event and will let you know if I run into anything unexpected!

Thanks,

JJ Myers Pixel Mosaic | Director

T: +1 (312) 481-7979 M: +1 (847) 924-7983 @. @.> | www.pixelmosaic.com http://www.pixelmosaic.com/ 2415 W. 19th St., Suite 2B Chicago, IL 60608

On Sep 6, 2024, at 9:22 AM, Ste Butcher @.***> wrote:

AVPro Video v3.0.10 has now been released. Do let us know if this fixes the issue for you.

— Reply to this email directly, view it on GitHub https://github.com/RenderHeads/UnityPlugin-AVProVideo/issues/1964#issuecomment-2334174208, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACRKV4E4YSLAPCQRKOBB4C3ZVG3CXAVCNFSM6AAAAABMHWE7ZCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMZUGE3TIMRQHA. You are receiving this because you were mentioned.

Chris-RH commented 1 month ago

That's ok, do it in your own time :) If the issue is not fixed then we'll reopen this :)

jsquared90 commented 1 month ago

Hello Renderheads!

So.. I was able to confirm now that I no longer get the format error when using v3.0.11. That is the good news. However, I came across a new bug of some sort on this last project where I was using v3.0.8 on and just confirmed the bug with v3.0.11 as well. What I am finding is that on videos with a duration longer than 2 minutes, the demuxed audio stream is drifting out of synchronization with the video stream. I have a file here you can test with:

https://www.dropbox.com/scl/fi/2p0pd1r5pgwdvh69q7hjm/davita_tlm_service_091824_7.mov?rlkey=oicn9q7f3a0uigdgzfnqzg4jf&dl=0

I apologize for it being a large download. Sort of no way around it when you need a long duration file!

If you load this file up in AVPro and cue to the last 30 seconds or so, you should see the lip sync start to fall apart. Several frames by my estimation. I was able to come up with a solution on this last project by muting the audio in the AVPPro game object and synchronizing an exported WAV file in tandem with the video file. Obviously not my favorite solution but it worked!

Let me know your thoughts after you are able to test. Curious to know if there is something in the Hap encoding settings that is causing this or something else. I did load up the video in an editor and the A/V lock was spot on. It is only when I load it in AVPro that I am experiencing the sync issue.

Thanks!

JJ Myers Pixel Mosaic | Director

T: +1 (312) 481-7979 M: +1 (847) 924-7983 @. @.> | www.pixelmosaic.com http://www.pixelmosaic.com/ 2415 W. 19th St., Suite 2B Chicago, IL 60608

On Sep 16, 2024, at 2:52 AM, Chris-RH @.***> wrote:

That's ok, do it in your own time :) If the issue is not fixed then we'll reopen this :)

— Reply to this email directly, view it on GitHub https://github.com/RenderHeads/UnityPlugin-AVProVideo/issues/1964#issuecomment-2352230545, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACRKV4FEVZP6OQK2RHYBMUDZW2E2LAVCNFSM6AAAAABMHWE7ZCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNJSGIZTANJUGU. You are receiving this because you were mentioned.

jsquared90 commented 1 month ago

Sorry… I also meant to ask you all something less related (and apologies for mixing threads)…

Have you all ever heard of SMPTE 2110 and nVidia Rivermax?

https://developer.nvidia.com/networking/rivermax

Just curious if you all might ever be interested in writing a plugin that uses the SDK? I am still researching, but I think there is a strong possibility we would pay top dollar for such a plugin so we could offer SMPTE 2110 output from the product we are developing. It would be too much for me to take on myself at this time, so I figured I would ask the team with way more brainpower than myself!!

Thanks,

JJ Myers Pixel Mosaic | Director

T: +1 (312) 481-7979 M: +1 (847) 924-7983 @. @.> | www.pixelmosaic.com http://www.pixelmosaic.com/ 2415 W. 19th St., Suite 2B Chicago, IL 60608

On Sep 24, 2024, at 10:54 AM, Justin Myers @.***> wrote:

Hello Renderheads!

So.. I was able to confirm now that I no longer get the format error when using v3.0.11. That is the good news. However, I came across a new bug of some sort on this last project where I was using v3.0.8 on and just confirmed the bug with v3.0.11 as well. What I am finding is that on videos with a duration longer than 2 minutes, the demuxed audio stream is drifting out of synchronization with the video stream. I have a file here you can test with:

https://www.dropbox.com/scl/fi/2p0pd1r5pgwdvh69q7hjm/davita_tlm_service_091824_7.mov?rlkey=oicn9q7f3a0uigdgzfnqzg4jf&dl=0

I apologize for it being a large download. Sort of no way around it when you need a long duration file!

If you load this file up in AVPro and cue to the last 30 seconds or so, you should see the lip sync start to fall apart. Several frames by my estimation. I was able to come up with a solution on this last project by muting the audio in the AVPPro game object and synchronizing an exported WAV file in tandem with the video file. Obviously not my favorite solution but it worked!

Let me know your thoughts after you are able to test. Curious to know if there is something in the Hap encoding settings that is causing this or something else. I did load up the video in an editor and the A/V lock was spot on. It is only when I load it in AVPro that I am experiencing the sync issue.

Thanks!

JJ Myers Pixel Mosaic | Director

T: +1 (312) 481-7979 M: +1 (847) 924-7983 @. @.> | www.pixelmosaic.com http://www.pixelmosaic.com/ 2415 W. 19th St., Suite 2B Chicago, IL 60608

On Sep 16, 2024, at 2:52 AM, Chris-RH @.***> wrote:

That's ok, do it in your own time :) If the issue is not fixed then we'll reopen this :)

— Reply to this email directly, view it on GitHub https://github.com/RenderHeads/UnityPlugin-AVProVideo/issues/1964#issuecomment-2352230545, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACRKV4FEVZP6OQK2RHYBMUDZW2E2LAVCNFSM6AAAAABMHWE7ZCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNJSGIZTANJUGU. You are receiving this because you were mentioned.

Chris-RH commented 1 month ago

Hi @jsquared90,

Would you be able to open a new issue ticket for new bug please. Is it still just on Windows?

jsquared90 commented 1 month ago

Yes will do. I will check on MacOS and include that information in the ticket.

Thanks,

JJ Myers Pixel Mosaic | Director

T: +1 (312) 481-7979 M: +1 (847) 924-7983 @. @.> | www.pixelmosaic.com http://www.pixelmosaic.com/ 2415 W. 19th St., Suite 2B Chicago, IL 60608

On Sep 25, 2024, at 2:15 AM, Chris-RH @.***> wrote:

Hi @jsquared90 https://github.com/jsquared90,

Would you be able to open a new issue ticket for new bug please. Is it still just on Windows?

— Reply to this email directly, view it on GitHub https://github.com/RenderHeads/UnityPlugin-AVProVideo/issues/1964#issuecomment-2373243485, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACRKV4HCT5ASPYB5TT2VM6LZYJPHZAVCNFSM6AAAAABMHWE7ZCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNZTGI2DGNBYGU. You are receiving this because you were mentioned.

Chris-RH commented 1 month ago

much appreciated, thank you :)

jsquared90 commented 3 weeks ago

Hey Renderheads!

I just noticed a comment on the bug report I submitted for this (#2013). Coincidentally, I was doing all sorts of extensive testing yesterday and have a bunch of information to report. I just wanted to see how you all prefer I submit this information to the support page on git. I wasn’t sure how much of this you want in the same convo/report and how much you would want me to open up a new ticket for…

(Note : all information is strictly in regards to Hap and NotchLC formats)

I have tried various combinations of Graphics API and Video API, as well as experimenting with different settings in the Media Player game object. I have also begun testing Hap-R and NotchLC formats. Here is a summary of my findings:

  1. I can resolve the sync issue for legacy Hap formats (Hap, HapQ, Hap-Alpha) if I set the Video API to Direct Show. However, Hap-R does not render any pixels to screen or sound when the Video API is set to Direct Show. Of course, that is the same for NotchLC, but is to be expected according to the documentation.

  2. I can resolve sync for all Hap formats (including Hap-R) when using the DX11/Media Foundation APIs, if I disable the setting “Renderer Sync”.

  3. The only format I can get to play in DX12 are legacy Hap formats. Otherwise, I run into all sorts of problems with Hap-R and NotchLC in DX12.

  4. The only combo/settings that yield any sorts of rendered video and audio information for NotchLC is DX11/Media Foundation/“Renderer Sync” off. However, I still experience the A/V sync issues reported in ticket for NotchLC, even with these settings. I have tried all sorts of other combinations for NotchLC and can never yield a successful result of rendered video and audio.

I created a spreadsheet that documents some of my findings, that you might find helpful:

https://www.dropbox.com/s/rfwlnsx3bcn9xqt/AVPro%20Notes.xlsx?dl=0

I also uploaded the Hap-R and NotchLC versions to a Dropbox folder, in case you would like apples-to-apples comparisons for testing:

Hap-R: https://www.dropbox.com/s/wmobevjbaorljuy/Test%20File_HAPR.mov?dl=0

NotchLC: https://www.dropbox.com/s/09i4xfmkdbh82ho/Test%20File_NotchLC.mov?dl=0

Let me know your preference for submitting this information to the git support page and I will get that done ASAP!

Thanks,

JJ Myers Pixel Mosaic | Director

T: +1 (312) 481-7979 M: +1 (847) 924-7983 @. @.> | www.pixelmosaic.com http://www.pixelmosaic.com/ 2415 W. 19th St., Suite 2B Chicago, IL 60608

On Sep 25, 2024, at 9:37 AM, Chris-RH @.***> wrote:

much appreciated, thank you :)

— Reply to this email directly, view it on GitHub https://github.com/RenderHeads/UnityPlugin-AVProVideo/issues/1964#issuecomment-2374281902, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACRKV4HDWRVZCM7NLLKK65TZYLDDRAVCNFSM6AAAAABMHWE7ZCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNZUGI4DCOJQGI. You are receiving this because you were mentioned.

RichRH commented 3 weeks ago

Hi @jsquared90,

Thanks for this comprehensive report!

  1. You're correct that NotchLC is only supported under Media Foundation. However, I've just tried your Hap-R video and it works for me here under DirectShow - you might need latest LAVFilters? (https://github.com/nevcairiel/lavfilters/releases):

image

  1. Thanks for confirming disabling 'Renderer Sync' resolves your sync issues - this makes sense as it's effectively sacrificing performance for (visual) frame accuracy. I'm actually rewriting a lot of the Windows plugin and this is on my list to address.

  2. I've just tried D3D12 and NotchLC just worked:

image

But there was indeed an issue with Hap-R - I've added a fix for the next release but in the meantime you can add the following lines to 'WindowsMediaPlayer.cs' ~line 1109:

    case 12:    // 'BC7'
        textureFormat = TextureFormat.BC7;
        break;

image

If you find any more issues here then a 'D3D12 / Hap'-specific ticket might be best.

  1. Similar to 2, NotchLC can be quite an intense decode and performance is on my list to address with the rewrite. If it's really a blocker then you might want to create a 'NotchLC Performance'-esque ticket but I'm hoping this can fall out in the wash (/rewrite :).

Cheers!

jsquared90 commented 3 weeks ago

Hey Rich and team,

One quick follow up. I think I must have been mistaken regarding my note about disabling “Renderer Sync” correcting the sync issue. I have been spending this morning battling the same issue (unexpectedly) and that is not providing the solution. You ever have one of those days where you feel like you are in an episode of the Twilight Zone?

Anyways… my current (hopefully temporary) solution for all things Hap is to run the plugin in Direct Show mode instead of Media Foundation, until we can get down to the bottom of the sync issue. I was able to install the latest LAVFilters and get HapR to run in Direct Show mode. I just wanted to let you know these latest results so I don’t cause one of those “running down a rabbit hole” situations on your end with inaccurate information!

Let me know if you would like me to update the report on git with this latest information.

Thanks,

JJ Myers Pixel Mosaic | Director

T: +1 (312) 481-7979 M: +1 (847) 924-7983 @. @.> | www.pixelmosaic.com http://www.pixelmosaic.com/ 2415 W. 19th St., Suite 2B Chicago, IL 60608

On Oct 11, 2024, at 5:31 AM, Richard Turnbull @.***> wrote:

Hi @jsquared90 https://github.com/jsquared90,

Thanks for this comprehensive report!

You're correct that NotchLC is only supported under Media Foundation. However, I've just tried your Hap-R video and it works for me here under DirectShow - you might need latest LAVFilters? (https://github.com/nevcairiel/lavfilters/releases): image.png (view on web) https://github.com/user-attachments/assets/8b8d08d2-b975-41ef-84c0-5f04e9dbbf54 Thanks for confirming disabling 'Renderer Sync' resolves your sync issues - this makes sense as it's effectively sacrificing performance for (visual) frame accuracy. I'm actually re-writing a lot of the Windows plugin and this is on my list to address.

I've just tried D3D12 and NotchLC just worked:

image.png (view on web) https://github.com/user-attachments/assets/af240a64-4359-48c2-9fc6-5e964aca2574 But there was indeed an issue with Hap-R - I've added a fix for the next release but in the meantime you can add the following lines to 'WindowsMediaPlayer.cs' ~line 1109:

case 12: // 'BC7' textureFormat = TextureFormat.BC7; break; image.png (view on web) https://github.com/user-attachments/assets/3820d450-857e-4f6e-b8a7-dd5da754a1a3 If you find any more issues here then a 'D3D12 / Hap'-specific ticket might be best.

Similar to 2, NotchLC can be quite an intense decode and performance is on my list to address with the rewrite. If it's really a blocker then you might want to create a 'NotchLC Performance'-esque ticket but I'm hoping this can fall out in the wash (/rewrite :). Cheers!

— Reply to this email directly, view it on GitHub https://github.com/RenderHeads/UnityPlugin-AVProVideo/issues/1964#issuecomment-2407120661, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACRKV4A35W3FK3EIRK2G243Z26SHRAVCNFSM6AAAAABMHWE7ZCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMBXGEZDANRWGE. You are receiving this because you were mentioned.

RichRH commented 2 weeks ago

Hi @jsquared90,

Haha.. thanks for the update - in this world there are many rabbit holes!

Good that you have a workaround - if you wouldn't mind updating the relevant ticket(s) with any findings that'd be great, just in case others face similar issues.

I'm hoping the sync issues will fall out in the rewrite as there'll definitely but some focus on performance - as to when that sees the light of day is a tough call though.. hah.. full-circle back to the rabbit holes!

Cheers,