Commit a3a9921d authored by yanzg's avatar yanzg

压缩视频

parent 16957f71
...@@ -38,7 +38,7 @@ public class MediaHelper { ...@@ -38,7 +38,7 @@ public class MediaHelper {
public static final String FORMAT_FLV = "flv"; public static final String FORMAT_FLV = "flv";
public static final String FORMAT_MPEG = "mp4"; public static final String FORMAT_MPEG = "mp4";
public static final String FORMAT_MPEG_CODEC = "mpeg4"; public static final String FORMAT_MPEG_CODEC = "mpeg4";
// public static final String FORMAT_MPEG_CODEC = "mpeg"; // public static final String FORMAT_MPEG_CODEC = "mpeg";
public static final String FORMAT_3PG = "3gp"; public static final String FORMAT_3PG = "3gp";
public static final String FORMAT_3PG_CODEC = "mpeg4"; public static final String FORMAT_3PG_CODEC = "mpeg4";
...@@ -251,6 +251,12 @@ public class MediaHelper { ...@@ -251,6 +251,12 @@ public class MediaHelper {
MultimediaInfo fromInfo = encoder.getInfo(source); MultimediaInfo fromInfo = encoder.getInfo(source);
VideoInfo fromVideo = fromInfo.getVideo(); VideoInfo fromVideo = fromInfo.getVideo();
AudioInfo fromAudio = fromInfo.getAudio(); AudioInfo fromAudio = fromInfo.getAudio();
if (fromAudio == null) {
fromAudio = new AudioInfo();
}
if (fromVideo == null) {
fromVideo = new VideoInfo();
}
if (FORMAT_EMPTY.equals(format) || format == null) { if (FORMAT_EMPTY.equals(format) || format == null) {
format = fromInfo.getFormat(); format = fromInfo.getFormat();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment