2021SC@SDUSC-multimedia-utils-一款java后端的图片、视频处理工具jar包

2021SC@SDUSC 

目录

项目名称:multimedia-utils

AudioInfo

VideoInfo

FFmpegInfo


项目名称:multimedia-utils

博客十二

在上篇博客我们介绍的是runtimeutils文件。今天我们将介绍我们是如何获取音视频信息,并将修改好的音视频信息值返回的相关知识。

在解释相关代码之前,我们需要清楚一个视频或者音频有许多例如宽,高,duration等等常用信息。我们需要对这些相关信息进行获取。在这个项目中我们用的是相关info方法。例如我们使用的VideoInfo和AudioInfo和FFmpegInfo文件。用的方法一致。只不过是获取的对应参数不同。

AudioInfo

package com.whty.zdxt.multimedia.pojo;

public class AudioInfo {
    // 音频 编码名称
    private String codecName;

    // 音频 audio
    private String codecType;

    // 音频 时长
    private String duration;

    // 音频 比特率
    private Integer bitRate;

    // 音频 采样率
    private Integer sampleRate;

    // 音频 声道数 1:单声道 2:双声道
    private Integer channels;

    public String getCodecName() {
        return codecName;
    }

    public void setCodecName(String codecName) {
        this.codecName = codecName;
    }

    public String getCodecType() {
        return codecType;
    }

    public void setCodecType(String codecType) {
        this.codecType = codecType;
    }

    public String getDuration() {
        return duration;
    }

    public void setDuration(String duration) {
        this.duration = duration;
    }

    public Integer getBitRate() {
        return bitRate;
    }

    public void setBitRate(Integer bitRate) {
        this.bitRate = bitRate;
    }

    public Integer getSampleRate() {
        return sampleRate;
    }

    public void setSampleRate(Integer sampleRate) {
        this.sampleRate = sampleRate;
    }

    public Integer getChannels() {
        return channels;
    }

    public void setChannels(Integer channels) {
        this.channels = channels;
    }

    @Override
    public String toString() {
        return "AudioInfo [" +
                "codecName=" + codecName +
                ", codecType=" + codecType +
                ", duration=" + duration +
                ", bitRate=" + bitRate +
                ", sampleRate=" + sampleRate +
                ", channels=" + channels +
                ']';
    }
}

VideoInfo

 

package com.whty.zdxt.multimedia.pojo;

public class VideoInfo {
    // 视频 编码名称
    private String codecName;

    // 视频 video
    private String codecType;

    // 视频 宽度
    private Integer width;

    // 视频 高度
    private Integer height;

    // 视频 帧率
    private Integer frameRate;

    // 视频 时长
    private String duration;

    // 视频 比特率
    private Integer bitRate;

    // 视频 总帧数
    private Integer nbFrames;

    public String getCodecName() {
        return codecName;
    }

    public void setCodecName(String codecName) {
        this.codecName = codecName;
    }

    public String getCodecType() {
        return codecType;
    }

    public void setCodecType(String codecType) {
        this.codecType = codecType;
    }

    public Integer getWidth() {
        return width;
    }

    public void setWidth(Integer width) {
        this.width = width;
    }

    public Integer getHeight() {
        return height;
    }

    public void setHeight(Integer height) {
        this.height = height;
    }

    public Integer getFrameRate() {
        return frameRate;
    }

    public void setFrameRate(Integer frameRate) {
        this.frameRate = frameRate;
    }

    public String getDuration() {
        return duration;
    }

    public void setDuration(String duration) {
        this.duration = duration;
    }

    public Integer getBitRate() {
        return bitRate;
    }

    public void setBitRate(Integer bitRate) {
        this.bitRate = bitRate;
    }

    public Integer getNbFrames() {
        return nbFrames;
    }

    public void setNbFrames(Integer nbFrames) {
        this.nbFrames = nbFrames;
    }

    @Override
    public String toString() {
        return "VideoInfo [" +
                "codecName=" + codecName +
                ", codecType=" + codecType +
                ", width=" + width +
                ", height=" + height +
                ", frameRate=" + frameRate +
                ", duration=" + duration +
                ", bitRate=" + bitRate +
                ", nbFrames=" + nbFrames +
                ']';
    }
}

FFmpegInfo

package com.whty.zdxt.multimedia.pojo;

import java.util.List;

public class FFmpegInfo {
    private List<FFStream> streams;
    private FFFormat format;
    private AudioInfo audioInfo;
    private VideoInfo videoInfo;

    public List<FFStream> getStreams() {
        return streams;
    }

    public void setStreams(List<FFStream> streams) {
        this.streams = streams;
    }

    public FFFormat getFormat() {
        return format;
    }

    public void setFormat(FFFormat format) {
        this.format = format;
    }

    public AudioInfo getAudioInfo() {
        return audioInfo;
    }

    public void setAudioInfo(AudioInfo audioInfo) {
        this.audioInfo = audioInfo;
    }

    public VideoInfo getVideoInfo() {
        return videoInfo;
    }

    public void setVideoInfo(VideoInfo videoInfo) {
        this.videoInfo = videoInfo;
    }

    @Override
    public String toString() {
        return "FFmpegInfo [" +
                "streams=" + streams +
                ", format=" + format +
                ", audioInfo=" + audioInfo +
                ", videoInfo=" + videoInfo +
                ']';
    }
}

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值