steveseguin / raspberry_ninja

Publish or capture VDO.Ninja streams with Python (Raspberry Pi, Linux, Mac, Windows WSL)
https://raspberry.ninja
149 stars 30 forks source link

Hello,Do you have raspberry 64bit system? #29

Closed Rethen closed 1 year ago

Rethen commented 1 year ago

Hello,Do you have raspberry 64bit system?

steveseguin commented 1 year ago

I think I tried at one point, but ran into numerous issues. 64bit is not really needed I think for the images to work though, since video encoding is pretty low of memory demands. I didn't want to waste too much time on it as a result.

Not sure if you need 64bit for other reasons, but I did provide the installation script I used last year to make the 32 bit images: https://github.com/steveseguin/raspberry_ninja/blob/main/raspberry_pi/installer.sh

If there's a good reason for needing it, I can try to find time to make a 64bit updated image.

Rethen commented 1 year ago

I think I tried at one point, but ran into numerous issues. 64bit is not really needed I think for the images to work though, since video encoding is pretty low of memory demands. I didn't want to waste too much time on it as a result.

Not sure if you need 64bit for other reasons, but I did provide the installation script I used last year to make the 32 bit images: https://github.com/steveseguin/raspberry_ninja/blob/main/raspberry_pi/installer.sh

If there's a good reason for needing it, I can try to find time to make a 64bit updated image.

Because I need to install tflite-runtime and tflite-support, the two cannot be installed on the 32-bit system of the Raspberry Pi, or there are tricky problems after installation

Rethen commented 1 year ago

I think I tried at one point, but ran into numerous issues. 64bit is not really needed I think for the images to work though, since video encoding is pretty low of memory demands. I didn't want to waste too much time on it as a result.

Not sure if you need 64bit for other reasons, but I did provide the installation script I used last year to make the 32 bit images: https://github.com/steveseguin/raspberry_ninja/blob/main/raspberry_pi/installer.sh

If there's a good reason for needing it, I can try to find time to make a 64bit updated image.

If I only need to use GStreamer for RTMP streaming, do I still need such a complicated installation?

Rethen commented 1 year ago

I think I tried at one point, but ran into numerous issues. 64bit is not really needed I think for the images to work though, since video encoding is pretty low of memory demands. I didn't want to waste too much time on it as a result.

Not sure if you need 64bit for other reasons, but I did provide the installation script I used last year to make the 32 bit images: https://github.com/steveseguin/raspberry_ninja/blob/main/raspberry_pi/installer.sh

If there's a good reason for needing it, I can try to find time to make a 64bit updated image.

This website teaches you how to do RTMP streaming on GStreamer

https://qengineering.eu/install-gstreamer-1.18-on-raspberry-pi-4.html

steveseguin commented 1 year ago

This installation is primarily for WebRTC low-latency streaming. If you just need RTMP, you can do something like this:

sudo apt-get install libx264-dev libjpeg-dev
sudo apt-get install libgstreamer1.0-dev \
     libgstreamer-plugins-base1.0-dev \
     libgstreamer-plugins-bad1.0-dev \
     gstreamer1.0-plugins-ugly \
     gstreamer1.0-tools \
     gstreamer1.0-gl \
     gstreamer1.0-gtk3
sudo apt-get install gstreamer1.0-qt5
sudo apt-get install gstreamer1.0-pulseaudio

Then use something like this

gst-launch-1.0 libcamerasrc ! video/x-h264, width=1280, height=720, framerate=30/1 ! flvmux ! rtmpsink location='rtmp://localhost/path/to/stream live=1'
steveseguin commented 1 year ago

I haven't tested it, but that's loosely the idea. You can use ChatGPT probably to customize the command line, if you aren't comfortable with Gstreamer

If you need to build a gstreamer plugin, like some h264 encoder, that's more work, but I'd imagine there's options to get around it.

Raspberry.Ninja does have an RTMP output option that is very simple to use, but it's 32 bit at the moment.

Rethen commented 1 year ago

ok i will try ,Thank you

Rethen commented 1 year ago

Yes, very simple, but sadly there is no 64 bit mirror

Rethen commented 1 year ago

我还没有测试过,但这就是大致的想法。如果您对 Gstreamer 不满意,您可以使用 ChatGPT 来自定义命令行

如果你需要构建一个 gstreamer 插件,比如一些 h264 编码器,那就更麻烦了,但我想有一些选择可以绕过它。

Raspberry.Ninja 确实有一个使用起来非常简单的 RTMP 输出选项,但目前是 32 位的。

我还没有测试过,但这就是大致的想法。如果您对 Gstreamer 不满意,您可以使用 ChatGPT 来自定义命令行

如果你需要构建一个 gstreamer 插件,比如一些 h264 编码器,那就更麻烦了,但我想有一些选择可以绕过它。

Raspberry.Ninja 确实有一个使用起来非常简单的 RTMP 输出选项,但目前是 32 位的。

I don't need to build manually, I install the existing installation package directly

Rethen commented 1 year ago

我还没有测试过,但这就是大致的想法。如果您对 Gstreamer 不满意,您可以使用 ChatGPT 来自定义命令行

如果你需要构建一个 gstreamer 插件,比如一些 h264 编码器,那就更麻烦了,但我想有一些选择可以绕过它。

Raspberry.Ninja 确实有一个使用起来非常简单的 RTMP 输出选项,但目前是 32 位的。

I hope that the 64-bit image can be launched as soon as possible. Maybe many problems have been solved now, because 32-bit has been eliminated by most manufacturers.

steveseguin commented 1 year ago

It takes a few hours for me to build an image, assuming there are no problems. I can try to do it while working today, but if there are issues, I can't offer promises.

Rethen commented 1 year ago

假设没有问题,我需要几个小时来构建图像。我可以在今天工作的时候尝试去做,但如果有问题,我不能承诺。

ok,thanks very much

Rethen commented 1 year ago

erroneous pipeline: could not link libcamerasrc0 to flvmux0, libcamerasrc0 can't handle caps video/x-h264, width=(int)1280, height=(int)720, framerate=(fraction)30/1

I don't konw why, chatgpt can't give me a satisfactory answer

Rethen commented 1 year ago

It takes a few hours for me to build an image, assuming there are no problems. I can try to do it while working today, but if there are issues, I can't offer promises.

Hi,Bro,I succeed build on the Raspberry os 64 bit,it's run's good

steveseguin commented 1 year ago

Awesome! I'm currently building it myself, but I'm glad you've gotten it working.

image

Rethen commented 1 year ago

Awesome! I'm currently building it myself, but I'm glad you've gotten it working.

image

I think it's necessary for 64bit img ,Because I spent a lot of time, including solving some difficult dependency library problems, if it is a direct mirror file, it will be much easier

Rethen commented 1 year ago

Awesome! I'm currently building it myself, but I'm glad you've gotten it working.

image

I had to comment some of the parameters of the audio input for it to work image Otherwise I will get the error

image

Rethen commented 1 year ago

Awesome! I'm currently building it myself, but I'm glad you've gotten it working.

image

This is my GStreamer's version

image

steveseguin commented 1 year ago

That's gstreamer version is a bit old, but if you are just using RTMP and its working, then it's fine.

Rethen commented 1 year ago

That's gstreamer version is a bit old, but if you are just using RTMP and its working, then it's fine.

Hello,Bro ,I have a new Problem, I want to get each frame from the pipeline for tflite object detection, but the Message type I get is None

image

Rethen commented 1 year ago

That's gstreamer version is a bit old, but if you are just using RTMP and its working, then it's fine.

I try run publish.py,but it's also print none

image

image

steveseguin commented 1 year ago

I'm not really sure what this has to do with Raspberry Ninja or how you are trying to approach this.

I published some GPLv3-licensed source code on how to process from Gstreamer into OpenCV/Python some years ago:

Read frames using the appsink element, then converting into raw frames for numpy/cv2/tensorflow: https://github.com/ooblex/ooblex/blob/f974894d8ec0355009615cfab5f654f108862288/code/decoder.py#L84

This is how the appsink element is used https://github.com/ooblex/ooblex/blob/f974894d8ec0355009615cfab5f654f108862288/code/decoder.py#L141

I can't help you develop your project, as I have my own work to do, but everything you need is there I think.

steveseguin commented 1 year ago

If you have a request for me to add something to Raspberry Ninja, or are willing to contribute to the code base, I'd be more able to find time to help.

steveseguin commented 1 year ago

I tried building 64bit, and while I was able to build it, none of the hardware accelerators are working. The 64bit version is still too niche, and driver support is still lacking. I'm not going to spend anymore time on it at the moment, since without the hardware acceleration, performance is pretty poor.

updated: I've updated the installer for Bullseye 32bit and put out a new release. It supports Libcamera, SRT, and many Arducam/Sony sensors with little config needed. 64-bit support might be still missing, but until I get hardware driver support working for it, I won't support it.

steveseguin commented 1 year ago

https://drive.google.com/file/d/1vWkznU544qkRsal1GyIj4YZ-O2pNFCfh/view?usp=drive_link

I have a 64bit pre-build hosted version up now, and the installer.sh for the rpi is now configured to work with the 64bit bullseye image.

The hardware encoder seems stable now with the 64 bit version.

Closing.