Android sdk cut/trim video file

前端 未结 5 1418
庸人自扰
庸人自扰 2020-11-29 02:33

Is there any way to cut a video (mp4 or 3gp) on android, like use only the last 5 seconds of the movie... on iphone this is possible using the AVAssetExportSession but on an

5条回答
  •  自闭症患者
    2020-11-29 03:14

    You can do this with my mp4parser library. Have a look at the ShortenExample it does exactly what the name suggests. Since the library cannot re-encode the video it can only cut the video at I-frames. So the points in time where you can make a cut are quite coarse.

    On Android 4.1 you can access the hardware codecs via MediaCodec API which could be an option (but I haven't seen any example of that yet)

提交回复
热议问题