Posts: 18
Joined: May 2012
Reputation:
0
I'm running Kodi 17.6 (Arm64) on an iPad Air with iOS 11.1.1. For some unknown reason, some of my H.264 video files are decoded with ff-h264 software decoder; while some of my other H.264 video files are decoded with ff-h264-vtb hardware accelerated decoder. Is there any way that I can force Kodi to use hardware decoder on all my H.264 videos?
Before I upgraded my iPad to iOS 11.1.1, it was running iOS 8.x and I had an older version of Kodi installed at that time (don't remember which Kodi version). All my H.264 video files were decoded with hardware acceleration. The strange thing is some of the video files can no longer use hardware decode after iOS & Kodi version upgrade. Does anyone know how to force Kodi to do hardware decode on all H.264 videos?
Posts: 16,946
Joined: Feb 2011
Reputation:
256
You can’t force it - there is a reason why the ffmpeg thinks it can’t use hw decoder. Even if this worked in an older Kodi version. We are now using the ffmpeg hw decoder which moves the support burden away from us to ffmpeg.
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much:
click here
HowTo setup NFS for Kodi:
NFS (wiki)
HowTo configure avahi (zeroconf):
Avahi_Zeroconf (wiki)
READ THE IOS FAQ!:
iOS FAQ (wiki)
Posts: 16,946
Joined: Feb 2011
Reputation:
256
ffmpeg supports hardware decoding for multiple platforms. We are using this on iOS now. Before we had to interact with the operating system directly - now we can use some common ffmpeg code instead. There are h.264 Encoder settings that can prevent the usage of the hardware decoder. Interlaced content for example will always fall back to software decoding...
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much:
click here
HowTo setup NFS for Kodi:
NFS (wiki)
HowTo configure avahi (zeroconf):
Avahi_Zeroconf (wiki)
READ THE IOS FAQ!:
iOS FAQ (wiki)
Posts: 18
Joined: May 2012
Reputation:
0
2018-03-26, 18:16
(This post was last modified: 2018-03-26, 18:20 by phantom8.)
Thanks a lot for your clarification. Since the ffmpeg is responsible for interfacing directly with the iOS hardware decoder, I think it will be possible to modify the ffmpeg source code to force the use of hardware decoder for all H.264 videos. Previously, all my H.264 videos were working properly with the older Kodi using hardware decoder. I beleive this approach should theoretically work on my video files, even though it may break some other H.264 videos. Please correct me if I am wrong before I dig into the source code. Thanks again for your support.
Posts: 11,582
Joined: Feb 2008
Reputation:
84
davilla
Retired-Team-XBMC Developer
Posts: 11,582
From the old CDVDVideoCodecVDA (pulled from the h264 spec)
how to detect the interlacing used on an existing stream:- progressive is signalled by setting frame_mbs_only_flag: 1 in the SPS.- interlaced is signalled by setting frame_mbs_only_flag: 0 in the SPS and field_pic_flag: 1 on all frames.- paff is signalled by setting frame_mbs_only_flag: 0 in the SPS and field_pic_flag: 1 on all frames that get interlaced and field_pic_flag: 0 on all frames that get progressive.- mbaff is signalled by setting frame_mbs_only_flag: 0 in the SPS and mb_adaptive_frame_field_flag: 1 in the SPS and field_pic_flag: 0 on the frames, (field_pic_flag: 1 would indicate a normal interlaced frame).
Posts: 18
Joined: May 2012
Reputation:
0
I'm not an expert in video encoding/decoding, so I don't know if this is a proper fix. I tried to PM you a download link to a test clip, but it says I don't have permission. If you can provide me an email address, I can send the clip to you directly (around 2MB in size).
BTW, I've tested the changes on Kodi 17.6 official release and it worked well on all my H.264 videos, including interlaced ones. I've also tried the changes on the latest Kodi repo source, but I've encountered various problems which may be caused by the unstable status of the latest source code.
Posts: 18
Joined: May 2012
Reputation:
0
I've emailed the clips to you both. Thanks a lot for taking the time to look into the issue.
Posts: 11,582
Joined: Feb 2008
Reputation:
84
davilla
Retired-Team-XBMC Developer
Posts: 11,582
Thanks for sample, I'll cycle in some time to check it out.