@@ -121,8 +121,43 @@ NamesMap getAvailableFormatsNames()
121
121
if (!fmt->name )
122
122
continue ;
123
123
124
- formatsNames.insert (
125
- std::make_pair (std::string (fmt->name ), std::string (fmt->long_name ? fmt->long_name : " " )));
124
+ formatsNames.insert (std::make_pair (std::string (fmt->name ), std::string (fmt->long_name ? fmt->long_name : " " )));
125
+ }
126
+ return formatsNames;
127
+ }
128
+
129
+ NamesMap getAvailableVideoFormatsNames ()
130
+ {
131
+ NamesMap formatsNames;
132
+
133
+ AVOutputFormat* fmt = NULL ;
134
+ while ((fmt = av_oformat_next (fmt)))
135
+ {
136
+ if (!fmt->name )
137
+ continue ;
138
+
139
+ if (fmt->video_codec == AV_CODEC_ID_NONE)
140
+ continue ;
141
+
142
+ formatsNames.insert (std::make_pair (std::string (fmt->name ), std::string (fmt->long_name ? fmt->long_name : " " )));
143
+ }
144
+ return formatsNames;
145
+ }
146
+
147
+ NamesMap getAvailableAudioFormatsNames ()
148
+ {
149
+ NamesMap formatsNames;
150
+
151
+ AVOutputFormat* fmt = NULL ;
152
+ while ((fmt = av_oformat_next (fmt)))
153
+ {
154
+ if (!fmt->name )
155
+ continue ;
156
+
157
+ if (fmt->audio_codec == AV_CODEC_ID_NONE)
158
+ continue ;
159
+
160
+ formatsNames.insert (std::make_pair (std::string (fmt->name ), std::string (fmt->long_name ? fmt->long_name : " " )));
126
161
}
127
162
return formatsNames;
128
163
}
@@ -139,8 +174,7 @@ NamesMap getAvailableVideoCodecsNames()
139
174
if (!c->name )
140
175
continue ;
141
176
142
- videoCodecsNames.insert (
143
- std::make_pair (std::string (c->name ), std::string (c->long_name ? c->long_name : " " )));
177
+ videoCodecsNames.insert (std::make_pair (std::string (c->name ), std::string (c->long_name ? c->long_name : " " )));
144
178
}
145
179
}
146
180
return videoCodecsNames;
@@ -158,8 +192,7 @@ NamesMap getAvailableAudioCodecsNames()
158
192
if (!c->name )
159
193
continue ;
160
194
161
- audioCodecsNames.insert (
162
- std::make_pair (std::string (c->name ), std::string (c->long_name ? c->long_name : " " )));
195
+ audioCodecsNames.insert (std::make_pair (std::string (c->name ), std::string (c->long_name ? c->long_name : " " )));
163
196
}
164
197
}
165
198
return audioCodecsNames;
0 commit comments