mirror of
https://github.com/alfg/mp4-rust.git
synced 2024-09-29 14:51:58 +00:00
fix tests and update mp4copy example.
This commit is contained in:
parent
042629a88c
commit
3b5a728a30
2 changed files with 6 additions and 2 deletions
|
@ -4,7 +4,7 @@ use std::io::prelude::*;
|
||||||
use std::io::{self, BufReader, BufWriter};
|
use std::io::{self, BufReader, BufWriter};
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
|
|
||||||
use mp4::{AacConfig, AvcConfig, MediaConfig, MediaType, Mp4Config, Result, TrackConfig};
|
use mp4::{AacConfig, AvcConfig, HevcConfig, MediaConfig, MediaType, Mp4Config, Result, TrackConfig};
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let args: Vec<String> = env::args().collect();
|
let args: Vec<String> = env::args().collect();
|
||||||
|
@ -48,6 +48,10 @@ fn copy<P: AsRef<Path>>(src_filename: &P, dst_filename: &P) -> Result<()> {
|
||||||
seq_param_set: track.sequence_parameter_set()?.to_vec(),
|
seq_param_set: track.sequence_parameter_set()?.to_vec(),
|
||||||
pic_param_set: track.picture_parameter_set()?.to_vec(),
|
pic_param_set: track.picture_parameter_set()?.to_vec(),
|
||||||
}),
|
}),
|
||||||
|
MediaType::H265 => MediaConfig::HevcConfig(HevcConfig {
|
||||||
|
width: track.width(),
|
||||||
|
height: track.height(),
|
||||||
|
}),
|
||||||
MediaType::AAC => MediaConfig::AacConfig(AacConfig {
|
MediaType::AAC => MediaConfig::AacConfig(AacConfig {
|
||||||
bitrate: track.bitrate(),
|
bitrate: track.bitrate(),
|
||||||
profile: track.audio_profile()?,
|
profile: track.audio_profile()?,
|
||||||
|
|
|
@ -155,7 +155,7 @@ impl Mp4Box for HvcCBox {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn box_size(&self) -> u64 {
|
fn box_size(&self) -> u64 {
|
||||||
let size = HEADER_SIZE + 7;
|
let size = HEADER_SIZE + 1;
|
||||||
size
|
size
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue