-
Notifications
You must be signed in to change notification settings - Fork 1
VIDEO
HOA PHAN edited this page Jan 3, 2024
·
3 revisions
https://files.khirnov.net/vdd_2023_slides.pdf https://www.phoronix.com/news/FFmpeg-CLI-MT-Merged
https://aws.amazon.com/ec2/instance-types/
Codec | Pros | Cons |
---|---|---|
H.264 | - High video quality at lower bitrates - Widely supported by hardware and software - Good for streaming and video conferencing |
- Can be complex to encode and decode - Not as efficient as newer codecs |
H.265 (HEVC) | - Higher compression efficiency than H.264 - Good for high-resolution video - Becoming more widely supported by hardware and software |
- Can be more complex to encode and decode - May require more processing power than H.264 |
VP9 | - Higher compression efficiency than H.264 - Good for high-resolution video - Royalty-free - Good for streaming |
- Not as widely supported by hardware and software as H.264 - Can be more complex to encode and decode |
AV1 | - Higher compression efficiency than H.264 - Royalty-free - Good for high-resolution video - Good for streaming |
- Not as widely supported by hardware and software as H.264 - Can be more complex to encode and decode - May require more processing power than other codecs |
MPEG-2 | - Widely supported by hardware and software - Good for broadcast and DVD video |
- Lower compression efficiency than newer codecs - Larger file sizes than newer codecs |
MPEG-4 | - Widely supported by hardware and software - Good for streaming video and mobile devices |
- Lower compression efficiency than newer codecs - Larger file sizes than newer codecs |
ffmpeg src
git clone https://git.ffmpeg.org/ffmpeg.git
To H.265
ffmpeg -i input.mp4 -c:v libx265 -crf 28 -preset medium -c:a copy output.mp4
https://blog.wirelessmoves.com/2020/10/ffmpeg-and-those-16-cpu-cores-for-video-encoding.html
https://mediaarea.net/en/MediaInfo/Download
use std::process::Command;
fn check_video_codec(file_path: &str) {
let ffprobe_path = "Z:\\ffmpeg\\bin\\ffprobe.exe"; // Replace with the actual path to ffprobe.exe
let command = format!(
"{} -v error -select_streams v:0 -show_entries stream=codec_name -of default=nokey=1:noprint_wrappers=1 {}",
ffprobe_path, file_path
);
println!("command: {}", command);
let output = Command::new("sh").arg("-c").arg(&command).output();
match output {
Ok(output) => {
if output.status.success() {
let codec = String::from_utf8_lossy(&output.stdout).trim().to_string();
println!("Codec: {}", codec);
} else {
let error_message = String::from_utf8_lossy(&output.stderr).trim().to_string();
eprintln!("Error executing command: {}", error_message);
}
}
Err(error) => {
eprintln!("Error executing command: {}", error);
}
}
}
fn main() {
let file_path = "D:\\test.mp4";
check_video_codec(file_path);
}
https://aws.amazon.com/blogs/media/aws-elemental-live-encoder-4k-uhd-advancements-and-workflows/
https://aaron.cc/ffmpeg-hevc-apple-devices/
https://streaminglearningcenter.com/articles/the-impact-of-gop-size-on-video-quality.html