buresu / ndi-python

NewTek NDI Python wrapper
MIT License
133 stars 30 forks source link

How could I get the whole video from a ndi resource? #14

Open guCiel opened 2 years ago

guCiel commented 2 years ago

According to your example, i can get image by recv_capture ,but it depends on how the while circulation fast. if a ndi resource is playing a video, how can I get a while video to save as v1.mov in local file.

Thank you for everything.

buresu commented 2 years ago

Hi, are you using cv2.VideoWriter for video encoding? cv2.VideoWriter connot respect a time due to frame based. I added example for recieving with PyAV. Please see ec6bf446bb360dee0511434a8d3fdff0b5cbfab8

guCiel commented 2 years ago

it may really work for me, but my av package can not import like open method... maybe i use the wrong version. I will try it again, Thanks a lot.

buresu commented 2 years ago

Thank you for trying it. I tried it in the following environment.

Windows11 x64
Python 3.10.4
ndi-python 5.1.1.1
PyAV 9.0.2

pip install ndi-python av
python recv_av.py

I hope to help you.