ndi-python icon indicating copy to clipboard operation
ndi-python copied to clipboard

Can't receive frames being sent

Open Nimisha-Pabbichetty opened this issue 2 years ago • 9 comments

Hi! I'm sending video frames using send_video.py and trying to receive them using either recv.py or recv_cv.py. On the sending side, it is printed that frames are being sent like this:

image

But on the receiving side, it is only showing 'Looking for sources' when running both files like this: image

What should I do?

Nimisha-Pabbichetty avatar Apr 22 '22 13:04 Nimisha-Pabbichetty

Hi, Thank you for reporting. I confirmed same problem on ubuntu 22.04, but on Arch Linux, I didn't have any problems. This problem seems to be related on avahi, but the solution is not yet known. I will continue to find the solution.

buresu avatar Apr 22 '22 17:04 buresu

Thank you for your prompt response. Can you let me know if this issue exists on Windows? Also could you clarify if there are any differences to setting up this repo on windows when compared to ubuntu?

Nimisha-Pabbichetty avatar Apr 24 '22 06:04 Nimisha-Pabbichetty

Yes, it works fine on windows. The setup step is almost the same.

# install ndi-python
pip install ndi-python

# run examples
git clone --recursive https://github.com/buresu/ndi-python.git
cd ndi-python/example
pip install -r requirements.txt
python find.py

But ubuntu needs avahi daemon to search for ndi sources, you need to install avahi.

sudo apt install avahi-daemon
sudo systemctl enable --now avahi-daemon

buresu avatar Apr 26 '22 07:04 buresu

Ah okay thanks!

Nimisha-Pabbichetty avatar Apr 26 '22 09:04 Nimisha-Pabbichetty

Update: Curiously, it works fine in my current environment.

Ubuntu 22.04 LTS
Anaconda 4.12.0
Python 3.10.4
ndi-python 5.1.1.2
avahi-daemon 0.8

You can use avahi-discover to make sure that it is working properly.

sudo apt install avahi-discover
avahi-discover

Screenshot_20220522_200640

buresu avatar May 22 '22 11:05 buresu

Interesting, I'll try to match your setup and see if it works.

Nimisha-Pabbichetty avatar May 23 '22 04:05 Nimisha-Pabbichetty

Hi There,

For what its worth im having similar issues on rocky 8.6 - although not quite the same - i can usually discover sources both locally and on the network, sometimes i cant, and so far ive not been able to get a picture out of this machine to either a local monitor or a monitor on the network (windows or linux). Still investigating...

Cheers!

tgentry1986 avatar Jun 01 '22 22:06 tgentry1986

@buresu I migrated to Windows and it works fine there. I do have a different issue though. I'm transmitting frames of the format 'FOURCC_VIDEO_TYPE_UYVY' but I am only able to receive them in 'RECV_COLOR_FORMAT_BGRX_BGRA' format. The other formats throw an error like this when I try to visualise them:

image

Nimisha-Pabbichetty avatar Jun 29 '22 07:06 Nimisha-Pabbichetty

@Nimisha-Pabbichetty cv.imshow() is not support uyvy format. If you want to get it in uyvy format, you have to convert it yourself.

You can change the following lines.

ndi_recv_create.color_format = ndi.RECV_COLOR_FORMAT_BGRX_BGRA
to
ndi_recv_create.color_format = ndi.RECV_COLOR_FORMAT_FASTEST

and

frame = np.copy(v.data)
to
frame = cv.cvtColor(v.data, cv.COLOR_YUV2BGR_UYVY)

buresu avatar Jul 05 '22 10:07 buresu