rgb数据流转为h265,从windows传输到Ubuntu18

发布时间 2023-09-16 16:24:30作者: YueQAQ

To continuously convert an RGB data stream to H.265 and transmit it to an ARM machine running Ubuntu 18, you can use FFmpeg in combination with a network streaming protocol like RTP or RTSP. Here's a general outline of the steps involved:

  1. Install FFmpeg on both the Windows machine and the Ubuntu 18 ARM machine. Make sure FFmpeg is added to the system's PATH environment variable on both systems.

  2. On the Windows machine, use FFmpeg to capture the RGB data stream and encode it to H.265. You can use the following command:2.

ffmpeg -f rawvideo -pix_fmt rgb24 -s <width>x<height> -r <framerate> -i - -c:v libx265 -preset ultrafast -tune zerolatency -f rtsp rtsp://<ubuntu_ip>:<port>/<stream_name>

Replace and with the dimensions of your RGB data stream, with the desired frame rate, <ubuntu_ip> with the IP address of the Ubuntu 18 ARM machine, with the desired port number, and <stream_name> with a name for the stream.

  1. On the Ubuntu 18 ARM machine, use FFmpeg to receive the RTSP stream and decode it. You can use the following command:
ffmpeg -rtsp_transport tcp -i rtsp://<windows_ip>:<port>/<stream_name> -c:v rawvideo -pix_fmt rgb24 -f rawvideo -

Replace <windows_ip> with the IP address of the Windows machine and and <stream_name> with the same values used in the previous step.

You can then process the decoded RGB data on the Ubuntu 18 ARM machine as needed.

Please note that this is a general outline, and you may need to adjust the commands based on your specific requirements and network setup. Additionally, ensure that the necessary network ports are open and accessible between the Windows machine and the Ubuntu 18 ARM machine.

Remember to handle any exceptions that may occur during the execution of the FFmpeg commands and to check the return codes to ensure the streaming and decoding processes are successful.

https://trac.ffmpeg.org/wiki/StreamingGuide