bluenviron / mediamtx

Ready-to-use SRT / WebRTC / RTSP / RTMP / LL-HLS media server and media proxy that allows to read, publish, proxy, record and playback video and audio streams.
MIT License
11.64k stars 1.47k forks source link

[Raspberry Pi] exec format error after building from source #1457

Closed azsde closed 1 year ago

azsde commented 1 year ago

Which version are you using?

master (from git)

Which operating system are you using?

Describe the issue

After following the steps to compile rtsp-simple-server and uploading the binary to my raspberry pi, i get the following error:

2023/02/07 19:05:58 INF [path cam] [rpicamera source] ERR: fork/exec /dev/shm/rtspss-embeddedexe-1675793158294883745: exec format error

Describe how to replicate the issue

  1. Clone the repo and follow the steps to build for a raspberry pi
  2. Edit the configuration to use the rpi camera
  3. Start the server

Did you attach the server logs?

yes

2023/02/07 19:05:58 INF rtsp-simple-server v0.21.2-13-g50a3d33
2023/02/07 19:05:58 INF [path cam] [rpicamera source] started
2023/02/07 19:05:58 INF [RTSP] listener opened on :8554 (TCP), :8000 (UDP/RTP), :8001 (UDP/RTCP)
2023/02/07 19:05:58 INF [RTMP] listener opened on :1935
2023/02/07 19:05:58 INF [HLS] listener opened on :8888
2023/02/07 19:05:58 INF [WebRTC] listener opened on :8889 (HTTP)
2023/02/07 19:05:58 INF [path cam] [rpicamera source] ERR: fork/exec /dev/shm/rtspss-embeddedexe-1675793158294883745: exec format error

Did you attach a network dump?

no

azsde commented 1 year ago

For some reason, following the steps:

cd internal/rpicamera/exe
make
cd ../../../
go run -tags rpicamera .

And then

make binaries

result in a binary that doesn't work on a RPi 3b+.

However, skipping the rpi exe part and running make binaries works. Maybe I misunderstood the readme ?

Anyway it works now :)

aler9 commented 1 year ago

Hello, instructions in the README are meant for compiling, not for cross-compiling. You're trying to cross-compile, i.e. you're trying to build a binary for the Raspberry Pi on a amd64 machine. In order to compile the server, you have to perform the operation on a Raspberry Pi. If you want to cross compile, you can use Docker (make binaries) or you have to manually setup a gcc instance for cross-compiling.

github-actions[bot] commented 1 year ago

This issue is being locked automatically because it has been closed for more than 6 months. Please open a new issue in case you encounter a similar problem.