use ez_ffmpeg::http_input::HttpInput;
use ez_ffmpeg::{FfmpegContext, FfmpegScheduler};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut args = std::env::args().skip(1);
let url = args
.next()
.ok_or("usage: http_input <http(s)-url> <output>")?;
let output = args
.next()
.ok_or("usage: http_input <http(s)-url> <output>")?;
let input = HttpInput::builder(url)
.build()?;
let context = FfmpegContext::builder()
.input(input)
.output(output)
.build()?;
FfmpegScheduler::new(context).start()?.wait()?;
Ok(())
}