i2edu 4 years ago
parent
commit
24c6813bd1

+ 22 - 21
.idea/workspace.xml

@@ -20,7 +20,7 @@
   </component>
   <component name="ChangeListManager">
     <list default="true" id="96a4f947-f66a-4efc-b495-ae979b3315bb" name="Default Changelist" comment="">
-      <change beforePath="$PROJECT_DIR$/.gitignore" beforeDir="false" afterPath="$PROJECT_DIR$/.gitignore" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -59,6 +59,7 @@
       </map>
     </option>
     <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
+    <option name="UPDATE_TYPE" value="MERGE" />
   </component>
   <component name="ProjectFrameBounds">
     <option name="y" value="23" />
@@ -124,7 +125,14 @@
       <option name="project" value="LOCAL" />
       <updated>1600840521177</updated>
     </task>
-    <option name="localTasksCounter" value="2" />
+    <task id="LOCAL-00002" summary="update">
+      <created>1617680948335</created>
+      <option name="number" value="00002" />
+      <option name="presentableId" value="LOCAL-00002" />
+      <option name="project" value="LOCAL" />
+      <updated>1617680948335</updated>
+    </task>
+    <option name="localTasksCounter" value="3" />
     <servers />
   </component>
   <component name="TypeScriptGeneratedFilesManager">
@@ -169,32 +177,25 @@
   </component>
   <component name="VcsManagerConfiguration">
     <MESSAGE value="提高合成后视频的质量" />
-    <option name="LAST_COMMIT_MESSAGE" value="提高合成后视频的质量" />
+    <MESSAGE value="update" />
+    <option name="LAST_COMMIT_MESSAGE" value="update" />
   </component>
   <component name="WindowStateProjectService">
-    <state x="579" y="116" key="CommitChangelistDialog2" timestamp="1600840520996">
+    <state x="808" y="411" key="#com.intellij.ide.util.projectWizard.JdkChooserPanel.MyDialog" timestamp="1617681271701">
       <screen x="0" y="23" width="1920" height="985" />
     </state>
-    <state x="579" y="116" key="CommitChangelistDialog2/0.23.1920.985@0.23.1920.985" timestamp="1600840520996" />
-    <state width="1398" height="244" key="GridCell.Tab.0.bottom" timestamp="1600399519810">
-      <screen x="0" y="0" width="1440" height="900" />
-    </state>
-    <state width="1398" height="244" key="GridCell.Tab.0.bottom/0.0.1440.900@0.0.1440.900" timestamp="1600399519810" />
-    <state width="1398" height="244" key="GridCell.Tab.0.center" timestamp="1600399519808">
-      <screen x="0" y="0" width="1440" height="900" />
-    </state>
-    <state width="1398" height="244" key="GridCell.Tab.0.center/0.0.1440.900@0.0.1440.900" timestamp="1600399519808" />
-    <state width="1398" height="244" key="GridCell.Tab.0.left" timestamp="1600399519807">
-      <screen x="0" y="0" width="1440" height="900" />
+    <state x="808" y="411" key="#com.intellij.ide.util.projectWizard.JdkChooserPanel.MyDialog/0.23.1920.985@0.23.1920.985" timestamp="1617681271701" />
+    <state x="579" y="116" key="CommitChangelistDialog2" timestamp="1617681365256">
+      <screen x="0" y="23" width="1920" height="985" />
     </state>
-    <state width="1398" height="244" key="GridCell.Tab.0.left/0.0.1440.900@0.0.1440.900" timestamp="1600399519807" />
-    <state width="1398" height="244" key="GridCell.Tab.0.right" timestamp="1600399519809">
-      <screen x="0" y="0" width="1440" height="900" />
+    <state x="579" y="116" key="CommitChangelistDialog2/0.23.1920.985@0.23.1920.985" timestamp="1617681365256" />
+    <state x="560" y="244" key="Vcs.Push.Dialog.v2" timestamp="1617680949391">
+      <screen x="0" y="23" width="1920" height="985" />
     </state>
-    <state width="1398" height="244" key="GridCell.Tab.0.right/0.0.1440.900@0.0.1440.900" timestamp="1600399519809" />
-    <state x="560" y="244" key="Vcs.Push.Dialog.v2" timestamp="1600840522137">
+    <state x="560" y="244" key="Vcs.Push.Dialog.v2/0.23.1920.985@0.23.1920.985" timestamp="1617680949391" />
+    <state x="740" y="439" key="com.intellij.openapi.vcs.update.UpdateOrStatusOptionsDialogupdate-v2" timestamp="1617681380602">
       <screen x="0" y="23" width="1920" height="985" />
     </state>
-    <state x="560" y="244" key="Vcs.Push.Dialog.v2/0.23.1920.985@0.23.1920.985" timestamp="1600840522137" />
+    <state x="740" y="439" key="com.intellij.openapi.vcs.update.UpdateOrStatusOptionsDialogupdate-v2/0.23.1920.985@0.23.1920.985" timestamp="1617681380602" />
   </component>
 </project>

+ 0 - 130
android/src/main/kotlin/cn/i2edu/dubbing_lib/util/VideoAudioMixer.java

@@ -1,130 +0,0 @@
-package cn.i2edu.dubbing_lib.util;
-
-import android.content.Context;
-
-
-import android.media.MediaCodec;
-import android.media.MediaExtractor;
-import android.media.MediaFormat;
-import android.media.MediaMuxer;
-import android.os.Build;
-import androidx.annotation.RequiresApi;
-
-import java.nio.ByteBuffer;
-/**
- * Created by Administrator on 2016/11/24.
- */
-
-public class VideoAudioMixer {
-    private VideoAudioMixListener mListener = null;
-    private Context context;
-
-    public VideoAudioMixer(Context context) {
-        this.context = context;
-    }
-
-    public interface VideoAudioMixListener {
-        void mixSuccess();
-
-        void mixFail(String reason);
-    }
-
-    public void setListener(VideoAudioMixListener listener) {
-        mListener = listener;
-    }
-
-    @RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR2)
-    public void muxAudioAndVideo(String audioPath, String videoPath, String mixedFilePath) {
-        try {
-            MediaMuxer mMediaMuxer = new MediaMuxer(mixedFilePath,
-                    MediaMuxer.OutputFormat.MUXER_OUTPUT_MPEG_4);
-
-            // 视频的MediaExtractor
-            MediaExtractor mVideoExtractor = new MediaExtractor();
-            mVideoExtractor.setDataSource(videoPath);
-            int videoTrackIndex = -1;
-            for (int i = 0; i < mVideoExtractor.getTrackCount(); i++) {
-                MediaFormat format = mVideoExtractor.getTrackFormat(i);
-                if (format.getString(MediaFormat.KEY_MIME).startsWith("video/")) {
-                    mVideoExtractor.selectTrack(i);
-                    videoTrackIndex = mMediaMuxer.addTrack(format);
-                    break;
-                }
-            }
-
-            // 音频的MediaExtractor
-            MediaExtractor mAudioExtractor = new MediaExtractor();
-            mAudioExtractor.setDataSource(audioPath);
-            int audioTrackIndex = -1;
-            for (int i = 0; i < mAudioExtractor.getTrackCount(); i++) {
-                MediaFormat format = mAudioExtractor.getTrackFormat(i);
-                if (format.getString(MediaFormat.KEY_MIME).startsWith("audio/")) {
-                    mAudioExtractor.selectTrack(i);
-                    audioTrackIndex = mMediaMuxer.addTrack(format);
-                }
-            }
-
-            // 添加完所有轨道后start
-            mMediaMuxer.start();
-
-            // 封装视频track
-            if (-1 != videoTrackIndex) {
-                MediaCodec.BufferInfo info = new MediaCodec.BufferInfo();
-                info.presentationTimeUs = 0;
-                ByteBuffer buffer = ByteBuffer.allocate(100 * 1024);
-                while (true) {
-                    int sampleSize = mVideoExtractor.readSampleData(buffer, 0);
-                    if (sampleSize < 0) {
-                        break;
-                    }
-
-                    info.offset = 0;
-                    info.size = sampleSize;
-                    info.flags = MediaCodec.BUFFER_FLAG_SYNC_FRAME;
-                    info.presentationTimeUs = mVideoExtractor.getSampleTime();
-                    mMediaMuxer.writeSampleData(videoTrackIndex, buffer, info);
-
-                    mVideoExtractor.advance();
-                }
-            }
-
-            // 封装音频track
-            if (-1 != audioTrackIndex) {
-                MediaCodec.BufferInfo info = new MediaCodec.BufferInfo();
-                info.presentationTimeUs = 0;
-                ByteBuffer buffer = ByteBuffer.allocate(100 * 1024);
-                while (true) {
-                    int sampleSize = mAudioExtractor.readSampleData(buffer, 0);
-                    if (sampleSize < 0) {
-                        break;
-                    }
-
-                    info.offset = 0;
-                    info.size = sampleSize;
-                    info.flags = MediaCodec.BUFFER_FLAG_SYNC_FRAME;
-                    info.presentationTimeUs = mAudioExtractor.getSampleTime();
-                    mMediaMuxer.writeSampleData(audioTrackIndex, buffer, info);
-
-                    mAudioExtractor.advance();
-                }
-            }
-            if (mListener != null) {
-                mListener.mixSuccess();
-            }
-
-            // 释放MediaExtractor
-            mVideoExtractor.release();
-            mAudioExtractor.release();
-
-            // 释放MediaMuxer
-            mMediaMuxer.stop();
-            mMediaMuxer.release();
-        } catch (Exception e) {
-            e.printStackTrace();
-            if (mListener != null) {
-                mListener.mixFail(e.toString());
-            }
-        }
-    }
-
-}