1
0
Fork 0
mirror of https://github.com/alfg/mp4-rust.git synced 2024-06-02 13:39:54 +00:00

Update mp4copy.rs

Add vp9 code after h265
This commit is contained in:
ninthakeey 2021-01-25 13:50:02 +08:00 committed by GitHub
parent 42df01b4d3
commit 8b24064dd0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,7 +4,16 @@ use std::io::prelude::*;
use std::io::{self, BufReader, BufWriter};
use std::path::Path;
use mp4::{AacConfig, AvcConfig, HevcConfig, TtxtConfig, MediaConfig, MediaType, Mp4Config, Result, TrackConfig, Vp9Config};
use mp4::{
AacConfig,
AvcConfig,
HevcConfig,
TtxtConfig,
MediaConfig,
MediaType,
Mp4Config,
Result,
TrackConfig};
fn main() {
let args: Vec<String> = env::args().collect();
@ -52,6 +61,10 @@ fn copy<P: AsRef<Path>>(src_filename: &P, dst_filename: &P) -> Result<()> {
width: track.width(),
height: track.height(),
}),
MediaType::VP9 => MediaConfig::Vp9Config(Vp9Config {
width: track.width(),
height: track.height(),
}),
MediaType::AAC => MediaConfig::AacConfig(AacConfig {
bitrate: track.bitrate(),
profile: track.audio_profile()?,
@ -59,10 +72,6 @@ fn copy<P: AsRef<Path>>(src_filename: &P, dst_filename: &P) -> Result<()> {
chan_conf: track.channel_config()?,
}),
MediaType::TTXT => MediaConfig::TtxtConfig(TtxtConfig {}),
MediaType::VP9 => MediaConfig::Vp9Config(Vp9Config {
width: track.width(),
height: track.height(),
}),
};
let track_conf = TrackConfig {