MediaMuxer error “Failed to stop the muxer”

前端 未结 3 1710
猫巷女王i
猫巷女王i 2020-12-06 17:08

I\'m encoding Camera preview data using MediaCodec with mime-type \"video/avc\" and passing the encoded data (video-only, no audio) to MediaM

3条回答
  •  北荒
    北荒 (楼主)
    2020-12-06 17:53

    E/MPEG4Writer(2166): Missing codec specific data
    

    Sounds like you didn't call MediaMuxer#addTrack() with a MediaFormat that included the CSD. See the EncodeAndMuxTest.java code for an example of how to do this.

    Looking at the MPEG4Writer implementation used by MediaMuxer, there's an isTrackMalformed() check on line 2360; it sets ERROR_MALFORMED if the CSD data isn't present, but doesn't return immediately. Nothing clears the error, so it'll do a bunch of work and then fail, which seems to match what you're seeing.

提交回复
热议问题