Fix examples
This commit is contained in:
@ -1,4 +1,4 @@
|
|||||||
extern crate ffmpeg;
|
extern crate ffmpeg_next as ffmpeg;
|
||||||
|
|
||||||
use std::env;
|
use std::env;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
extern crate ffmpeg;
|
extern crate ffmpeg_next as ffmpeg;
|
||||||
|
|
||||||
use std::env;
|
use std::env;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
extern crate ffmpeg;
|
extern crate ffmpeg_next as ffmpeg;
|
||||||
|
|
||||||
use std::env;
|
use std::env;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
extern crate ffmpeg;
|
extern crate ffmpeg_next as ffmpeg;
|
||||||
|
|
||||||
use std::env;
|
use std::env;
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
@ -40,7 +40,7 @@ fn filter(
|
|||||||
if let Some(codec) = encoder.codec() {
|
if let Some(codec) = encoder.codec() {
|
||||||
if !codec
|
if !codec
|
||||||
.capabilities()
|
.capabilities()
|
||||||
.contains(ffmpeg::codec::capabilities::VARIABLE_FRAME_SIZE)
|
.contains(ffmpeg::codec::capabilities::Capabilities::VARIABLE_FRAME_SIZE)
|
||||||
{
|
{
|
||||||
filter
|
filter
|
||||||
.get("out")
|
.get("out")
|
||||||
@ -75,7 +75,7 @@ fn transcoder<P: AsRef<Path>>(
|
|||||||
.audio()?;
|
.audio()?;
|
||||||
let global = octx.format()
|
let global = octx.format()
|
||||||
.flags()
|
.flags()
|
||||||
.contains(ffmpeg::format::flag::GLOBAL_HEADER);
|
.contains(ffmpeg::format::flag::Flags::GLOBAL_HEADER);
|
||||||
|
|
||||||
decoder.set_parameters(input.parameters())?;
|
decoder.set_parameters(input.parameters())?;
|
||||||
|
|
||||||
@ -85,10 +85,10 @@ fn transcoder<P: AsRef<Path>>(
|
|||||||
let channel_layout = codec
|
let channel_layout = codec
|
||||||
.channel_layouts()
|
.channel_layouts()
|
||||||
.map(|cls| cls.best(decoder.channel_layout().channels()))
|
.map(|cls| cls.best(decoder.channel_layout().channels()))
|
||||||
.unwrap_or(ffmpeg::channel_layout::STEREO);
|
.unwrap_or(ffmpeg::channel_layout::ChannelLayout::STEREO);
|
||||||
|
|
||||||
if global {
|
if global {
|
||||||
encoder.set_flags(ffmpeg::codec::flag::GLOBAL_HEADER);
|
encoder.set_flags(ffmpeg::codec::flag::Flags::GLOBAL_HEADER);
|
||||||
}
|
}
|
||||||
|
|
||||||
encoder.set_rate(decoder.rate() as i32);
|
encoder.set_rate(decoder.rate() as i32);
|
||||||
|
Reference in New Issue
Block a user