Skip to content
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

Issue when accessing hardware h264 decoder #137

Open
c0ff330k opened this issue Dec 27, 2022 · 2 comments
Open

Issue when accessing hardware h264 decoder #137

c0ff330k opened this issue Dec 27, 2022 · 2 comments

Comments

@c0ff330k
Copy link

c0ff330k commented Dec 27, 2022

I am developing android app with kivy and ffpyplayer for watching video streams.
But i'm using low performance hardware and getting lag on streams with 2500 bitrate and higher, so I decided to use hardware accelerated codecs like h264_v4l2m2m.
I add 'vcodec': 'h264_v4l2m2m' parameter of MediaPlayer in kivy.core.video.video_ffpyplayer.py but get this issue:

12-28 00:44:29.802  2065  2138 I python  : [ERROR  ] [ffpyplayer  ] [h264_v4l2m2m @ 0x7b181c6100] can't configure decoder
12-28 00:44:29.803  2065  2138 I python  : [CRITICAL] [ffpyplayer  ] Failed to open file 'http://213.145.131.243:80/cam1/stream.m3u8' or configure filtergraph
12-28 00:44:29.787  2138  2138 W Thread-6: type=1400 audit(0.0:25): avc: denied { read } for name="/" dev="tmpfs" ino=7196 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:device:s0 tclass=dir permissive=0

I tried to change pixel format to 'yuv420p' but that didn't work.
Also i tried to add WRITE_EXTERNAL_STORAGE permission to my buildozer.spec requirements and ask for the permission with android.permissions.request_permissions due to this line:
12-28 00:44:29.787 2138 2138 W Thread-6: type=1400 audit(0.0:25): avc: denied { read } for name="/" dev="tmpfs" ino=7196 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:device:s0 tclass=dir permissive=0
but still no any effect. ( or maybe Thread doesn't have access to that permission, but that's just my guess )
Any help please

@c0ff330k
Copy link
Author

I found some information about this issue and it seems that
W Thread-6: type=1400 audit(0.0:25): avc: denied { read } for name="/" dev="tmpfs" ino=7196 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:device:s0 tclass=dir permissive=0
is a SELinux denial. So SELinux blocks ffmpeg when trying to access the hardware codec but I don`t understand why this is happening.

@c0ff330k
Copy link
Author

I tested hardware codecs on another android device with no SELinux installed and got this issue:

12-28 18:43:12.145  9268 10389 I python  : [ERROR  ] [ffpyplayer  ] [h264_v4l2m2m @ 0xcd16dc00] Could not find a valid device
12-28 18:43:12.146  9268 10389 I python  : [ERROR  ] [ffpyplayer  ] [h264_v4l2m2m @ 0xcd16dc00] can't configure decoder
12-28 18:43:12.147  9268 10389 I python  : [CRITICAL] [ffpyplayer  ] Failed to open file 'http://213.145.131.243:80/cam2/stream.m3u8' or configure filtergraph

So may be SELinux not a general problem.
But on my windows pc the hardware codecs work fine with 'vcodec' parameter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant