nicotyze / Webrtc-H264Capturer

Workarounds to use external H.264 video encoders in WebRTC Native C++ source code
GNU Lesser General Public License v3.0
124 stars 37 forks source link

Raspberry pi cross compilation #1

Closed Nolaan closed 6 years ago

Nolaan commented 7 years ago

Hello, Thanks for the instructions, however when I try to recompile ffmpeg with omx_rpi support I cannot link it. Even when I add -lrt... Any guess?

../../third_party/llvm-build/Release+Asserts/bin/clang++ -Wl,--fatal-warnings -fPIC -Wl,-z,noexecstack -Wl,-z,now -Wl,-z,relro -Wl,-z,defs -fuse-ld=gold -B../../third_party/binutils/Linux_x64/Release/bin -Wl,--icf=all -pthread --target=arm-linux-gnueabihf --sysroot=../../build/linux/debian_wheezy_arm-sysroot -L/home/clawmachine/libwebrtc_nicotyze/Webrtc-H264Capturer/webrtc-checkout/src/build/linux/debian_wheezy_arm-sysroot/lib/arm-linux-gnueabihf -Wl,-rpath-link=/home/clawmachine/libwebrtc_nicotyze/Webrtc-H264Capturer/webrtc-checkout/src/build/linux/debian_wheezy_arm-sysroot/lib/arm-linux-gnueabihf -L/home/clawmachine/libwebrtc_nicotyze/Webrtc-H264Capturer/webrtc-checkout/src/build/linux/debian_wheezy_arm-sysroot/usr/lib/arm-linux-gnueabihf -Wl,-rpath-link=/home/clawmachine/libwebrtc_nicotyze/Webrtc-H264Capturer/webrtc-checkout/src/build/linux/debian_wheezy_arm-sysroot/usr/lib/arm-linux-gnueabihf -Wl,-rpath-link=../Rpi2 -Wl,--disable-new-dtags -Wl,-rpath=\$ORIGIN/. -Wl,-rpath-link=. -Wl,--export-dynamic -L../../build/linux/debian_wheezy_arm-sysroot/usr/lib/arm-linux-gnueabihf -o "./peerconnection_client" -Wl,--start-group @"./peerconnection_client.rsp" ./libprotobuf_lite.so ./libboringssl.so ./libavcodec.so ./libavformat.so ./libavutil.so ./libswscale.so -Wl,--end-group -lX11 -lXcomposite -lXext -lXrender -ldl -lgmodule-2.0 -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgthread-2.0 -lm -lexpat -Wl,--no-as-needed -lrt -lglib-2.0

nicotyze commented 7 years ago

Hello,

I'm not able to tell you from where is coming the linking error but I'm wondering to what extent the hardware codec is needed. From my side, I've adapted further the source code (no more gtk interface) in order to make it run on an arm (marvell) based video encoding platform. For my application I don't need this peerconnection_client to receive (and display), thus in this case, ffmpeg just performs elementary stream parsing (+RTSP or MPEG demux) => no need of HW acceleration. If you need to display the webrtc received video stream, the h.264 decoder will be used but knowing that the pixels are then processed on the CPU (e.g. YUV to RGB conversion), I don't thing that you will take advantages of the HW decoding (assuming that omx decoding is supported in ffmpeg. As far as I know omx is only supported for the encoding in ffmpeg).

I hope this helps...

Nicolas

2017-02-14 21:31 GMT+01:00 Nolaan notifications@github.com:

Hello, Thanks for the instructions, however when I try to recompile ffmpeg with omx_rpi support I cannot link it.

../../third_party/llvm-build/Release+Asserts/bin/clang++ -Wl,--fatal-warnings -fPIC -Wl,-z,noexecstack -Wl,-z,now -Wl,-z,relro -Wl,-z,defs -fuse-ld=gold -B../../third_party/binutils/Linux_x64/Release/bin -Wl,--icf=all -pthread --target=arm-linux-gnueabihf --sysroot=../../build/linux/debian_wheezy_arm-sysroot -L/home/clawmachine/libwebrtc_nicotyze/Webrtc-H264Capturer/ webrtc-checkout/src/build/linux/debian_wheezy_arm-sysroot/lib/arm-linux-gnueabihf -Wl,-rpath-link=/home/clawmachine/libwebrtc_nicotyze/Webrtc-H264Capturer/ webrtc-checkout/src/build/linux/debian_wheezy_arm-sysroot/lib/arm-linux-gnueabihf -L/home/clawmachine/libwebrtc_nicotyze/Webrtc-H264Capturer/ webrtc-checkout/src/build/linux/debian_wheezy_arm- sysroot/usr/lib/arm-linux-gnueabihf -Wl,-rpath-link=/home/ clawmachine/libwebrtc_nicotyze/Webrtc-H264Capturer/ webrtc-checkout/src/build/linux/debian_wheezyarm- sysroot/usr/lib/arm-linux-gnueabihf -Wl,-rpath-link=../Rpi2 -Wl,--disable-new-dtags -Wl,-rpath=$ORIGIN/. -Wl,-rpath-link=. -Wl,--export-dynamic -L../../build/linux/debian wheezy_arm-sysroot/usr/lib/arm-linux-gnueabihf -o "./peerconnection_client" -Wl,--start-group @"./peerconnection_client.rsp" ./libprotobuf_lite.so ./libboringssl.so ./libavcodec.so ./libavformat.so ./libavutil.so ./libswscale.so -Wl,--end-group -lX11 -lXcomposite -lXext -lXrender -ldl -lgmodule-2.0 -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgthread-2.0 -lm -lexpat -Wl,--no-as-needed -lrt -lglib-2.0

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/nicotyze/Webrtc-H264Capturer/issues/1, or mute the thread https://github.com/notifications/unsubscribe-auth/AMCbnpSRbBJnVUcKd1czdV8AJ_-9YpYGks5rcg8tgaJpZM4MA9Xi .

Nolaan commented 7 years ago

Hi, I guess I'm trying to something like you. Taking advantage of the hardware encoder on the raspberry pi + raspicam allows me to stream <500ms latency videos over the internet. My error was due to the fact that I couldn't cross compile ffmpeg. Using target compiled .so lead me to this error because of mismatching glib versions. Now I can cross compile and the error went away.

I will just try to see how this setup can work with your work.

nicotyze commented 7 years ago

Hi, Indeed, we are doing the same kind of experiments. From my side, I use my own buildroot sysroot and toolchain (not the default debian_wheezy_arm) and it works pretty well. FYI, I've just committed a new version with a few improvement related to the H.264 NALU parsing before RTP packetization.

2017-02-17 12:08 GMT+01:00 Nolaan notifications@github.com:

Hi, I guess I'm trying to something like you. Taking advantage of the hardware encoder on the raspberry pi + raspicam allows me to stream <500ms latency videos over the internet. My error was due to the fact that I couldn't cross compile ffmpeg. Using target compiled .so lead me to this error because of mismatching glib versions. Now I can cross compile and the error went away.

I will just try to see how this setup can work with your work.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/nicotyze/Webrtc-H264Capturer/issues/1#issuecomment-280622246, or mute the thread https://github.com/notifications/unsubscribe-auth/AMCbnqtNyk2LwvMJH9SUJ80AqAKnhiNtks5rdX-mgaJpZM4MA9Xi .