Introduce user-selectable options to disable Mediacodec for mpeg2, mpeg4, and h.264
#1
Feature request:

For android platforms, I propose an addition to "Player" section of settings under "Acceleration", below Mediacodec options, to allow user to enable/disable Mediacodec for mpeg2, mpeg4 and h264 codecs with options
"Always"
"HD and up"
"Never"

In many popular android platforms, such as Amazon Fire TV, not all legacy codecs, such as mpeg2 and especially interlaced mpeg2, interlaced h.264 are implemented properly, resulting in stuttering or otherwise unusable video playback for these formats. Currently most android arm devices can decode mpeg2 in software, and code to for that is present and works fine in current Kodi Leia 18.1. In the future Android arm processors will get faster and eventually they will be able to software decode and deinterlace h.264. I do not expect that Android firmware manufacturers will keep support for legacy video format in their firmware. Giving users an option for software decoding will give users more flexibility and reduce user complaints.

Fritsch has a patch for this already under branch androidswmpeg2 in his fork of Kodi:

commit [77fadae](https://github.com/xbmc/xbmc/commit/77fa...1b40f98ef4) (has a bug)
and
commit [4666efb](https://github.com/xbmc/xbmc/commit/4666...4fc2249f8b) (fixes the bug)

Currently I have this code implemented in my fork of Kodi, and I set mpeg4 and mpeg4 to hardware decode only "HD and up" and h.264 to hardware decode "Always". Works fine on Amazon Fire TV 3 and Fire TV stick 4K. Before these options my DVD ISOs with interlaced mpeg2 did not play properly. I can create and provide the patch for Kodi-master from the above commits.
Reply
#2
please see an apk below from fritsch
Reply
#3
No need to spread custom builds (where content is unknown): http://mirrors.kodi.tv/test-builds/andro...bi-v7a.apk

Our key android developer plans something else ... this was just a POC that will or will not help him.
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#4
Thank you fritsch for posting your build -- I have downloaded it and will test it tonight!  I removed the link from my post.
Reply
#5
The build works fine on both fire TV 3 and fire stick 4K!
Reply
#6
(2019-02-21, 20:32)fritsch Wrote: No need to spread custom builds (where content is unknown): http://mirrors.kodi.tv/test-builds/andro...bi-v7a.apk

Our key android developer plans something else ... this was just a POC that will or will not help him.

Thx. @fritsch, now enjoying mpeg2 YADIF2x deinterlacing with quick TV channel Zapping & access to Lanczsos3-optimised upscaling.

ARM chipsets like AML S912 and above and the new FireTV Stick 4K are getting more powerful as the years roll by.

Be interested to see what easy to use SW/HW decode ARM Android options are "in the pipeline"

Reply
#7
I tried this .apk in an NVIDIA Shield TV, the options to select different HW decodings works as advertised, but later, when I try to change for example to lanczos3 upscalers the option doesn't appear (trying to upscale from 720p to 1080p).

If I disable HW decodings in both mediacodecs, the options for use lanzcos3, spline36 appears, but if I apply any of both upscalers, the video got broken and appears artifacs.

Thanks for your work!
Reply
#8
On fire tv 3 I do not have an option of Yadif deinterlacing in the onscreen menu when I choose to do software decoding for mpeg2 480i. Only Deinterlace or Deinterlace(half), or Off. Also any upscaler other than Bilinear or Nearest neighbor results in blurry picture. 
But the picture quality is good and smooth with Deinterlace and Bilinear scaling so I am not complaining.:-)
Reply
#9
I wanted to bump this thread.  @fritsch mentioned that the android developers have something different in mind regarding software decoding options for mpeg2, h.264 and mpeg4.  I have recently dicscovered that some 576p h.264 encoded videos do not play with hardware decode even on my rock solid S905X Libreelec box.  Fortunately there is a option to enable hardware decoding on libreelec only for "HD and up" videos.  Software decoding worked fine for these videos.

Could we expect inclusion of some switches to enable hardware decoding of mpeg2, mpeg4 or h.264 ONLY for "all" or "HD and up" oe "None" in the next Kodi version?    

Also @fritsch, your apk from androidswmpeg2 branch is no longer available on your test site.    I use my own compiled apk, which works fine, but it is compiled in debug mode, resulting in 96Mb apk.  How do I get the release 60-61Mb apk?
Reply
#10
Where can I find this version? The Netflix add-on plays some.stuff on h264 and that stutters on my firestick 4k.
Reply
#11
(2019-09-09, 19:58)rwijnhov Wrote: Where can I find this version? The Netflix add-on plays some.stuff on h264 and that stutters on my firestick 4k.

@fritsch it's been over a year since this thread was opened. Kodi 19s nightlies dont have these options. Have they been dropped as a request or is it still something being worked on?
Reply
#12
My issue is, on the Fire TV Stick 4K, a lot of older videos fill the screen with hardware acceleration enabled, instead of showing the proper aspect ratio (such as 4:3).  But many other videos require the speed of hardware acceleration, so you have to switch back and forth (which is cumbersome).  I would assume this proposal would alleviate a lot of this problem.  I hope something is still in the works.
Reply
#13
Anyone know how to add these settings back? This issue is still present on all of my Android devices and is very annoying
Reply
#14
Well I have an Android TV and it is very annoying how the mediacodec appears to work. This is why it is annoy for me. It may well be I need to understand more.

- I need to have passthrough on to get DTS 
- I need MediaCodec when using AVC/AC-3 because it does not play video
- I need MediaCodec off when I play MPEG-4/MPEG 1 because the sound is out of sync

To solve this I have added the player settings to the OSD menu which you can see hereImageImageImage and here

My code is on GitHub https://github.com/bibble235/xbmc

Probably needs fixing properly but it saved me doing four billion clicks which time I watch older TV

Thanks,
Reply
#15
(2019-02-21, 20:32)fritsch Wrote: No need to spread custom builds (where content is unknown): http://mirrors.kodi.tv/test-builds/andro...bi-v7a.apk

Our key android developer plans something else ... this was just a POC that will or will not help him.

Is this test build currently available anywhere? Thank you.
Reply

Logout Mark Read Team Forum Stats Members Help
Introduce user-selectable options to disable Mediacodec for mpeg2, mpeg4, and h.2642