[mythtv] Android mediacodec woes

Peter Bennett pb.mythtv at gmail.com
Wed Jun 27 17:06:08 UTC 2018



On 06/26/2018 07:15 PM, Mark Spieth wrote:
> Is there any way to know that media codec deinterlacer is doubling the 
> frame rate?
Yes - I added a check in ProcessVideoFrame, and if the interval between 
frames is half what it should be, I set a flag. This part is working.
> 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.
This is what I am thinking of doing - pass them in as if it was a double 
rate deinterlacer but instead of passing through the same frame twice, 
pass a different one the second time, and make sure the output display 
treats it as a progressive frame.
> 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.
It is mostly working but the elapsed time goes wrong because it is 
counting number of frames for that. Also the frame count is wrong, which 
interferes with a lot of things.
>
> 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.
Yes I think by passing two sequential frames instead of the same frame 
twice and incrementing the frame counter only once, it may work.
> Alternatively change this to use timestamps as I think you suggested 
> previously.
>
I think this would be a much better solution but would require a lot of 
changes, frame count and frame number are used all over the place, also 
I think they may be used for the cut list and commercial skipping stuff.



More information about the mythtv-dev mailing list