-
-
Notifications
You must be signed in to change notification settings - Fork 595
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
WIP - Attempt to add av1 support #235
base: master
Are you sure you want to change the base?
Conversation
Thank you for your conttribution. I tried it, same result. No error, just no video. |
Fixes #49. |
For some reason Chrome doesn't detect the codec despite definitely supporting AV1 decoding. Nothing telling show up in console, chrome://webrtc-internals/, or chrome://media-internals/. Testing via `docker-compose up`.
fe6b9ea
to
da1eb21
Compare
Not sure how I missed that issue! Just force pushed up a change to use rav1enc instead of svt1enc and now chrome://webrtc-internals/ is actually showing video data transmitting, but it still can't detect the decoder implementation to use. Using the gst-launch-1.0 tool, rav1enc seems a little slower than svt1enc but at least something is transmitting now. |
FYI went through the painstaking process of upgrading to gstreamer 1.22 to test and see if the AV1 video codec support improvements would solve the decoder detection problem, but ended up getting the same results :( Fortunately bookworm had most of the packages ready for testing 1.22. See https://gist.github.com/Dishwasha/8d43e375719b7c4ed155b6795f6cae2b. |
@Dishwasha i tried your image but it fails with this error:
Do you have any idea what it can be? Does it work for you? |
This is based off of bookworm which is still unstable so packages are constantly in flux. I wouldn't expect things to work consistently for more than a few days or a week. Fortunately once bookworm is released later this year, upgrading neko to it will allow for a more recent gstreamer and is probably a worthwhile upgrade. The main point of this exercise was to validate that using an older version of gstreamer ISN'T the reason the browser can't seem to detect what codec to use to decode the AV1 video stream. I wish I knew more about why it isn't working, but I'm hoping somebody with more experience in this realm takes an interest. |
So a small update. I've discovered Chrome won't choose to decode AV1 without the SVC Extension for WebRTC enabled and the recently released Chrome 113. https://groups.google.com/g/discuss-webrtc/c/-QQ3pxrl-fw?pli=1 mentions needing scalabilityMode and a scaleResolutionDownBy specified. I tested this out using PeerJS strictly between two Chrome browsers and when I set I don't have time to hack on it at the moment, but we should be able to get similar results with Pion WebRTC by following the example https://github.com/cretz/webrtc/blob/simulcast-hack/examples/simulcast-hack/main.go. * Also see the simulcast-playground example and this pion fiddle which is just missing the scalabilityMode. |
You should not need this extension for AV1. I used and decoded AV1 in galene ( https://github.com/jech/galene/blob/06a0a2c36e4686f7e1bcb09e0123173586bbbd2a/codecs/codecs.go#L48 ) My problem was, that I received av1 packages, but the gstreamer encoder was not fast enough for realtime on my hardware. I will try some different encoder soonish. |
So I tested this AV1 configuration out by screencasting 1080p from the Neko Chrome container to Chrome on another computer, so the hardware I'm using is definitely capable of real-time encoding (CPU barely used). Chrome uses libaom, so perhaps that would be the better encoder to try. |
The news is that libaom or rav1e are slower than svt-av1 recently. |
Small update. Gstreamer now supports nvav1enc in main branch but not yet part of releases. I've got AV1 Nvidia hardware offloading working in games-on-whales/wolf#98, but using the same settings in neko, I still can't get chrome to recognize the AV1 codec though it's successfully sending continuous bytes. |
I had to rebuild https://github.com/selkies-project/selkies-gstreamer/blob/main/addons/gstreamer/Dockerfile from gstreamer main branch before gst-py-example would work, but it totally does thanks! |
For some reason Chrome doesn't detect the codec despite definitely supporting AV1 decoding. Nothing telling show up in console, chrome://webrtc-internals/, or chrome://media-internals/. Testing via
docker-compose up
.