v18 RC1 - ffmpeg with hevc_rpi decoder - newclock5 - popcornmix/xbmc, feature/issue
#1
Hi,
Kodi 18RC1 on raspberrypi 3b, 32bit Gentoo Linux. HEVC hardware decoding inside kodi works fine.

ffmpeg-4.0.3 is installed systemwide including the hevc patches from newclock5 to allow for stream transcoding. This also works fine.
ffmpeg is built with:

--enable-mmal --enable-omx --enable-omx-rpi --enable-rpi

for HW HEVC/H265 decoding(hevc_rpi decoder) and HW encoding (h264_omx encoder). Works like a charm, however a few side effects/defects are observed:

1.) While transcoding (hevc->h264) the video output shows the stream being transcoded. See image. Can this be avoided? Say, use a different video device/buffer/display or get a settable option to not output to screen from ffmpeg? I was not able to find a suitable decoder or encoder option for this from the list of currently existing.
2.) While a single ffmpeg HEVC decoding is in progress, a second one cannot be started, starting a second one generates the following error and blocks ffmpeg:
gpuserv: vc_gpuserv_init: starting initialisation
gpuserv: vc_gpuserv_init: could not open vchiq service: -1
gpuserv: vc_gpuserv_execute_code: called without calling vc_gpuserv_init
gpuserv: vc_gpuserv_execute_code: vchiq service not initialised

If this is worth becoming a feature request or a bug report, let me know where is the best place to file it.
Kodi can play hevc streams at all times, it is not dependant on ffmpeg decoding in the background.
Thanks for the awesome work for raspberrypi!
-Nikolay
Reply
#2
These are ffmpeg questions rather than kodi questions.
To avoid the display of hevc when transcoding you need to configure ffmpeg without RPI_DISPLAY defined.
Reply
#3
Hello popcornmix,
Thanks for the guidance, I have adjusted the pfcd_hevc_optimisations.patch to define RPI_DISPLAY 0 and will be recompiling ffmpeg to test. This may also address the issue at 2.) so I will report as soon as I have results.

Actually, I have no other way to reach out to you but this forum and I needed your guidance in specific. Are you on IRC or are there alternative methods on asking questions on the hevc patches for ffmpeg than this kodi forum?

Thank you once again, amazing it is what you have achieved!
-N
Reply
#4
If they are questions about raspberry pi stuff not involving kodi then https://www.raspberrypi.org/forums would be a better place.
Reply
#5
When compiling ffmpeg without defining RPI_DISPLAY it segmentation faults at av_buffer_get_opaque:

Thread 8 "ffmpeg" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x744ff460 (LWP 16345)]
0x757cb6e0 in av_buffer_get_opaque () from /usr/lib/libavutil.so.56

These HEVC patches belong to the kodi project, thus I created this thread in here.
Reply
#6
Hi popcornmix,
Were you able to reproduce this yourself? Do you need more information from me(unstripped binaries with debug symbols in with line numbers for the segmentation faults, etc)? Would you consider this as a new feature request for the patches or perhaps a bug?
Thanks!
-N
Reply

Logout Mark Read Team Forum Stats Members Help
RC1 - ffmpeg with hevc_rpi decoder - newclock5 - popcornmix/xbmc, feature/issue0