[mythtv] Android mediacodec woes
Mark Spieth
mark at digivation.com.au
Tue Jun 26 23:15:04 UTC 2018
On 27/06/18 09:01, Peter Bennett wrote:
>
>
> On 06/26/2018 04:19 PM, Aman Gupta wrote:
>> If you really want 30fps deinterlaced output, you can use the
>> following patch. However this is a private/undocumented
>> SHIELD-specific option and will not work on other devices.
>>
>> @@ -383,6 +382,7 @@ static av_cold int
>> mediacodec_decode_init(AVCodecContext *avctx)
>> ff_AMediaFormat_setString(format, "mime", codec_mime);
>> ff_AMediaFormat_setInt32(format, "width", avctx->width);
>> ff_AMediaFormat_setInt32(format, "height", avctx->height);
>> + ff_AMediaFormat_setInt32(format, "deinterlace-method", 1);
>>
>> s->ctx = av_mallocz(sizeof(*s->ctx));
>> if (!s->ctx) {
>
> Thanks for the suggestion. I will keep it in mind, but I would rather
> stay away from making more ffmpeg changes and preferably work towards
> getting rid of the ones we have. Also, we are not developing for
> Shield exclusively.
>
Is there any way to know that media codec deinterlacer is doubling the
frame rate?
You have probably thought of this already but you could collect 2 frames
in this case from the decoder and pass them the same way as normal to
the renderer/shower.
AVSync however if you disable double framerate and let it think it is a
un deinterlaced frame should handle things properly. That is where all
the rate adapting occurs AFAIR. However I did play with it quite a while
ago so I may be misremembering.
The only other issue is the frame counter for current time in the video
which would have to be adapted too, or take the framecount before the
deinterlacer which in mediacodec case will probably be hidden.
Alternatively change this to use timestamps as I think you suggested
previously.
Mark
More information about the mythtv-dev
mailing list