RenderHeads / UnityPlugin-AVProVideo

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

Video 180 3D Playback (H264-H265) on neo 2 EYE #765

Closed delaunan closed 3 years ago

delaunan commented 3 years ago

Hi All, My 3D 180 video are playing nicely on Neo 2 EYE with resolution 5760x2880 bitrate 30, 30 FPS. It is not fluid at all in AVProVideo.

This is the ffmpeg I use to render.

H265: ffmpeg -y -i "TEST.mov" -c:v libx265 -preset slow -crf 17 -vf "stereo3d=sbs2l:abl, scale=2880x5760:out_range=full" -pix_fmt yuv420p -aspect 1:2 -c:a aac -b:a 160k -movflags faststart "TEST H265 5760 30 FPS.mp4" H264: ffmpeg -i "TEST.mov" -c:v libx264 -preset slow -crf 18 -x264-params mvrange=511 -vf "scale=5760x2880:out_range=full" -pix_fmt yuv420p -c:a aac -b:a 160k -movflags faststart "TEST H264 5760 30 FPS.mp4"

Would you have any recommendation of optimum setting/values while still keeping the highest quality possible ?

delaunan commented 3 years ago

I tried reducing resolution by half. Issue is still there. It is precisely dropped frames which make the video not fluid.

Ste-RH commented 3 years ago

Device information here. It has a 845 Snapdragon. Which appears to support video decoding of: 'Up to 4K Ultra HD video playback @ 60 fps' in h265.

'4k' can mean many things (4096x4096 or 4096x2048 or 4096x2160 or 3840x2160, etc)

So, your resolution of 5760x2880 is unlikely to work, or the device will not be able to decode it as desired, if all the above information is correct, but half of this should. Interesting note, you have '2880x5760' in your command line. and also an aspect of 1:2.

Some questions:

1) What is the problem you are seeing? Is the video not playing? Or Playing but dropping frames? Have you monitored what frame rate you are achieving?

2) Have you tried playing back your video in our Demo_MediaPlayer scene to rule out anything else at affecting decode frame rate?

3) What is the final resolution of the video being produced via your ffmpeg command line?

4) Have you tried a 'straight up 4k @ 60hz' video? Such as the one we include with the asset? (Cones-360Mono-4K60-HEVC.mp4 - though granted this is only ~5mbit)

5) What version of Unity are you using?

6) What version of AVPro Video are you using?

delaunan commented 3 years ago

Thanks a lot for your answer.

We have now the paid version since few days. So we have the latest version of the player (version 2.1.0) and Unity version (2020.1.2F1).

We use the Exo player API. We deactivated the "Resampler" and it improved the situation but it is still not fluid : dropped frames mainly.

In terms of rendering resolution it is 4096x2048 @29.97FPS : `I used premiere for rendering with 180 VR SBS metadata. I used the recommended setting from here. and could even push to 5120x2560 stereoscopic for some tests and it is still fluid in the Neo 2 headset native player.

I have made a "in-VR headset" recording have the VR 180 source file as well.

Could I send it to you in a private message so that you can have a better understanding of the issue ?

Here are the file information :

image

I don t have the feeling it is a performance issue but looking like frame-rate synchronization with refresh rate of the screen but I could be wrong.

I played the video with my IT colleague in the Demo player and the issue is still there.

Also, it is the first time we develop an app with the demo player. Maybe you will be able to spot one of the settings that we should adjust and that could be causing the issue :

image image image image

Please let me know if I can share the video (in-vr recording and source file) with you and where to send the dropbox link.

Thanks, Nicolas

Ste-RH commented 3 years ago

I will take a closer look when I am at my desk tomorrow.

You can send anything you desire kept private to unitysupport@renderheads.com and mark the subject #765.

One thing you can try is to ‘use OES rendering’ mode (and set the appropriate OES shader that we provide in the asset). The tick box can be found in the Android settings shown in your last screen shot. This bypasses a blit and so is naturally more performant as well as offers battery saving.

delaunan commented 3 years ago

I just sent you the content. Please let me know what you think. Thanks for your support.

Ste-RH commented 3 years ago

I am seeing stuttering playback in both the NEO (device) player and the Unity AVPro playback...compared to the source video. Can you confirm this is what you are seeing also?

It could be pulldown due to the rate differences (device 75Hz, video 29.97fps). Would be good to know what decode rate is being achieved. This can be found by interrogating 'GetVideoDisplayRate()'.

Another possibility - in your screen grab of the video details you have a 'Reference Frames' as 3. This could be taxing the inner frame decode. Dropping it to 2 might help.

delaunan commented 3 years ago

This is correct I also see this but I see more in the player. The rate we obtain is about 70-72 Hz. I will try to change the reference frames to 2, is there an easy way to change it in the rendering settings in premiere pro ? Not sure how it is done. Also, the PICO SDK suggests to deactivate the VSync function. Do you think it can have any impact ? Thanks.

delaunan commented 3 years ago

I found a 180 video shot with the same camera that does not have any stuttering. Looking great in AVPlayer. I am not sure what is wrong with mine. I will post the one that works well to you on unitysupport@renderheads.com so that you can have a look. The video is big 5760x2880 and 85.5Mb/s but still very smooth in the AVplayer.

Ste-RH commented 3 years ago

Not sure how this is done in Premier Pro. Are you not doing your final encode in ffmpeg (as stated originally) ? (see here for ffmpeg)

Disabling vsync might help, but it doesn't look like the main problem here.

From the specs, I would expect the device to be able to handle your video specifics without problem. Good to hear that you have found a sample that proves this. I will keep an eye out for the support email from you...

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.

stale[bot] commented 3 years ago

This issue has been automatically closed because it has not had recent activity. If you wish to continue this issue, then please create a new issue as we do not monitor closed issues.