[mythtv] Another ffmpeg mediacodec problem

Aman Gupta aman at tmm1.net
Mon Sep 24 20:29:09 UTC 2018


Hi Peter,

Did you see my version of the shield fix patch? You should be doing
something similar and not changing slice_height usage.

https://patchwork.ffmpeg.org/patch/9853/

As far as detecting interlacing, there is no way to do that apart from
checking the android device model and hardcoding what is expected. In my
experience the fire stick is not powerful enough to do any type of
deinterlacing. Let me know if you have different results.

Aman
On Mon, Sep 24, 2018 at 8:35 AM Peter Bennett <pb.mythtv at gmail.com> wrote:

> Hi Aman
>
> mediacodec is working well with the shield now. I am now testing
> Mythfrontend with another android device (amazon fire stick). The amazon
> fire stick runs amazon's version of android, which is built on android 5.1.
> Playback is working quite well on the fire stick, except for 1080i mpeg2
> content.
>
> * Problem 1*
> There is a problem very similar to the one we had on the shield.
> This time there is no seg fault, but the color is shifted upward on the
> screen.
> In this case it is using ff_mediacodec_sw_buffer_copy_yuv420_planar, so
> there are three planes. The slice height is 1088. The same patch as before
> works, i.e. change the code to use the height (1080) instead of the slice
> height fixes the problem. Patch file is attached. For photos of the screen
> see below URLs.
>
> Corrupted picture https://imagebin.ca/v/4GogJVTUFY72
> Picture after the patch https://imagebin.ca/v/4GogkMDmF7FU
>
> The buffer size that is passed into
> ff_mediacodec_sw_buffer_copy_yuv420_planar is the correct size for if it
> was using a slice height of 1088. With the shield the buffer size was only
> enough for a slice height of 1080, which is why the shield got a seg fault
> when it tried to use 1088 as slice height.
> size passed in = 3133472
> Size needed for 1080 slice height: 1920*1080+960*540+960*540 = 3110400
> Size needed for 1088 slice height: 1920*1088+960*544+960*544 = 3133440
>
> in mediacodec_dec_parse_format:
> (gdb) print s->codec_name
> $9 = 0xb84f51e0 "OMX.MTK.VIDEO.DECODER.MPEG2"
> (gdb) print format
> $20 = 0xb8582320
> "{image-data=java.nio.ByteArrayBuffer[position=0,limit=80,capacity=80],
> mime=video/raw, crop-top=0, crop-right=1919, slice-height=1088,
> color-format=19, height=1080, width=1920, crop-bottom=1079, crop-left=0,
> stride=1920}"
>
> * Problem 2*
> Also on the fire stick, with 480i or 1080i content,
> AVFrame::interlaced_frame is always 0. As a result we are not calling any
> deinterlacer. Can you help with how we can find out that frames are
> interlaced?
>
>
> Peter
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-dev/attachments/20180924/7a24c9b3/attachment.html>


More information about the mythtv-dev mailing list