Video

Struct Video 

Source
pub struct Video { /* private fields */ }

Implementations§

Source§

impl Video

Source

pub unsafe fn new(codec: Codec) -> Video

Source§

impl Video

Source

pub fn rates(&self) -> Option<RateIter>

Examples found in repository?
examples/codec-info.rs (line 24)
5fn main() {
6    ffmpeg::init().unwrap();
7
8    for arg in env::args().skip(1) {
9        if let Some(codec) = ffmpeg::decoder::find_by_name(&arg) {
10            println!("type: decoder");
11            println!("\t id: {:?}", codec.id());
12            println!("\t name: {}", codec.name());
13            println!("\t description: {}", codec.description());
14            println!("\t medium: {:?}", codec.medium());
15            println!("\t capabilities: {:?}", codec.capabilities());
16
17            if let Some(profiles) = codec.profiles() {
18                println!("\t profiles: {:?}", profiles.collect::<Vec<_>>());
19            } else {
20                println!("\t profiles: none");
21            }
22
23            if let Ok(video) = codec.video() {
24                if let Some(rates) = video.rates() {
25                    println!("\t rates: {:?}", rates.collect::<Vec<_>>());
26                } else {
27                    println!("\t rates: any");
28                }
29
30                if let Some(formats) = video.formats() {
31                    println!("\t formats: {:?}", formats.collect::<Vec<_>>());
32                } else {
33                    println!("\t formats: any");
34                }
35            }
36
37            if let Ok(audio) = codec.audio() {
38                if let Some(rates) = audio.rates() {
39                    println!("\t rates: {:?}", rates.collect::<Vec<_>>());
40                } else {
41                    println!("\t rates: any");
42                }
43
44                if let Some(formats) = audio.formats() {
45                    println!("\t formats: {:?}", formats.collect::<Vec<_>>());
46                } else {
47                    println!("\t formats: any");
48                }
49
50                if let Some(layouts) = audio.channel_layouts() {
51                    println!("\t channel_layouts: {:?}", layouts.collect::<Vec<_>>());
52                } else {
53                    println!("\t channel_layouts: any");
54                }
55            }
56
57            println!("\t max_lowres: {:?}", codec.max_lowres());
58        }
59
60        if let Some(codec) = ffmpeg::encoder::find_by_name(&arg) {
61            println!();
62            println!("type: encoder");
63            println!("\t id: {:?}", codec.id());
64            println!("\t name: {}", codec.name());
65            println!("\t description: {}", codec.description());
66            println!("\t medium: {:?}", codec.medium());
67            println!("\t capabilities: {:?}", codec.capabilities());
68
69            if let Some(profiles) = codec.profiles() {
70                println!("\t profiles: {:?}", profiles.collect::<Vec<_>>());
71            }
72
73            if let Ok(video) = codec.video() {
74                if let Some(rates) = video.rates() {
75                    println!("\t rates: {:?}", rates.collect::<Vec<_>>());
76                } else {
77                    println!("\t rates: any");
78                }
79
80                if let Some(formats) = video.formats() {
81                    println!("\t formats: {:?}", formats.collect::<Vec<_>>());
82                } else {
83                    println!("\t formats: any");
84                }
85            }
86
87            if let Ok(audio) = codec.audio() {
88                if let Some(rates) = audio.rates() {
89                    println!("\t rates: {:?}", rates.collect::<Vec<_>>());
90                } else {
91                    println!("\t rates: any");
92                }
93
94                if let Some(formats) = audio.formats() {
95                    println!("\t formats: {:?}", formats.collect::<Vec<_>>());
96                } else {
97                    println!("\t formats: any");
98                }
99
100                if let Some(layouts) = audio.channel_layouts() {
101                    println!("\t channel_layouts: {:?}", layouts.collect::<Vec<_>>());
102                } else {
103                    println!("\t channel_layouts: any");
104                }
105            }
106
107            println!("\t max_lowres: {:?}", codec.max_lowres());
108        }
109    }
110}
Source

pub fn formats(&self) -> Option<FormatIter>

Examples found in repository?
examples/codec-info.rs (line 30)
5fn main() {
6    ffmpeg::init().unwrap();
7
8    for arg in env::args().skip(1) {
9        if let Some(codec) = ffmpeg::decoder::find_by_name(&arg) {
10            println!("type: decoder");
11            println!("\t id: {:?}", codec.id());
12            println!("\t name: {}", codec.name());
13            println!("\t description: {}", codec.description());
14            println!("\t medium: {:?}", codec.medium());
15            println!("\t capabilities: {:?}", codec.capabilities());
16
17            if let Some(profiles) = codec.profiles() {
18                println!("\t profiles: {:?}", profiles.collect::<Vec<_>>());
19            } else {
20                println!("\t profiles: none");
21            }
22
23            if let Ok(video) = codec.video() {
24                if let Some(rates) = video.rates() {
25                    println!("\t rates: {:?}", rates.collect::<Vec<_>>());
26                } else {
27                    println!("\t rates: any");
28                }
29
30                if let Some(formats) = video.formats() {
31                    println!("\t formats: {:?}", formats.collect::<Vec<_>>());
32                } else {
33                    println!("\t formats: any");
34                }
35            }
36
37            if let Ok(audio) = codec.audio() {
38                if let Some(rates) = audio.rates() {
39                    println!("\t rates: {:?}", rates.collect::<Vec<_>>());
40                } else {
41                    println!("\t rates: any");
42                }
43
44                if let Some(formats) = audio.formats() {
45                    println!("\t formats: {:?}", formats.collect::<Vec<_>>());
46                } else {
47                    println!("\t formats: any");
48                }
49
50                if let Some(layouts) = audio.channel_layouts() {
51                    println!("\t channel_layouts: {:?}", layouts.collect::<Vec<_>>());
52                } else {
53                    println!("\t channel_layouts: any");
54                }
55            }
56
57            println!("\t max_lowres: {:?}", codec.max_lowres());
58        }
59
60        if let Some(codec) = ffmpeg::encoder::find_by_name(&arg) {
61            println!();
62            println!("type: encoder");
63            println!("\t id: {:?}", codec.id());
64            println!("\t name: {}", codec.name());
65            println!("\t description: {}", codec.description());
66            println!("\t medium: {:?}", codec.medium());
67            println!("\t capabilities: {:?}", codec.capabilities());
68
69            if let Some(profiles) = codec.profiles() {
70                println!("\t profiles: {:?}", profiles.collect::<Vec<_>>());
71            }
72
73            if let Ok(video) = codec.video() {
74                if let Some(rates) = video.rates() {
75                    println!("\t rates: {:?}", rates.collect::<Vec<_>>());
76                } else {
77                    println!("\t rates: any");
78                }
79
80                if let Some(formats) = video.formats() {
81                    println!("\t formats: {:?}", formats.collect::<Vec<_>>());
82                } else {
83                    println!("\t formats: any");
84                }
85            }
86
87            if let Ok(audio) = codec.audio() {
88                if let Some(rates) = audio.rates() {
89                    println!("\t rates: {:?}", rates.collect::<Vec<_>>());
90                } else {
91                    println!("\t rates: any");
92                }
93
94                if let Some(formats) = audio.formats() {
95                    println!("\t formats: {:?}", formats.collect::<Vec<_>>());
96                } else {
97                    println!("\t formats: any");
98                }
99
100                if let Some(layouts) = audio.channel_layouts() {
101                    println!("\t channel_layouts: {:?}", layouts.collect::<Vec<_>>());
102                } else {
103                    println!("\t channel_layouts: any");
104                }
105            }
106
107            println!("\t max_lowres: {:?}", codec.max_lowres());
108        }
109    }
110}

Methods from Deref<Target = Codec>§

Source

pub unsafe fn as_ptr(&self) -> *const AVCodec

Source

pub fn is_encoder(&self) -> bool

Source

pub fn is_decoder(&self) -> bool

Source

pub fn name(&self) -> &str

Examples found in repository?
examples/codec-info.rs (line 12)
5fn main() {
6    ffmpeg::init().unwrap();
7
8    for arg in env::args().skip(1) {
9        if let Some(codec) = ffmpeg::decoder::find_by_name(&arg) {
10            println!("type: decoder");
11            println!("\t id: {:?}", codec.id());
12            println!("\t name: {}", codec.name());
13            println!("\t description: {}", codec.description());
14            println!("\t medium: {:?}", codec.medium());
15            println!("\t capabilities: {:?}", codec.capabilities());
16
17            if let Some(profiles) = codec.profiles() {
18                println!("\t profiles: {:?}", profiles.collect::<Vec<_>>());
19            } else {
20                println!("\t profiles: none");
21            }
22
23            if let Ok(video) = codec.video() {
24                if let Some(rates) = video.rates() {
25                    println!("\t rates: {:?}", rates.collect::<Vec<_>>());
26                } else {
27                    println!("\t rates: any");
28                }
29
30                if let Some(formats) = video.formats() {
31                    println!("\t formats: {:?}", formats.collect::<Vec<_>>());
32                } else {
33                    println!("\t formats: any");
34                }
35            }
36
37            if let Ok(audio) = codec.audio() {
38                if let Some(rates) = audio.rates() {
39                    println!("\t rates: {:?}", rates.collect::<Vec<_>>());
40                } else {
41                    println!("\t rates: any");
42                }
43
44                if let Some(formats) = audio.formats() {
45                    println!("\t formats: {:?}", formats.collect::<Vec<_>>());
46                } else {
47                    println!("\t formats: any");
48                }
49
50                if let Some(layouts) = audio.channel_layouts() {
51                    println!("\t channel_layouts: {:?}", layouts.collect::<Vec<_>>());
52                } else {
53                    println!("\t channel_layouts: any");
54                }
55            }
56
57            println!("\t max_lowres: {:?}", codec.max_lowres());
58        }
59
60        if let Some(codec) = ffmpeg::encoder::find_by_name(&arg) {
61            println!();
62            println!("type: encoder");
63            println!("\t id: {:?}", codec.id());
64            println!("\t name: {}", codec.name());
65            println!("\t description: {}", codec.description());
66            println!("\t medium: {:?}", codec.medium());
67            println!("\t capabilities: {:?}", codec.capabilities());
68
69            if let Some(profiles) = codec.profiles() {
70                println!("\t profiles: {:?}", profiles.collect::<Vec<_>>());
71            }
72
73            if let Ok(video) = codec.video() {
74                if let Some(rates) = video.rates() {
75                    println!("\t rates: {:?}", rates.collect::<Vec<_>>());
76                } else {
77                    println!("\t rates: any");
78                }
79
80                if let Some(formats) = video.formats() {
81                    println!("\t formats: {:?}", formats.collect::<Vec<_>>());
82                } else {
83                    println!("\t formats: any");
84                }
85            }
86
87            if let Ok(audio) = codec.audio() {
88                if let Some(rates) = audio.rates() {
89                    println!("\t rates: {:?}", rates.collect::<Vec<_>>());
90                } else {
91                    println!("\t rates: any");
92                }
93
94                if let Some(formats) = audio.formats() {
95                    println!("\t formats: {:?}", formats.collect::<Vec<_>>());
96                } else {
97                    println!("\t formats: any");
98                }
99
100                if let Some(layouts) = audio.channel_layouts() {
101                    println!("\t channel_layouts: {:?}", layouts.collect::<Vec<_>>());
102                } else {
103                    println!("\t channel_layouts: any");
104                }
105            }
106
107            println!("\t max_lowres: {:?}", codec.max_lowres());
108        }
109    }
110}
Source

pub fn description(&self) -> &str

Examples found in repository?
examples/codec-info.rs (line 13)
5fn main() {
6    ffmpeg::init().unwrap();
7
8    for arg in env::args().skip(1) {
9        if let Some(codec) = ffmpeg::decoder::find_by_name(&arg) {
10            println!("type: decoder");
11            println!("\t id: {:?}", codec.id());
12            println!("\t name: {}", codec.name());
13            println!("\t description: {}", codec.description());
14            println!("\t medium: {:?}", codec.medium());
15            println!("\t capabilities: {:?}", codec.capabilities());
16
17            if let Some(profiles) = codec.profiles() {
18                println!("\t profiles: {:?}", profiles.collect::<Vec<_>>());
19            } else {
20                println!("\t profiles: none");
21            }
22
23            if let Ok(video) = codec.video() {
24                if let Some(rates) = video.rates() {
25                    println!("\t rates: {:?}", rates.collect::<Vec<_>>());
26                } else {
27                    println!("\t rates: any");
28                }
29
30                if let Some(formats) = video.formats() {
31                    println!("\t formats: {:?}", formats.collect::<Vec<_>>());
32                } else {
33                    println!("\t formats: any");
34                }
35            }
36
37            if let Ok(audio) = codec.audio() {
38                if let Some(rates) = audio.rates() {
39                    println!("\t rates: {:?}", rates.collect::<Vec<_>>());
40                } else {
41                    println!("\t rates: any");
42                }
43
44                if let Some(formats) = audio.formats() {
45                    println!("\t formats: {:?}", formats.collect::<Vec<_>>());
46                } else {
47                    println!("\t formats: any");
48                }
49
50                if let Some(layouts) = audio.channel_layouts() {
51                    println!("\t channel_layouts: {:?}", layouts.collect::<Vec<_>>());
52                } else {
53                    println!("\t channel_layouts: any");
54                }
55            }
56
57            println!("\t max_lowres: {:?}", codec.max_lowres());
58        }
59
60        if let Some(codec) = ffmpeg::encoder::find_by_name(&arg) {
61            println!();
62            println!("type: encoder");
63            println!("\t id: {:?}", codec.id());
64            println!("\t name: {}", codec.name());
65            println!("\t description: {}", codec.description());
66            println!("\t medium: {:?}", codec.medium());
67            println!("\t capabilities: {:?}", codec.capabilities());
68
69            if let Some(profiles) = codec.profiles() {
70                println!("\t profiles: {:?}", profiles.collect::<Vec<_>>());
71            }
72
73            if let Ok(video) = codec.video() {
74                if let Some(rates) = video.rates() {
75                    println!("\t rates: {:?}", rates.collect::<Vec<_>>());
76                } else {
77                    println!("\t rates: any");
78                }
79
80                if let Some(formats) = video.formats() {
81                    println!("\t formats: {:?}", formats.collect::<Vec<_>>());
82                } else {
83                    println!("\t formats: any");
84                }
85            }
86
87            if let Ok(audio) = codec.audio() {
88                if let Some(rates) = audio.rates() {
89                    println!("\t rates: {:?}", rates.collect::<Vec<_>>());
90                } else {
91                    println!("\t rates: any");
92                }
93
94                if let Some(formats) = audio.formats() {
95                    println!("\t formats: {:?}", formats.collect::<Vec<_>>());
96                } else {
97                    println!("\t formats: any");
98                }
99
100                if let Some(layouts) = audio.channel_layouts() {
101                    println!("\t channel_layouts: {:?}", layouts.collect::<Vec<_>>());
102                } else {
103                    println!("\t channel_layouts: any");
104                }
105            }
106
107            println!("\t max_lowres: {:?}", codec.max_lowres());
108        }
109    }
110}
Source

pub fn medium(&self) -> Type

Examples found in repository?
examples/codec-info.rs (line 14)
5fn main() {
6    ffmpeg::init().unwrap();
7
8    for arg in env::args().skip(1) {
9        if let Some(codec) = ffmpeg::decoder::find_by_name(&arg) {
10            println!("type: decoder");
11            println!("\t id: {:?}", codec.id());
12            println!("\t name: {}", codec.name());
13            println!("\t description: {}", codec.description());
14            println!("\t medium: {:?}", codec.medium());
15            println!("\t capabilities: {:?}", codec.capabilities());
16
17            if let Some(profiles) = codec.profiles() {
18                println!("\t profiles: {:?}", profiles.collect::<Vec<_>>());
19            } else {
20                println!("\t profiles: none");
21            }
22
23            if let Ok(video) = codec.video() {
24                if let Some(rates) = video.rates() {
25                    println!("\t rates: {:?}", rates.collect::<Vec<_>>());
26                } else {
27                    println!("\t rates: any");
28                }
29
30                if let Some(formats) = video.formats() {
31                    println!("\t formats: {:?}", formats.collect::<Vec<_>>());
32                } else {
33                    println!("\t formats: any");
34                }
35            }
36
37            if let Ok(audio) = codec.audio() {
38                if let Some(rates) = audio.rates() {
39                    println!("\t rates: {:?}", rates.collect::<Vec<_>>());
40                } else {
41                    println!("\t rates: any");
42                }
43
44                if let Some(formats) = audio.formats() {
45                    println!("\t formats: {:?}", formats.collect::<Vec<_>>());
46                } else {
47                    println!("\t formats: any");
48                }
49
50                if let Some(layouts) = audio.channel_layouts() {
51                    println!("\t channel_layouts: {:?}", layouts.collect::<Vec<_>>());
52                } else {
53                    println!("\t channel_layouts: any");
54                }
55            }
56
57            println!("\t max_lowres: {:?}", codec.max_lowres());
58        }
59
60        if let Some(codec) = ffmpeg::encoder::find_by_name(&arg) {
61            println!();
62            println!("type: encoder");
63            println!("\t id: {:?}", codec.id());
64            println!("\t name: {}", codec.name());
65            println!("\t description: {}", codec.description());
66            println!("\t medium: {:?}", codec.medium());
67            println!("\t capabilities: {:?}", codec.capabilities());
68
69            if let Some(profiles) = codec.profiles() {
70                println!("\t profiles: {:?}", profiles.collect::<Vec<_>>());
71            }
72
73            if let Ok(video) = codec.video() {
74                if let Some(rates) = video.rates() {
75                    println!("\t rates: {:?}", rates.collect::<Vec<_>>());
76                } else {
77                    println!("\t rates: any");
78                }
79
80                if let Some(formats) = video.formats() {
81                    println!("\t formats: {:?}", formats.collect::<Vec<_>>());
82                } else {
83                    println!("\t formats: any");
84                }
85            }
86
87            if let Ok(audio) = codec.audio() {
88                if let Some(rates) = audio.rates() {
89                    println!("\t rates: {:?}", rates.collect::<Vec<_>>());
90                } else {
91                    println!("\t rates: any");
92                }
93
94                if let Some(formats) = audio.formats() {
95                    println!("\t formats: {:?}", formats.collect::<Vec<_>>());
96                } else {
97                    println!("\t formats: any");
98                }
99
100                if let Some(layouts) = audio.channel_layouts() {
101                    println!("\t channel_layouts: {:?}", layouts.collect::<Vec<_>>());
102                } else {
103                    println!("\t channel_layouts: any");
104                }
105            }
106
107            println!("\t max_lowres: {:?}", codec.max_lowres());
108        }
109    }
110}
Source

pub fn id(&self) -> Id

Examples found in repository?
examples/codec-info.rs (line 11)
5fn main() {
6    ffmpeg::init().unwrap();
7
8    for arg in env::args().skip(1) {
9        if let Some(codec) = ffmpeg::decoder::find_by_name(&arg) {
10            println!("type: decoder");
11            println!("\t id: {:?}", codec.id());
12            println!("\t name: {}", codec.name());
13            println!("\t description: {}", codec.description());
14            println!("\t medium: {:?}", codec.medium());
15            println!("\t capabilities: {:?}", codec.capabilities());
16
17            if let Some(profiles) = codec.profiles() {
18                println!("\t profiles: {:?}", profiles.collect::<Vec<_>>());
19            } else {
20                println!("\t profiles: none");
21            }
22
23            if let Ok(video) = codec.video() {
24                if let Some(rates) = video.rates() {
25                    println!("\t rates: {:?}", rates.collect::<Vec<_>>());
26                } else {
27                    println!("\t rates: any");
28                }
29
30                if let Some(formats) = video.formats() {
31                    println!("\t formats: {:?}", formats.collect::<Vec<_>>());
32                } else {
33                    println!("\t formats: any");
34                }
35            }
36
37            if let Ok(audio) = codec.audio() {
38                if let Some(rates) = audio.rates() {
39                    println!("\t rates: {:?}", rates.collect::<Vec<_>>());
40                } else {
41                    println!("\t rates: any");
42                }
43
44                if let Some(formats) = audio.formats() {
45                    println!("\t formats: {:?}", formats.collect::<Vec<_>>());
46                } else {
47                    println!("\t formats: any");
48                }
49
50                if let Some(layouts) = audio.channel_layouts() {
51                    println!("\t channel_layouts: {:?}", layouts.collect::<Vec<_>>());
52                } else {
53                    println!("\t channel_layouts: any");
54                }
55            }
56
57            println!("\t max_lowres: {:?}", codec.max_lowres());
58        }
59
60        if let Some(codec) = ffmpeg::encoder::find_by_name(&arg) {
61            println!();
62            println!("type: encoder");
63            println!("\t id: {:?}", codec.id());
64            println!("\t name: {}", codec.name());
65            println!("\t description: {}", codec.description());
66            println!("\t medium: {:?}", codec.medium());
67            println!("\t capabilities: {:?}", codec.capabilities());
68
69            if let Some(profiles) = codec.profiles() {
70                println!("\t profiles: {:?}", profiles.collect::<Vec<_>>());
71            }
72
73            if let Ok(video) = codec.video() {
74                if let Some(rates) = video.rates() {
75                    println!("\t rates: {:?}", rates.collect::<Vec<_>>());
76                } else {
77                    println!("\t rates: any");
78                }
79
80                if let Some(formats) = video.formats() {
81                    println!("\t formats: {:?}", formats.collect::<Vec<_>>());
82                } else {
83                    println!("\t formats: any");
84                }
85            }
86
87            if let Ok(audio) = codec.audio() {
88                if let Some(rates) = audio.rates() {
89                    println!("\t rates: {:?}", rates.collect::<Vec<_>>());
90                } else {
91                    println!("\t rates: any");
92                }
93
94                if let Some(formats) = audio.formats() {
95                    println!("\t formats: {:?}", formats.collect::<Vec<_>>());
96                } else {
97                    println!("\t formats: any");
98                }
99
100                if let Some(layouts) = audio.channel_layouts() {
101                    println!("\t channel_layouts: {:?}", layouts.collect::<Vec<_>>());
102                } else {
103                    println!("\t channel_layouts: any");
104                }
105            }
106
107            println!("\t max_lowres: {:?}", codec.max_lowres());
108        }
109    }
110}
Source

pub fn is_video(&self) -> bool

Source

pub fn is_audio(&self) -> bool

Source

pub fn max_lowres(&self) -> i32

Examples found in repository?
examples/codec-info.rs (line 57)
5fn main() {
6    ffmpeg::init().unwrap();
7
8    for arg in env::args().skip(1) {
9        if let Some(codec) = ffmpeg::decoder::find_by_name(&arg) {
10            println!("type: decoder");
11            println!("\t id: {:?}", codec.id());
12            println!("\t name: {}", codec.name());
13            println!("\t description: {}", codec.description());
14            println!("\t medium: {:?}", codec.medium());
15            println!("\t capabilities: {:?}", codec.capabilities());
16
17            if let Some(profiles) = codec.profiles() {
18                println!("\t profiles: {:?}", profiles.collect::<Vec<_>>());
19            } else {
20                println!("\t profiles: none");
21            }
22
23            if let Ok(video) = codec.video() {
24                if let Some(rates) = video.rates() {
25                    println!("\t rates: {:?}", rates.collect::<Vec<_>>());
26                } else {
27                    println!("\t rates: any");
28                }
29
30                if let Some(formats) = video.formats() {
31                    println!("\t formats: {:?}", formats.collect::<Vec<_>>());
32                } else {
33                    println!("\t formats: any");
34                }
35            }
36
37            if let Ok(audio) = codec.audio() {
38                if let Some(rates) = audio.rates() {
39                    println!("\t rates: {:?}", rates.collect::<Vec<_>>());
40                } else {
41                    println!("\t rates: any");
42                }
43
44                if let Some(formats) = audio.formats() {
45                    println!("\t formats: {:?}", formats.collect::<Vec<_>>());
46                } else {
47                    println!("\t formats: any");
48                }
49
50                if let Some(layouts) = audio.channel_layouts() {
51                    println!("\t channel_layouts: {:?}", layouts.collect::<Vec<_>>());
52                } else {
53                    println!("\t channel_layouts: any");
54                }
55            }
56
57            println!("\t max_lowres: {:?}", codec.max_lowres());
58        }
59
60        if let Some(codec) = ffmpeg::encoder::find_by_name(&arg) {
61            println!();
62            println!("type: encoder");
63            println!("\t id: {:?}", codec.id());
64            println!("\t name: {}", codec.name());
65            println!("\t description: {}", codec.description());
66            println!("\t medium: {:?}", codec.medium());
67            println!("\t capabilities: {:?}", codec.capabilities());
68
69            if let Some(profiles) = codec.profiles() {
70                println!("\t profiles: {:?}", profiles.collect::<Vec<_>>());
71            }
72
73            if let Ok(video) = codec.video() {
74                if let Some(rates) = video.rates() {
75                    println!("\t rates: {:?}", rates.collect::<Vec<_>>());
76                } else {
77                    println!("\t rates: any");
78                }
79
80                if let Some(formats) = video.formats() {
81                    println!("\t formats: {:?}", formats.collect::<Vec<_>>());
82                } else {
83                    println!("\t formats: any");
84                }
85            }
86
87            if let Ok(audio) = codec.audio() {
88                if let Some(rates) = audio.rates() {
89                    println!("\t rates: {:?}", rates.collect::<Vec<_>>());
90                } else {
91                    println!("\t rates: any");
92                }
93
94                if let Some(formats) = audio.formats() {
95                    println!("\t formats: {:?}", formats.collect::<Vec<_>>());
96                } else {
97                    println!("\t formats: any");
98                }
99
100                if let Some(layouts) = audio.channel_layouts() {
101                    println!("\t channel_layouts: {:?}", layouts.collect::<Vec<_>>());
102                } else {
103                    println!("\t channel_layouts: any");
104                }
105            }
106
107            println!("\t max_lowres: {:?}", codec.max_lowres());
108        }
109    }
110}
Source

pub fn capabilities(&self) -> Capabilities

Examples found in repository?
examples/transcode-audio.rs (line 42)
9fn filter(
10    spec: &str,
11    decoder: &codec::decoder::Audio,
12    encoder: &codec::encoder::Audio,
13) -> Result<filter::Graph, ffmpeg::Error> {
14    let mut filter = filter::Graph::new();
15
16    let args = format!(
17        "time_base={}:sample_rate={}:sample_fmt={}:channel_layout=0x{:x}",
18        decoder.time_base(),
19        decoder.rate(),
20        decoder.format().name(),
21        decoder.channel_layout().bits()
22    );
23
24    filter.add(&filter::find("abuffer").unwrap(), "in", &args)?;
25    filter.add(&filter::find("abuffersink").unwrap(), "out", "")?;
26
27    {
28        let mut out = filter.get("out").unwrap();
29
30        out.set_sample_format(encoder.format());
31        out.set_channel_layout(encoder.channel_layout());
32        out.set_sample_rate(encoder.rate());
33    }
34
35    filter.output("in", 0)?.input("out", 0)?.parse(spec)?;
36    filter.validate()?;
37
38    println!("{}", filter.dump());
39
40    if let Some(codec) = encoder.codec() {
41        if !codec
42            .capabilities()
43            .contains(ffmpeg::codec::capabilities::Capabilities::VARIABLE_FRAME_SIZE)
44        {
45            filter
46                .get("out")
47                .unwrap()
48                .sink()
49                .set_frame_size(encoder.frame_size());
50        }
51    }
52
53    Ok(filter)
54}
More examples
Hide additional examples
examples/codec-info.rs (line 15)
5fn main() {
6    ffmpeg::init().unwrap();
7
8    for arg in env::args().skip(1) {
9        if let Some(codec) = ffmpeg::decoder::find_by_name(&arg) {
10            println!("type: decoder");
11            println!("\t id: {:?}", codec.id());
12            println!("\t name: {}", codec.name());
13            println!("\t description: {}", codec.description());
14            println!("\t medium: {:?}", codec.medium());
15            println!("\t capabilities: {:?}", codec.capabilities());
16
17            if let Some(profiles) = codec.profiles() {
18                println!("\t profiles: {:?}", profiles.collect::<Vec<_>>());
19            } else {
20                println!("\t profiles: none");
21            }
22
23            if let Ok(video) = codec.video() {
24                if let Some(rates) = video.rates() {
25                    println!("\t rates: {:?}", rates.collect::<Vec<_>>());
26                } else {
27                    println!("\t rates: any");
28                }
29
30                if let Some(formats) = video.formats() {
31                    println!("\t formats: {:?}", formats.collect::<Vec<_>>());
32                } else {
33                    println!("\t formats: any");
34                }
35            }
36
37            if let Ok(audio) = codec.audio() {
38                if let Some(rates) = audio.rates() {
39                    println!("\t rates: {:?}", rates.collect::<Vec<_>>());
40                } else {
41                    println!("\t rates: any");
42                }
43
44                if let Some(formats) = audio.formats() {
45                    println!("\t formats: {:?}", formats.collect::<Vec<_>>());
46                } else {
47                    println!("\t formats: any");
48                }
49
50                if let Some(layouts) = audio.channel_layouts() {
51                    println!("\t channel_layouts: {:?}", layouts.collect::<Vec<_>>());
52                } else {
53                    println!("\t channel_layouts: any");
54                }
55            }
56
57            println!("\t max_lowres: {:?}", codec.max_lowres());
58        }
59
60        if let Some(codec) = ffmpeg::encoder::find_by_name(&arg) {
61            println!();
62            println!("type: encoder");
63            println!("\t id: {:?}", codec.id());
64            println!("\t name: {}", codec.name());
65            println!("\t description: {}", codec.description());
66            println!("\t medium: {:?}", codec.medium());
67            println!("\t capabilities: {:?}", codec.capabilities());
68
69            if let Some(profiles) = codec.profiles() {
70                println!("\t profiles: {:?}", profiles.collect::<Vec<_>>());
71            }
72
73            if let Ok(video) = codec.video() {
74                if let Some(rates) = video.rates() {
75                    println!("\t rates: {:?}", rates.collect::<Vec<_>>());
76                } else {
77                    println!("\t rates: any");
78                }
79
80                if let Some(formats) = video.formats() {
81                    println!("\t formats: {:?}", formats.collect::<Vec<_>>());
82                } else {
83                    println!("\t formats: any");
84                }
85            }
86
87            if let Ok(audio) = codec.audio() {
88                if let Some(rates) = audio.rates() {
89                    println!("\t rates: {:?}", rates.collect::<Vec<_>>());
90                } else {
91                    println!("\t rates: any");
92                }
93
94                if let Some(formats) = audio.formats() {
95                    println!("\t formats: {:?}", formats.collect::<Vec<_>>());
96                } else {
97                    println!("\t formats: any");
98                }
99
100                if let Some(layouts) = audio.channel_layouts() {
101                    println!("\t channel_layouts: {:?}", layouts.collect::<Vec<_>>());
102                } else {
103                    println!("\t channel_layouts: any");
104                }
105            }
106
107            println!("\t max_lowres: {:?}", codec.max_lowres());
108        }
109    }
110}
Source

pub fn profiles(&self) -> Option<ProfileIter>

Examples found in repository?
examples/codec-info.rs (line 17)
5fn main() {
6    ffmpeg::init().unwrap();
7
8    for arg in env::args().skip(1) {
9        if let Some(codec) = ffmpeg::decoder::find_by_name(&arg) {
10            println!("type: decoder");
11            println!("\t id: {:?}", codec.id());
12            println!("\t name: {}", codec.name());
13            println!("\t description: {}", codec.description());
14            println!("\t medium: {:?}", codec.medium());
15            println!("\t capabilities: {:?}", codec.capabilities());
16
17            if let Some(profiles) = codec.profiles() {
18                println!("\t profiles: {:?}", profiles.collect::<Vec<_>>());
19            } else {
20                println!("\t profiles: none");
21            }
22
23            if let Ok(video) = codec.video() {
24                if let Some(rates) = video.rates() {
25                    println!("\t rates: {:?}", rates.collect::<Vec<_>>());
26                } else {
27                    println!("\t rates: any");
28                }
29
30                if let Some(formats) = video.formats() {
31                    println!("\t formats: {:?}", formats.collect::<Vec<_>>());
32                } else {
33                    println!("\t formats: any");
34                }
35            }
36
37            if let Ok(audio) = codec.audio() {
38                if let Some(rates) = audio.rates() {
39                    println!("\t rates: {:?}", rates.collect::<Vec<_>>());
40                } else {
41                    println!("\t rates: any");
42                }
43
44                if let Some(formats) = audio.formats() {
45                    println!("\t formats: {:?}", formats.collect::<Vec<_>>());
46                } else {
47                    println!("\t formats: any");
48                }
49
50                if let Some(layouts) = audio.channel_layouts() {
51                    println!("\t channel_layouts: {:?}", layouts.collect::<Vec<_>>());
52                } else {
53                    println!("\t channel_layouts: any");
54                }
55            }
56
57            println!("\t max_lowres: {:?}", codec.max_lowres());
58        }
59
60        if let Some(codec) = ffmpeg::encoder::find_by_name(&arg) {
61            println!();
62            println!("type: encoder");
63            println!("\t id: {:?}", codec.id());
64            println!("\t name: {}", codec.name());
65            println!("\t description: {}", codec.description());
66            println!("\t medium: {:?}", codec.medium());
67            println!("\t capabilities: {:?}", codec.capabilities());
68
69            if let Some(profiles) = codec.profiles() {
70                println!("\t profiles: {:?}", profiles.collect::<Vec<_>>());
71            }
72
73            if let Ok(video) = codec.video() {
74                if let Some(rates) = video.rates() {
75                    println!("\t rates: {:?}", rates.collect::<Vec<_>>());
76                } else {
77                    println!("\t rates: any");
78                }
79
80                if let Some(formats) = video.formats() {
81                    println!("\t formats: {:?}", formats.collect::<Vec<_>>());
82                } else {
83                    println!("\t formats: any");
84                }
85            }
86
87            if let Ok(audio) = codec.audio() {
88                if let Some(rates) = audio.rates() {
89                    println!("\t rates: {:?}", rates.collect::<Vec<_>>());
90                } else {
91                    println!("\t rates: any");
92                }
93
94                if let Some(formats) = audio.formats() {
95                    println!("\t formats: {:?}", formats.collect::<Vec<_>>());
96                } else {
97                    println!("\t formats: any");
98                }
99
100                if let Some(layouts) = audio.channel_layouts() {
101                    println!("\t channel_layouts: {:?}", layouts.collect::<Vec<_>>());
102                } else {
103                    println!("\t channel_layouts: any");
104                }
105            }
106
107            println!("\t max_lowres: {:?}", codec.max_lowres());
108        }
109    }
110}

Trait Implementations§

Source§

impl Clone for Video

Source§

fn clone(&self) -> Video

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Decoder for Video

Source§

impl Deref for Video

Source§

type Target = Codec

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl Encoder for Video

Source§

impl PartialEq for Video

Source§

fn eq(&self, other: &Video) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for Video

Source§

impl Eq for Video

Source§

impl StructuralPartialEq for Video

Auto Trait Implementations§

§

impl Freeze for Video

§

impl RefUnwindSafe for Video

§

impl Send for Video

§

impl Sync for Video

§

impl Unpin for Video

§

impl UnwindSafe for Video

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.