Skip to content

[Windows][Linux] 4K camera resolution output with delay #3822

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
itlancer opened this issue May 26, 2025 · 0 comments
Open

[Windows][Linux] 4K camera resolution output with delay #3822

itlancer opened this issue May 26, 2025 · 0 comments
Labels

Comments

@itlancer
Copy link

Problem Description

Cameras with 4K resolution cause video output with delay in 1-2 seconds. I mean you can make your hand movement in front of camera but you will see it at camera output only after 1-2 seconds.

Tested with multiple AIR versions, even with latest AIR 51.2.1.4 and AIR 51.2.1.3 with multiple different devices, different platforms, OS versions with different applications.
Issue doesn't exists with FullHD or lower resolution.
Tested with Video and VideoTexture.
The same issue in all cases using Windows and Linux.
Cannot check with Android because of #2691
Didn't tested with macOS.

Tested with Prestigio Solutions 13MP Cam https://prestigio-solutions.com/product/13mp-uhd-camera-prestigio-solutions-pvccu13m201
With ffmpeg/ffplay everything fine using the same environment and:
ffplay -f v4l2 -input_format mjpeg -framerate 30 -video_size 3840x2160 -i /dev/video0

Related issues:
#2699
#2693
#2691
#2687
#1980
#1895
#1802
#307

Steps to Reproduce

Launch application with code below with connected 4K camera. It will output camera view.
Make your hand movement in front of camera.

Application example with sources and Scout log attached.
camera_4k_delay.zip

package {
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.media.Camera;
	import flash.media.Video;
	import flash.events.PermissionEvent;
	import flash.permissions.PermissionStatus;
	
	public class Camera4KDelay extends Sprite {
		private var video:Video;
		private var camera:Camera;
		
		public function Camera4KDelay() {
			addEventListener(Event.ADDED_TO_STAGE, init);
		}
		
		private function init(e:Event):void {
			removeEventListener(Event.ADDED_TO_STAGE, init);
			
			camera = Camera.getCamera();
			if (Camera.permissionStatus != PermissionStatus.GRANTED){
				if (camera != null){
					camera.addEventListener(PermissionEvent.PERMISSION_STATUS, cameraPermissionStatusChanged);
					camera.requestPermission();
				}
			} else {
				permissionGranted();
			}
		}
		
		private function cameraPermissionStatusChanged(e:PermissionEvent):void {
			if (e.status == PermissionStatus.GRANTED){
				permissionGranted();
			}
		}
		
		private function permissionGranted():void {
			camera.setMode(3840, 2160, 30);
			trace(camera.width + "x" + camera.height, camera.fps);//3840x2160 30
			
			video = new Video(640, 480);
			video.attachCamera(camera);
			addChild(video);
		}
	}
}

Actual Result:
You will see your hand movement at camera output only after 1-2 seconds.

Expected Result:
You will see your hand movement at camera output in real time without delay.

Known Workarounds

none
*write your own native extension to use camera

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant