tdiguy 99 Posted June 11, 2017 Author Posted June 11, 2017 (edited) Well I think hardware acceleration is working, it no longer gives me just a black screen when i use omx hardware acceleration. I havent done any real measurements to run a good comparison but i would say transcoding is marginally better. I still see studdering gpu mem is set to 256, put thread count to max and turned off throttling. It cpu is not maxed out not really sure what i can do to get this to use more cpu to transcode better its hovering around 30-35% I would imagine if it would use 50% or so maybe it would have better performance. On the bright side it seems like transcoding while recording works a lot better now. The system did not become unresponsive during the last recording. Edited June 12, 2017 by tdiguy
tdiguy 99 Posted June 12, 2017 Author Posted June 12, 2017 On another note, mp2 playback / transcoding while it seems to really be very cpu intensive once it is recorded to mp4 its very easy on the pi for web playback which it also has to transcode. I am curious as to why, I assume i dont have something set up correctly since i have a license for mp2 hardware acceleration. I assume its simply not being used.
Luke 42077 Posted June 12, 2017 Posted June 12, 2017 by mp2 i assume you mean mpeg2, yes transcoding that can be very costly for sure. we will have to look into whether or not there is a way to allow ffmpeg to use the built in hardware decoder. Thanks !
tdiguy 99 Posted June 12, 2017 Author Posted June 12, 2017 Excellent, if I remember correctly raspberry org sells the lic to unlock hardware acceleration for something like 2$. You will likely need that to test anything if you have a pi to test with. Sent from my SM-G900P using Tapatalk
tdiguy 99 Posted June 12, 2017 Author Posted June 12, 2017 Or if you have simple instructions I can test it. Sent from my SM-G900P using Tapatalk
tdiguy 99 Posted June 12, 2017 Author Posted June 12, 2017 Yes, I think that is what is allowing the MP4 hardware acceleration. I might simply not have the right configuration set up to enable mpeg2 I know I have the option unlocked in the pi though. Sent from my SM-G900P using Tapatalk
lakano 0 Posted August 22, 2017 Posted August 22, 2017 Hi ! Could you please share some lines of your /boot/config.txt about cpu/gpu/ram please ? I have a Pi2 too, with licences correctly installed, and ffmpeg with openmax supported, but I don't see any changes (cpu > 99% for each video) Regards,
tdiguy 99 Posted August 22, 2017 Author Posted August 22, 2017 I havent gotten it working for mpeg2 hardware acceleration. I am not really sure what else to try on this front but one thing i had also turned on with the ffmpeg config was libx264 and my gpu mem is set for 128 it doesnt need much it seems. I don't know if its just not implemented in ffmpeg or if there is a switch that emby does not utilize. I wish i knew honestly.
tdiguy 99 Posted September 25, 2017 Author Posted September 25, 2017 I just recently found out about this switch for ffmpeg, not sure if it will make a difference or if emby takes advantage of it. It is --enable-mpeg2_mmal. I wish i knew more about the codecs and such but i found: https://trac.ffmpeg.org/wiki/HWAccelIntro Which to me means if mmal is used that i should be able to take advantage of hardware accelerated mpeg2 decoding, assuming i understand the chart correctly and what that switch should do. One important note to anyone else reading this, hardware acceleration on a rpi for mpeg2 is unlocked with a license from the raspbery pi foundation, its cheap though i think it was 2 euro's or something like that. So I am now re-compiling my ffmpeg with the following settings: ./configure --enable-decoder=mpeg2_mmal --target-os=linux --enable-libx264 --enable-nonfree --enable-mmal --enable-omx --enable-omx-rpi --enable-gpl If i understand this all properly if emby takes advantage of these flags and such in ffmpeg i should be able to have at least hardware acceleration for decoding mpeg2 files. Not sure what impact this will have, if any but i figure at least my ffmpeg will have mpeg2 decoding with hardware acceleration built in.
Luke 42077 Posted September 25, 2017 Posted September 25, 2017 We haven't added mpeg2_mmal at this point.
Luke 42077 Posted July 7, 2019 Posted July 7, 2019 Can you post the ffmpeg command line that's failing? Looking at the ffmpeg source, there's no preset option for h264_omx, which would explain why it doesn't like that. The only options I can see begin on line 38555 in libavcodec/omx.c: omx_libname: OpenMAX library name omx_libprefix: OpenMAX library prefix zerocopy: Try to avoid copying input frames if possible profile: Set the encoding profile (baseline, main, high) If this list is accurate for your build (you can check by typing 'ffmpeg -h encoder=h264_omx' and it should show the same four options), then Luke can modify Emby's OpenMAX hardware encoding defaults accordingly. My Rpi isn't in bootable shape right now, so I can't do any checking here (it's also a Rpi 1B with a horridly slow SD card, so doing much of anything on it is painful). @@lakano @@Waldonnis The upcoming Emby Server 4.2 will have h264_omx built-in for Raspberry Pi hardware encoding. Thanks guys. 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now