media format model

media format model
pull/107/head
xufulong 5 years ago
parent 464b4ad796
commit 67c6d57112
  1. 56
      app/src/main/java/com/frank/ffmpeg/model/AudioBean.java
  2. 83
      app/src/main/java/com/frank/ffmpeg/model/MediaBean.java
  3. 100
      app/src/main/java/com/frank/ffmpeg/model/VideoBean.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;
}
}

@ -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;
}
}

@ -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;
}
}
Loading…
Cancel
Save