print (en/de)coders
This commit is contained in:
parent
a1b65bf80a
commit
1db161ec93
|
@ -1608,7 +1608,7 @@ int show_codecs(void *optctx, const char *opt, const char *arg)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void print_codecs(int encoder)
|
void print_codecs(int encoder)
|
||||||
{
|
{
|
||||||
const AVCodecDescriptor **codecs;
|
const AVCodecDescriptor **codecs;
|
||||||
unsigned i, nb_codecs = get_codecs_sorted(&codecs);
|
unsigned i, nb_codecs = get_codecs_sorted(&codecs);
|
||||||
|
@ -1646,6 +1646,22 @@ static void print_codecs(int encoder)
|
||||||
av_free(codecs);
|
av_free(codecs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void print_codecs_short(int encoder) {
|
||||||
|
const AVCodecDescriptor **codecs;
|
||||||
|
unsigned i, nb_codecs = get_codecs_sorted(&codecs);
|
||||||
|
|
||||||
|
for (i = 0; i < nb_codecs; i++) {
|
||||||
|
const AVCodecDescriptor *desc = codecs[i];
|
||||||
|
const AVCodec *codec = NULL;
|
||||||
|
|
||||||
|
while ((codec = next_codec_for_id(desc->id, codec, encoder))) {
|
||||||
|
printf(" %s", codec->name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
printf("\n");
|
||||||
|
av_free(codecs);
|
||||||
|
}
|
||||||
|
|
||||||
int show_decoders(void *optctx, const char *opt, const char *arg)
|
int show_decoders(void *optctx, const char *opt, const char *arg)
|
||||||
{
|
{
|
||||||
print_codecs(0);
|
print_codecs(0);
|
||||||
|
|
|
@ -51,6 +51,9 @@ extern AVDictionary *swr_opts;
|
||||||
extern AVDictionary *format_opts, *codec_opts, *resample_opts;
|
extern AVDictionary *format_opts, *codec_opts, *resample_opts;
|
||||||
extern int hide_banner;
|
extern int hide_banner;
|
||||||
|
|
||||||
|
void print_codecs(int encoder);
|
||||||
|
void print_codecs_short(int encoder);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register a program-specific cleanup routine.
|
* Register a program-specific cleanup routine.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -683,7 +683,18 @@ static AVCodec *find_codec_or_die(const char *name, enum AVMediaType type, int e
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!codec) {
|
if (!codec) {
|
||||||
av_log(NULL, AV_LOG_FATAL, "Unknown %s '%s'\n", codec_string, name);
|
int c;
|
||||||
|
|
||||||
|
av_log(NULL, AV_LOG_FATAL, "Unknown %s '%s'\n", codec_string, name);
|
||||||
|
|
||||||
|
av_log(NULL, AV_LOG_INFO, "Print %ss? [y/n]", codec_string);
|
||||||
|
|
||||||
|
c = getchar();
|
||||||
|
if(c == 'y' || c == 'Y') {
|
||||||
|
printf("\n");
|
||||||
|
print_codecs_short(encoder);
|
||||||
|
}
|
||||||
|
|
||||||
exit_program(1);
|
exit_program(1);
|
||||||
}
|
}
|
||||||
if (codec->type != type) {
|
if (codec->type != type) {
|
||||||
|
|
Loading…
Reference in New Issue