Adobe-Runtime-Support icon indicating copy to clipboard operation
Adobe-Runtime-Support copied to clipboard

StageVideo doesn't support 8192 pixels or more for width/height

Open itlancer opened this issue 2 years ago • 1 comments

Problem Description

StageVideo doesn't support 8192 pixels or more for viewPort width/height properties. It just throw exception when you try to set up 8192 pixels or more for viewPort width/height properties. So you cannot use 8K+ resolution videos for big videowalls. Video usage cause bad performance. https://github.com/airsdk/Adobe-Runtime-Support/issues/2162 VideoTexture not support even 8K textures. https://github.com/airsdk/Adobe-Runtime-Support/issues/196

Tested with latest multiple AIR versions even with latest AIR 50.0.0.3 with multiple Windows devices.

Reference says that valid range up to 8191 only for x/y viewPort properties, not width/height. https://airsdk.dev/reference/actionscript/3.0/flash/media/StageVideo.html#viewPort

Related issues: https://github.com/airsdk/Adobe-Runtime-Support/issues/2163 https://github.com/airsdk/Adobe-Runtime-Support/issues/2162 https://github.com/airsdk/Adobe-Runtime-Support/issues/196

Steps to Reproduce

Launch code below. Application try to start video playback via StageVideo with 8192x4096 size. Application example with sources and video sample attached. stagevideo_8K_bug.zip

package {
	import flash.display.Sprite;
	import flash.events.NetStatusEvent;
	import flash.net.NetStream;
	import flash.net.NetConnection;
	import flash.media.StageVideo;
	import flash.geom.Rectangle;
	
	public class StageVideo8KBug extends Sprite {
		private var nc:NetConnection;
		private var ns:NetStream;
		
		public function StageVideo8KBug() {
			nc = new NetConnection();
			nc.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
			nc.connect(null);
		}
		
		private function netStatusHandler(event:NetStatusEvent):void {
			trace(event.info.code);
			switch (event.info.code){
				case "NetConnection.Connect.Success":
					ns = new NetStream(nc);
					ns.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
					ns.client = {onMetaData:getMeta};
					
					var sv:StageVideo = stage.stageVideos[0];
					sv.viewPort = new Rectangle(0, 0, 8192, 4096);//This line cause RangeError: Error #2006: The supplied index is out of bounds.
					sv.attachNetStream(ns);
					ns.play("neon.mp4");
					break;
				case "NetStream.Play.Stop":
					ns.play("neon.mp4");
					break;
				case "NetStream.Play.StreamNotFound":
					trace("Stream not found");
					break;
				default:
					break;
			}
		}

		private function getMeta(mdata:Object):void {
			trace("metadata");
		}
	}
}

Actual Result: Exception will be throwed:

RangeError: Error #2006: The supplied index is out of bounds.
	at flash.media::StageVideo/set viewPort()
	at StageVideo8KBug/netStatusHandler()[stagevideo_8K_bug\StageVideo8KBug.as:28]
	at flash.net::NetConnection/connect()
	at StageVideo8KBug()[stagevideo_8K_bug\StageVideo8KBug.as:16]

Expected Result: Video will be played via StageVideo for 8192x4096 size.

Known Workarounds

none Write own native extensions to video playback but it cannot be used with DisplayList or combined with Stage3D layers.

itlancer avatar Nov 22 '22 22:11 itlancer

Works as expected with AIR 51.0.0.2. Thanks! Waiting for fixes: https://github.com/airsdk/Adobe-Runtime-Support/issues/3083 https://github.com/airsdk/Adobe-Runtime-Support/issues/3084 and production release to close this feature request as completed.

Anyway trying to playback MP4 H.264 files with resolution 7560*3840 or higher still have a lot of issues (even using new multimedia APIs FileSource/Pipeline): https://github.com/airsdk/Adobe-Runtime-Support/issues/2163 https://github.com/airsdk/Adobe-Runtime-Support/issues/2162 https://github.com/airsdk/Adobe-Runtime-Support/issues/2503 https://github.com/airsdk/Adobe-Runtime-Support/issues/524 https://github.com/airsdk/Adobe-Runtime-Support/issues/646 https://github.com/airsdk/Adobe-Runtime-Support/issues/2159

itlancer avatar Feb 24 '24 14:02 itlancer

Fixed. Tested with AIR 51.0.1.5. But still a lot of issues around video performance/limitations mentioned above. And with DirectX/maxD3D https://github.com/airsdk/Adobe-Runtime-Support/issues/2708#issuecomment-2228898406

itlancer avatar Jul 29 '24 22:07 itlancer