[mythtv] Difficulties with FFmpeg and mediacodec

Peter Bennett pb.mythtv at gmail.com
Wed Jun 13 01:57:03 UTC 2018


I have mediacodec decoding working after a fashion but with lots of 
problems.

1. Playback is jumpy especially with 1080p mpeg2 (Plays a few seconds in 
slow motion, then jumps forward a few seconds. Repeat...)
2. Playback has pixellation and video corruption, especially bad with 4K 
video.
3. MythTV prematurely thinks it reached EOF after a skip forward.
4. MythTV thinks my monitor is 1920x1080 when it is 3840x2160. The 
Monitor display, android settings and Kodi all agree that resolution is 
3840x2160.

A major issue was the fact that the encoder now releases multiple frames 
before it will accept a packet. The code until now was based on the 
false assumption that after sending one packet you would get back no 
frame or one frame. With mediacodec I have seen up to 15 frames come 
back after a single packet release. This messes up the whole timing 
calculation, which works out the frame timings based on the /packet/ PTS 
and DTS values, so now 15 frames get the same time. There is some 
incomprehensible logic in MythTV to "correct bad timing values". I may 
have to rewrite the timing code because the simple changes I have made 
to try to fix this did not help and the existing logic is convoluted.

The frames are being converted to the correct format and size in 
software with sws_scale. Due to item 4 on the list above, the 4K frames 
are being scaled down to 1920x1080, but that should not cause  video 
corruption to the extent that I see it.

Peter

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-dev/attachments/20180612/7d7a1e19/attachment.html>


More information about the mythtv-dev mailing list