static const AVOption flat_options[]= {
{"sep_char", "set separator", OFFSET(sep_str), AV_OPT_TYPE_STRING, {.str="."}, CHAR_MIN, CHAR_MAX },
{"s", "set separator", OFFSET(sep_str), AV_OPT_TYPE_STRING, {.str="."}, CHAR_MIN, CHAR_MAX },
- {"hierachical", "specify if the section specification should be hierarchical", OFFSET(hierarchical), AV_OPT_TYPE_INT, {.dbl=1}, 0, 1 },
+ {"hierarchical", "specify if the section specification should be hierarchical", OFFSET(hierarchical), AV_OPT_TYPE_INT, {.dbl=1}, 0, 1 },
{"h", "specify if the section specification should be hierarchical", OFFSET(hierarchical), AV_OPT_TYPE_INT, {.dbl=1}, 0, 1 },
{NULL},
};
#define OFFSET(x) offsetof(INIContext, x)
static const AVOption ini_options[] = {
- {"hierachical", "specify if the section specification should be hierarchical", OFFSET(hierarchical), AV_OPT_TYPE_INT, {.dbl=1}, 0, 1 },
+ {"hierarchical", "specify if the section specification should be hierarchical", OFFSET(hierarchical), AV_OPT_TYPE_INT, {.dbl=1}, 0, 1 },
{"h", "specify if the section specification should be hierarchical", OFFSET(hierarchical), AV_OPT_TYPE_INT, {.dbl=1}, 0, 1 },
{NULL},
};
fflush(stdout);
}
-static void show_frame(WriterContext *w, AVFrame *frame, AVStream *stream)
+static void show_frame(WriterContext *w, AVFrame *frame, AVStream *stream,
+ AVFormatContext *fmt_ctx)
{
AVBPrint pbuf;
const char *s;
else print_str_opt("pkt_pos", "N/A");
switch (stream->codec->codec_type) {
+ AVRational sar;
+
case AVMEDIA_TYPE_VIDEO:
print_int("width", frame->width);
print_int("height", frame->height);
s = av_get_pix_fmt_name(frame->format);
if (s) print_str ("pix_fmt", s);
else print_str_opt("pix_fmt", "unknown");
- if (frame->sample_aspect_ratio.num) {
- print_q("sample_aspect_ratio", frame->sample_aspect_ratio, ':');
+ sar = av_guess_sample_aspect_ratio(fmt_ctx, stream, frame);
+ if (sar.num) {
+ print_q("sample_aspect_ratio", sar, ':');
} else {
print_str_opt("sample_aspect_ratio", "N/A");
}
print_int("nb_samples", frame->nb_samples);
break;
}
+ show_tags(av_frame_get_metadata(frame));
print_section_footer("frame");
int ret = 0;
*got_frame = 0;
- switch (dec_ctx->codec_type) {
- case AVMEDIA_TYPE_VIDEO:
- ret = avcodec_decode_video2(dec_ctx, frame, got_frame, pkt);
- break;
+ if (dec_ctx->codec) {
+ switch (dec_ctx->codec_type) {
+ case AVMEDIA_TYPE_VIDEO:
+ ret = avcodec_decode_video2(dec_ctx, frame, got_frame, pkt);
+ break;
- case AVMEDIA_TYPE_AUDIO:
- ret = avcodec_decode_audio4(dec_ctx, frame, got_frame, pkt);
- break;
+ case AVMEDIA_TYPE_AUDIO:
+ ret = avcodec_decode_audio4(dec_ctx, frame, got_frame, pkt);
+ break;
+ }
}
return ret;
if (ret < 0 || !got_frame)
break;
if (do_show_frames)
- show_frame(w, &frame, fmt_ctx->streams[pkt.stream_index]);
+ show_frame(w, &frame, fmt_ctx->streams[pkt.stream_index], fmt_ctx);
pkt1.data += ret;
pkt1.size -= ret;
nb_streams_frames[pkt.stream_index]++;
while (get_decoded_frame(fmt_ctx, &frame, &got_frame, &pkt) >= 0 && got_frame) {
if (do_read_frames) {
if (do_show_frames)
- show_frame(w, &frame, fmt_ctx->streams[pkt.stream_index]);
+ show_frame(w, &frame, fmt_ctx->streams[pkt.stream_index], fmt_ctx);
nb_streams_frames[pkt.stream_index]++;
}
}
AVCodec *dec;
char val_str[128];
const char *s;
- AVRational display_aspect_ratio;
+ AVRational sar, dar;
AVBPrint pbuf;
av_bprint_init(&pbuf, 1, AV_BPRINT_SIZE_UNLIMITED);
print_int("width", dec_ctx->width);
print_int("height", dec_ctx->height);
print_int("has_b_frames", dec_ctx->has_b_frames);
- if (dec_ctx->sample_aspect_ratio.num) {
- print_q("sample_aspect_ratio", dec_ctx->sample_aspect_ratio, ':');
- av_reduce(&display_aspect_ratio.num, &display_aspect_ratio.den,
- dec_ctx->width * dec_ctx->sample_aspect_ratio.num,
- dec_ctx->height * dec_ctx->sample_aspect_ratio.den,
+ sar = av_guess_sample_aspect_ratio(fmt_ctx, stream, NULL);
+ if (sar.den) {
+ print_q("sample_aspect_ratio", sar, ':');
+ av_reduce(&dar.num, &dar.den,
+ dec_ctx->width * sar.num,
+ dec_ctx->height * sar.den,
1024*1024);
- print_q("display_aspect_ratio", display_aspect_ratio, ':');
+ print_q("display_aspect_ratio", dar, ':');
} else {
print_str_opt("sample_aspect_ratio", "N/A");
print_str_opt("display_aspect_ratio", "N/A");
program_birth_year, this_year);
print_str("build_date", __DATE__);
print_str("build_time", __TIME__);
- print_str("compiler_type", CC_TYPE);
- print_str("compiler_version", CC_VERSION);
+ print_str("compiler_ident", CC_IDENT);
print_str("configuration", FFMPEG_CONFIGURATION);
print_section_footer("program_version");
writer_print_chapter_footer(w, "program_version");