What governs playback speed when encoding with Android's MediaCodec + mp4parser?

后端 未结 1 616
孤独总比滥情好
孤独总比滥情好 2021-01-28 18:18

I\'m trying to record, encode and finally create a short movie on Android (using API 16) with a combination of MediaCodec and Mp4Parser (to encapsulate into .mp4).

Every

相关标签:
1条回答
  • 2021-01-28 19:01

    I figured it out: When encapsulating with mp4parser (needed if you target API<18), you need to set the speed in mp4parser's API. The presentation time you provide to queueInputBuffer appearently make no difference if you're not using Android's built-in muxer (available only from API18).

    I stumbled on this question on github, which indicates the following is required:

     new H264TrackImpl(new FileDataSourceImpl(rawDataFile), "eng", 100, 10);
    
    • the last two parameters (timeScale and frameTick) set the playback speed to 'noraml'.
    0 讨论(0)
提交回复
热议问题