pub struct Video { /* private fields */ }
Implementations§
Source§impl Video
impl Video
Sourcepub fn rates(&self) -> Option<RateIter>
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}
Sourcepub fn formats(&self) -> Option<FormatIter>
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>§
pub unsafe fn as_ptr(&self) -> *const AVCodec
pub fn is_encoder(&self) -> bool
pub fn is_decoder(&self) -> bool
Sourcepub fn name(&self) -> &str
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}
Sourcepub fn description(&self) -> &str
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}
Sourcepub fn medium(&self) -> Type
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}
Sourcepub fn id(&self) -> Id
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}
pub fn is_video(&self) -> bool
pub fn is_audio(&self) -> bool
Sourcepub fn max_lowres(&self) -> i32
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}
Sourcepub fn capabilities(&self) -> Capabilities
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
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}
Sourcepub fn profiles(&self) -> Option<ProfileIter>
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§
impl Copy for Video
impl Eq for Video
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more