Adobe-Runtime-Support
Adobe-Runtime-Support copied to clipboard
[Windows][Linux] 4K camera resolution output with delay
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 https://github.com/airsdk/Adobe-Runtime-Support/issues/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: https://github.com/airsdk/Adobe-Runtime-Support/issues/2699 https://github.com/airsdk/Adobe-Runtime-Support/issues/2693 https://github.com/airsdk/Adobe-Runtime-Support/issues/2691 https://github.com/airsdk/Adobe-Runtime-Support/issues/2687 https://github.com/airsdk/Adobe-Runtime-Support/issues/1980 https://github.com/airsdk/Adobe-Runtime-Support/issues/1895 https://github.com/airsdk/Adobe-Runtime-Support/issues/1802 https://github.com/airsdk/Adobe-Runtime-Support/issues/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