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

YUV420p->RGBA conversion is broken #415

Closed
okkobroderson opened this issue Feb 21, 2024 · 11 comments
Closed

YUV420p->RGBA conversion is broken #415

okkobroderson opened this issue Feb 21, 2024 · 11 comments

Comments

@okkobroderson
Copy link

Detail

well, i connected my android13 phone via droidcam to my linux laptop.
as it works with stopmotion application, i expected the same with pix_video.
unfortunately there seems to be some issues, because the output of pix_video is garbage. the device is available, the connection is made...

hope i was clear:)
greetings

Gem Version

v09.4

Pd Version

plugdata 0.7.1

Operating System

Linux

OS Version

xubuntu 22.4.3

Which CPU are you using?

amd64/x86_64 ("64bit Intel")

@umlaeute
Copy link
Owner

hmm.
no, you were not very clear.

  • try again with Pd-vanilla
  • check other video devices (a "real" webcam)
  • show us your "garbage" (there are many different levels of "garbage", i have no idea whether you get static, a half-broken feed or scrambled colors)
  • give us the configuration of the videodevice (v4l2-ctl --all -d /dev/videoX)

@umlaeute
Copy link
Owner

also, the exact version of droidcam might be useful

@okkobroderson
Copy link
Author

okkobroderson commented Feb 21, 2024

ok, thanks for answering!
here we go...

a screenrecording of the "garbage":)
https://github.com/umlaeute/Gem/assets/79641361/c39ca6c2-967d-4cf8-8664-eebd16697dc8
edit: seems the videupload failed?

the same result in pd-vanilla

droidcam client 2.1.2

other webcams (internal, usb) are working.

~$ v4l2-ctl --all -d /dev/video3
Driver Info:
	Driver name      : v4l2 loopback
	Card type        : Dummy video device (0x0000)
	Bus info         : platform:v4l2loopback-000
	Driver version   : 6.5.8
	Capabilities     : 0x85200003
		Video Capture
		Video Output
		Read/Write
		Streaming
		Extended Pix Format
		Device Capabilities
	Device Caps      : 0x05200003
		Video Capture
		Video Output
		Read/Write
		Streaming
		Extended Pix Format
Priority: 2
Video input : 0 (loopback: ok)
Video output: 0 (loopback in)
Format Video Capture:
	Width/Height      : 640/480
	Pixel Format      : 'YU12' (Planar YUV 4:2:0)
	Field             : None
	Bytes per Line    : 640
	Size Image        : 460800
	Colorspace        : sRGB
	Transfer Function : Default (maps to sRGB)
	YCbCr/HSV Encoding: Default (maps to ITU-R 601)
	Quantization      : Default (maps to Limited Range)
	Flags             : 
Format Video Output:
	Width/Height      : 640/480
	Pixel Format      : 'YU12' (Planar YUV 4:2:0)
	Field             : None
	Bytes per Line    : 640
	Size Image        : 460800
	Colorspace        : sRGB
	Transfer Function : Default (maps to sRGB)
	YCbCr/HSV Encoding: Default (maps to ITU-R 601)
	Quantization      : Default (maps to Limited Range)
	Flags             : 
Streaming Parameters Video Capture:
	Frames per second: 30.000 (30/1)
	Read buffers     : 2
Streaming Parameters Video Output:
	Frames per second: 30.000 (30/1)
	Write buffers    : 2

User Controls

                    keep_format 0x0098f900 (bool)   : default=0 value=1
              sustain_framerate 0x0098f901 (bool)   : default=0 value=0
                        timeout 0x0098f902 (int)    : min=0 max=100000 step=1 default=0 value=0
               timeout_image_io 0x0098f903 (bool)   : default=0 value=0

@umlaeute
Copy link
Owner

I cannot reproduce the problem with Gem-0.94 (e.g. as packaged in Debian, and thus (x)Xubuntu).

however, i can reproduce the problem with current git (c6eff7f).
there's a reason why i ask for the (exact) Gem version :-)

@umlaeute
Copy link
Owner

i've recently updated the color-conversions, and obviously broke the I420->RGBA conversion.

until this is fixed, you should be able to get a working video feed by sending a [colorspace yuv( message to [pix_video] before opening the device.

@umlaeute umlaeute changed the title pix_video, droidcam, xubuntu 22.4 I420toRGBA conversion is broken Feb 21, 2024
@umlaeute umlaeute changed the title I420toRGBA conversion is broken YUV420p->RGBA conversion is broken Feb 21, 2024
@okkobroderson
Copy link
Author

the [colorspace yuv] message does the job!

i swear, i would have given you the exact gem version, if i knew where to read it!:)

thank you very much for your help!
greetings

@umlaeute
Copy link
Owner

i swear, i would have given you the exact gem version, if i knew where to read it!:)

well, the bug-reporting template spells it:

What is the exact version of Gem you are using (as printed in the Pd-console)?

the Pd-console should say something like this (when loading Gem):

GEM: Graphics Environment for Multimedia
GEM: ver: 0.94.git v0.94-845-g4f88c7ac9

@okkobroderson
Copy link
Author

the console here says:
GEM: Graphics Environment for Multimedia
GEM: ver: 0.94.
GEM: compiled on Feb 5 2024

in both plugdata and pd-vanilla

@umlaeute
Copy link
Owner

Interesting.
How did you get/compile Gem?

@okkobroderson
Copy link
Author

i guess not in the most recommended way...
some mixture of from within pd/plugdata and from the repository.

i encountered lots of crashes/freezes in the beginning, so i tried this and that

@Ant1r

This comment was marked as off-topic.

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

No branches or pull requests

3 participants