-
Notifications
You must be signed in to change notification settings - Fork 775
Possible fix for Raspberry Pi 4 hardware-encoded H.264 streams #1868
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
Please fix spaces in your code. All lines are marked as changed. Although this is not the case. |
|
|
Just for your FYI and to verify I've cloned and compiled fresh from master cd7fa5d The SPS and PPS fix seems to not be enough, I'm still seeing a grey and artifacted image on my RTMP Provider |
|
Please describe in more detail how you test so that I can repeat it myself. |
|
Sure, my current stack looks like follows: A Raspberry PI 4 2GB, various USB Cameras (for testing mainly a Logitech C920 Webcam). Using Go2RTC's API I build up a yml (such das in the example above) and start go2rtc with this. I watch the results on two players:
The deem the result as broken when: api.video only shows a grey / artifacted image and/or when my webrtc preview in the expo app shows nothing I also open a preview in my browser using If you need any more information I'd be happy to provide this |
|
In what browser and on what OS do you open |
|
Firefox (Librewolf) on Mac |
To preface: This PR is very much vibe coded. I don’t have real knowledge of the project internals or Go. The changes are based on trial and error while testing Raspberry Pi 4 hardware encoding with a Logitech MJPEG webcam.
I have no hard feelings when this PR is closed, I know that reviewing code takes time.
This is by no means an ask for merging this, but more of a "hoping" that parts of this code may help the projects or others.
Problem
I am using a Raspberry Pi 4 (64bit) for streaming to a RTMP Provider using different USB Webcams by employing this project and ffmpeg (v7.1.1).
For efficiency reasons I'm trying to use hardware encoding using
h264_v4l2m2m.While the command works, the WebRTC Preview and the image received on the rtmp side is broken, rtmp receives an artifacted grey image, the preview says it's corrupted.
Go2Rtc Config
As an example this is the config I'm using:
Changes
Using codex I've described the problems mentioned above, arriving at the changes presented in this PR.
Transcript from codex:
FLV/RTMP
H.264 pipeline
Result
With the changes included, and a fresh compile for my pi, the ffmpeg command now outputs a working image both in the preview and on my rtmp provider.