Skip to content
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

[Linux] Camera cannot use high resolution with high FPS #3426

Open
itlancer opened this issue Aug 25, 2024 · 2 comments
Open

[Linux] Camera cannot use high resolution with high FPS #3426

itlancer opened this issue Aug 25, 2024 · 2 comments
Labels

Comments

@itlancer
Copy link

Problem Description

Camera cannot use high resolution with high FPS for Linux platform.
May be AIR doesn't work with MJPEG mode and use YUV limited mode.
It cause that AIR cannot be used for real tasks right now if you need camera usage for Linux.

Tested with latest AIR 51.1.1.3 with multiple different Linux x86_64 devices (Ubuntu and Debian), different OS versions, cameras and different applications.
Same issue in all cases.
There is no such issue using non-AIR applications.
There is no such issue with the same devices and cameras but with Windows OS.

Tested with Logitech C270 HD webcam, Prestigio Windows Hello FullHD Camera and many others.
For FullHD cameras
ffmpeg -f v4l2 -list_formats all -i /dev/video0
returns:

[video4linux2,v4l2 @ 0x55b262f57e00] Compressed:       mjpeg :          Motion-JPEG : 1920x1080 320x180 320x240 424x240 640x360 640x480 848x480 960x540 1280x720
[video4linux2,v4l2 @ 0x55b262f57e00] Raw       :     yuyv422 :           YUYV 4:2:2 : 640x480 320x180 320x240 424x240 640x360 848x480 960x540 1280x720 1920x1080

And you can use:
ffplay -f v4l2 -input_format mjpeg -framerate 30 -video_size 1920x1080 -i /dev/video0
to test it with non-AIR apps:

Input #0, video4linux2,v4l2, from '/dev/video0':B sq=    0B f=0/0   
  Duration: N/A, start: 84821.132041, bitrate: N/A
  Stream #0:0: Video: mjpeg (Baseline), yuvj422p(pc, bt470bg/unknown/unknown), 1920x1080, 30 fps, 30 tbr, 1000k tbn

Related issues:
#2699
#2693
#2691
#2687
#2018
#1980
#1895
#1802
#906

Steps to Reproduce

Launch application with code below with any Linux device with connected FullHD (or even HD) camera.
It will try to start camera output with 1920x1080@30 mode.

Application example with sources attached.
linux_camera_high_fps_bug.zip

package {
	import flash.display.Sprite;
	import flash.media.Camera;
	import flash.media.Video;
	
	public class LinuxCameraHighFPSBbug extends Sprite {
		private var cam:Camera;
		
		public function LinuxCameraHighFPSBbug() {
			cam = Camera.getCamera();
			cam.setMode(1920, 1080, 30);
			const vid:Video = new Video();
			vid.width = cam.width;
			vid.height = cam.height;
			vid.attachCamera(cam);
			addChild(vid);
			trace(cam.width, cam.height, cam.fps);
		}
	}
}

Actual Result:
In traces you will see:
1920, 1080, 30
But actually (by eye and events) it looks and works like ~5 FPS.
Also camera output has incorrect color profile. Colors little different when you use the same example and camera for Windows.
Absolutely the same situation when you try to use 720p mode with high FPS.

Expected Result:
AIR application use 1920x1080@30 mode.

Known Workarounds

none
May be write native extension to use camera.

@itlancer itlancer added the Bug label Aug 25, 2024
@itlancer
Copy link
Author

Issue still exists with latest AIR 51.1.1.5.

@itlancer
Copy link
Author

Issue still exists with latest AIR 51.1.2.2.

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