RenderHeads / UnityPlugin-AVProVideo

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

Videos with MKV interlacing using separate fields or DTS / MP2 audio do not play #632

Closed hsinpa closed 3 years ago

hsinpa commented 3 years ago

Describe the bug I have run into few mkv video, that is either showing codec error or freeze unity app. However, when they all fit with the codec listed on supportedmedia.html

AVpro team already reply me through email. I just list here as issue tracking.

Your Setup (please complete the following information): AVpro 2.0.7 Core Edition Unity 2019.4.15 Window10

To Reproduce

  1. Play the video through MediaPlayer

Videos

  1. Cause Unity to freeze, and required restart app https://www.dropbox.com/s/l4uk7ace15wlewz/VideoAppFreeze_01.mkv?dl=0

  2. Codec error https://www.dropbox.com/s/813j8cn5lbhm3m2/VideoCodecError_01.mkv?dl=0 https://www.dropbox.com/s/v5b728y9eg71hv0/VideoCodecError_02.mkv?dl=0

hsinpa commented 3 years ago

Following is the message respond from RenderHead team. Paste here for issue tracking purpose.

_Hi,

Thanks for contacting AVPro support. I am sorry to hear you are seeing these issues. I do hope we can help.

1) VideoAppFreeze_01.mkv it appears the video is interlaced (ffprobe reports it as having 'top first')

Stream #0:0: Video: h264 (Baseline), yuv420p(tv, bt709, top first), 1920x1080 [SAR 1:1 DAR 16:9], 50 fps, 50 tbr, 1k tbn, 50 tbc (default)

We think there might be a bug playing back interlaced videos and will be looking into adding a fix for that.

2) Both these videos have interesting audio streams:

Stream #0:1(eng): Audio: dts (DTS), 48000 Hz, 5.1(side), fltp, 1536 kb/s (default) and Stream #0:1(eng): Audio: aac (LC), 48000 Hz, 7.1, fltp (default)

The WinRT API will play these videos back, but without audio output. MediaFoundation fails to play these. We will investigate why the audio is proving problematic

We will respond further when we have had chance to look deeper into the issue with each video.

Best, Ste_

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

AndrewRH commented 3 years ago

Thanks, we have investigated these videos and indeed they do not play. The MKV is interlaced, which is not a problem, but it uses "separate fields" which is uncommon compared to the usual interleaved fields, and this seems to cause Media Foundation to freeze. There is nothing we can do about this.

The other videos have audio tracks in DTS / MP2 formats which are also not supported on Media Foundation.

See our supported media formats here: https://www.renderheads.com/content/docs/AVProVideo/articles/supportedmedia.html

Basically we cannot support all formats. If you need to support all formats the closest thing we have is to install a 3rd party codec library (we recommend LAV Filters), and switch the Video API to DirectShow. This will not give you hardware acceleration but it is the best compatibility.

I will close this issue now as we do not have any plans to fix these issues and regard them as edge cases.

Thanks,