[PATCH 1/5] Fix output aspect ratio with libavfilter
bcoudurier
baptiste.coudurier
Mon Oct 25 07:33:42 CEST 2010
---
ffmpeg.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/ffmpeg.c b/ffmpeg.c
index 1681664..f06cc3e 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -450,6 +450,9 @@ static int configure_filters(AVInputStream *ist, AVOutputStream *ost)
codec->width = ist->output_video_filter->inputs[0]->w;
codec->height = ist->output_video_filter->inputs[0]->h;
+ codec->sample_aspect_ratio =
+ av_d2q(frame_aspect_ratio*codec->height/codec->width, 255);
+ ost->st->sample_aspect_ratio = codec->sample_aspect_ratio;
return 0;
}
@@ -1825,10 +1828,6 @@ static int output_packet(AVInputStream *ist, int ist_index,
do_audio_out(os, ost, ist, decoded_data_buf, decoded_data_size);
break;
case AVMEDIA_TYPE_VIDEO:
-#if CONFIG_AVFILTER
- if (ist->picref->video)
- ost->st->codec->sample_aspect_ratio = ist->picref->video->pixel_aspect;
-#endif
do_video_out(os, ost, ist, &picture, &frame_size);
if (vstats_filename && frame_size)
do_video_stats(os, ost, frame_size);
--
1.7.2.3
--------------070604020406070800090305--
More information about the ffmpeg-devel
mailing list