I think one way would be to create a timer and insert a buffer of zero size with EOS flag after the timer ends. But it seems weird the mediacodec/mediamuxer apis dont have a dur