From 67c6d57112086b6bca3ec45f52ce6956da456717 Mon Sep 17 00:00:00 2001 From: xufulong <839789740@qq.com> Date: Fri, 10 Jan 2020 00:16:25 +0800 Subject: [PATCH] media format model media format model --- .../com/frank/ffmpeg/model/AudioBean.java | 56 ++++++++++ .../com/frank/ffmpeg/model/MediaBean.java | 83 +++++++++++++++ .../com/frank/ffmpeg/model/VideoBean.java | 100 ++++++++++++++++++ 3 files changed, 239 insertions(+) create mode 100644 app/src/main/java/com/frank/ffmpeg/model/AudioBean.java create mode 100644 app/src/main/java/com/frank/ffmpeg/model/MediaBean.java create mode 100644 app/src/main/java/com/frank/ffmpeg/model/VideoBean.java diff --git a/app/src/main/java/com/frank/ffmpeg/model/AudioBean.java b/app/src/main/java/com/frank/ffmpeg/model/AudioBean.java new file mode 100644 index 0000000..398801b --- /dev/null +++ b/app/src/main/java/com/frank/ffmpeg/model/AudioBean.java @@ -0,0 +1,56 @@ +package com.frank.ffmpeg.model; + +/** + * the model of audio data + * Created by frank on 2020/1/7. + */ +public class AudioBean { + + //"codec_tag_string": "mp4a" + private String audioCodec; + + //"sample_rate": "44100" + private int sampleRate; + + //"channels": 2 + private int channels; + + //"channel_layout": "stereo" + private String channelLayout; + + public String getAudioCodec() { + if ("[0][0][0][0]".equals(audioCodec)) { + return null; + } + return audioCodec; + } + + public void setAudioCodec(String audioCodec) { + this.audioCodec = audioCodec; + } + + public int getSampleRate() { + return sampleRate; + } + + public void setSampleRate(int sampleRate) { + this.sampleRate = sampleRate; + } + + public int getChannels() { + return channels; + } + + public void setChannels(int channels) { + this.channels = channels; + } + + public String getChannelLayout() { + return channelLayout; + } + + public void setChannelLayout(String channelLayout) { + this.channelLayout = channelLayout; + } + +} diff --git a/app/src/main/java/com/frank/ffmpeg/model/MediaBean.java b/app/src/main/java/com/frank/ffmpeg/model/MediaBean.java new file mode 100644 index 0000000..81e89d5 --- /dev/null +++ b/app/src/main/java/com/frank/ffmpeg/model/MediaBean.java @@ -0,0 +1,83 @@ +package com.frank.ffmpeg.model; + +/** + * the model of media data + * Created by frank on 2020/1/7. + */ +public class MediaBean { + + private VideoBean videoBean; + + private AudioBean audioBean; + + // "duration": "313.330000" + private long duration; + + // "size": "22160429" + private long size; + + // "bit_rate": "565804" + private int bitRate; + + // "format_name": "mov,mp4,m4a,3gp,3g2,mj2" + private String formatName; + + // "nb_streams": 2 + private int streamNum; + + public VideoBean getVideoBean() { + return videoBean; + } + + public void setVideoBean(VideoBean videoBean) { + this.videoBean = videoBean; + } + + public AudioBean getAudioBean() { + return audioBean; + } + + public void setAudioBean(AudioBean audioBean) { + this.audioBean = audioBean; + } + + public long getDuration() { + return duration; + } + + public void setDuration(long duration) { + this.duration = duration; + } + + public long getSize() { + return size; + } + + public void setSize(long size) { + this.size = size; + } + + public int getBitRate() { + return bitRate; + } + + public void setBitRate(int bitRate) { + this.bitRate = bitRate; + } + + public String getFormatName() { + return formatName; + } + + public void setFormatName(String formatName) { + this.formatName = formatName; + } + + public int getStreamNum() { + return streamNum; + } + + public void setStreamNum(int streamNum) { + this.streamNum = streamNum; + } +} diff --git a/app/src/main/java/com/frank/ffmpeg/model/VideoBean.java b/app/src/main/java/com/frank/ffmpeg/model/VideoBean.java new file mode 100644 index 0000000..c7eeef3 --- /dev/null +++ b/app/src/main/java/com/frank/ffmpeg/model/VideoBean.java @@ -0,0 +1,100 @@ +package com.frank.ffmpeg.model; + +/** + * the model of video data + * Created by frank on 2020/1/7. + */ +public class VideoBean { + + //"codec_tag_string": "avc1" + private String videoCodec; + + //"width": 640 + private int width; + + //"height": 360 + private int height; + + //"display_aspect_ratio": "16:9" + private String displayAspectRatio; + + //"pix_fmt": "yuv420p" + private String pixelFormat; + + //"profile": "578" + private String profile; + + //"level": 30 + private int level; + + //"r_frame_rate": "24000/1001" + private int frameRate; + + public String getVideoCodec() { + if ("[0][0][0][0]".equals(videoCodec)) { + return null; + } + return videoCodec; + } + + public void setVideoCodec(String videoCodec) { + this.videoCodec = videoCodec; + } + + public int getWidth() { + return width; + } + + public void setWidth(int width) { + this.width = width; + } + + public int getHeight() { + return height; + } + + public void setHeight(int height) { + this.height = height; + } + + public String getDisplayAspectRatio() { + return displayAspectRatio; + } + + public void setDisplayAspectRatio(String displayAspectRatio) { + this.displayAspectRatio = displayAspectRatio; + } + + public String getPixelFormat() { + return pixelFormat; + } + + public void setPixelFormat(String pixelFormat) { + this.pixelFormat = pixelFormat; + } + + public String getProfile() { + return profile; + } + + public void setProfile(String profile) { + this.profile = profile; + } + + public int getLevel() { + return level; + } + + public void setLevel(int level) { + this.level = level; + } + + public int getFrameRate() { + return frameRate; + } + + public void setFrameRate(int frameRate) { + this.frameRate = frameRate; + } + +}