0

I'm trying to get a 360 streamed video to play at its full (4k) resolution. I did do previous searching and found the below thread but it didn't answer my question.

How do I adjust the video resolution?

My end goal is to integrate this into vlc unity but I also don't see how to adjust the resolution up to 4k (or higher) for streamed videos even on the desktop app. As a test, I tried a 4k video from youtube in the VLC desktop app and couldn't see how to get it to play in 4k. The end goal is to stream from aws but I want to confirm that my stream can indeed play at 4k before continuing to try to figure out why it's playing at lower resolution within Unity. It resizes down to 1920x1080 instead of the intended 4096x2048 for my aws stream and resizes the youtube video down to 1280x720 from its 3840x2160.

I've tried messing with the advanced settings and looking at input/codecs and the best option for "preferred video resolution" is "best available" (below that is full hd). I've looked through other suggestions online and didn't see a lot to change but did change Settings-->Video-->Output to "DirectX (DirectDraw) video output. This one was just me fumbling through the desktop app, but I tried going through Media-->Open Network Stream, clicking the arrow next to play and selecting stream, choosing RTSP for destination, and then editing the resolution within the profile to be a specified width and height. None of the above changed the resolution of the video.

TL;DR - How can I play a streamed video at higher resolutions (4k and up) in the VLC desktop app and in VLC Unity?

Edit - adding requested code snippets. This just modifies the UseRenderingPlugin file from the VLC unity asset.

Also, similar to what was getting discussed in the comments, when I play the video locally instead of streaming, it plays at the full resolution of the video.

Within Awake() I set the material to the 4096x2048 one mentioned for the skybox RenderSettings.skybox = material4k;

And then in Update here is the relevant segment

        var texptr = _mediaPlayer.GetTexture(out bool updated);
            if (updated && texptr != IntPtr.Zero)
            {
                Debug.Log("Creating texture ");
                tex = Texture2D.CreateExternalTexture((int)width,
                    (int)height,
                    TextureFormat.RGBA32,
                    false,
                    true,
                    texptr);
                RenderSettings.skybox.mainTexture = tex;
                }
  • Try first to play the file from the disk. The other platforms you mentionned seems to automatically pick the stream size tyat best suits your bandwidth. VLC by itself is able to decode 4k videos (not sure about the 360 part with 4k), but wether it's playing smoothly largely depends on your hardware capabilities – cube45 Jun 14 '20 at 21:05
  • In other words, unless you ask it explicitely to resize the video, there is no reason that libvlc would reduce the size of the video by itself (because that's an expensive operation). However, it might decide to pick the most appropriate stream in a HLS/MPEG-DASH stream, or it might force a resize when your output is constrained (like when displaying directly to a window) there is no reason the unity plugin would do that – cube45 Jun 14 '20 at 21:10
  • Can you share your full logs and code please? What size is your Unity destination texture? – mfkl Jun 15 '20 at 11:24
  • @cube45 that's why I was checking against the youtube video within the VLC desktop app - I could see it definitely have the option to play in a 4k stream within youtube so I thought that might be a better starting test. Not sure why it's doing that so I was hoping to see if there's a way to choose to explicitly define the size as the intended resolution and see what that looked like. – donutsorelse Jun 15 '20 at 15:57
  • @mfkl sure thing. I'll share the relevant code snippet shortly. I've essentially combined the VLC unity asset with the "Interactive 360 Sample Project" from unity to make it play in a skybox and am using the 4096x2048 texture since that should be the resolution of the video. However, since it scales all the way down to 1920x1080 which is not the same dimension ration, one can visualize the change (in addition to the pixelation) with the video not wrapping across the whole skybox. – donutsorelse Jun 15 '20 at 16:01
  • @cube45 regarding your other point of playing from disk, when I just play the video directly in VLC instead of streaming it, it does play at the correct resolution. It's just when I stream it that it shrinks it down. – donutsorelse Jun 15 '20 at 16:06
  • "Also, similar to what was getting discussed in the comments, when I play the video locally instead of streaming, it plays at the full resolution of the video." In VLC Unity? So it works in VLC Unity from a local source? Please share full logs as well – mfkl Jun 16 '20 at 11:27

0 Answers0