[Delphi/CppBuilder] Android(java方法)上实现mp4的分割和拼接 (二).pdf

[复制链接]
发表于 2022-5-14 11:19:25
本节讲述如何在android上实现对mp4文件的高效剪切。
业务需求示例:将一个2分钟的mp4文件从00:42到01:16剪成视频,需要足够短的执行时间和尽可能少的错误。
分析:mp4Parser 只能在关键帧处剪切。例如,如果在 00:40 和 00:45 有一个可剪切的关键帧,那么剪切视频的头部和尾部应该被剪短。然后有错误的视频很短。如果误差大于0.5S,则使用FFmpeg逐帧对文件进行编码和解码。这样一来,mp4文件最多会有三段,你可以将这三段mp4重新拼接起来。
下面直接列出关键代码。这些代码也可以通过在PC上新建一个java项目来实现。

(This section describes how to cut MP4 files efficiently on Android.
Business requirement example: cutting a 2-minute MP4 file from 00:42 to 01:16 into video requires short enough execution time and as few errors as possible.
Analysis: mp4parser can only cut at keyframes. For example, if there is a cutable key frame at 00:40 and 00:45, the head and tail of the cut video should be cut short. Then the video with errors is very short. If the error is greater than 0.5s, ffmpeg is used to encode and decode the file frame by frame. In this way, the MP4 file can have up to three segments, and you can splice these three segments together again.
Key codes are listed directly below. These codes can also be implemented by creating a new Java project on the PC.)

[下载]11192544634.rar




上一篇:嵌入式操作系统Linux中的串口应用编程.pdf
下一篇:安卓软件管理器的开发_日志.docx

使用道具 举报

Archiver|手机版|小黑屋|吾爱开源 |网站地图

Copyright 2011 - 2012 Lnqq.NET.All Rights Reserved( ICP备案粤ICP备14042591号-1粤ICP14042591号 )

关于本站 - 版权申明 - 侵删联系 - Ln Studio! - 广告联系

本站资源来自互联网,仅供用户测试使用,相关版权归原作者所有

快速回复 返回顶部 返回列表