From patchwork Sun Oct 25 14:58:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 23209 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 236AB449ADF for ; Sun, 25 Oct 2020 17:00:27 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0A8C068A0F0; Sun, 25 Oct 2020 17:00:27 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail.red.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 26C6768025D for ; Sun, 25 Oct 2020 17:00:18 +0200 (EET) Received: from localhost (localhost [IPv6:::1]) by mail.red.khirnov.net (Postfix) with ESMTP id 9AE082964F7 for ; Sun, 25 Oct 2020 16:00:17 +0100 (CET) Received: from mail.red.khirnov.net ([IPv6:::1]) by localhost (mail.red.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id cGGov1FHVcPw for ; Sun, 25 Oct 2020 16:00:17 +0100 (CET) Received: from libav.daenerys.khirnov.net (libav.daenerys.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.daenerys.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail.red.khirnov.net (Postfix) with ESMTPS id CD25D2964DB for ; Sun, 25 Oct 2020 16:00:15 +0100 (CET) Received: by libav.daenerys.khirnov.net (Postfix, from userid 1000) id 33C6F20E00BF; Sun, 25 Oct 2020 16:00:11 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Sun, 25 Oct 2020 15:58:40 +0100 Message-Id: <20201025145843.7776-2-anton@khirnov.net> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201025145843.7776-1-anton@khirnov.net> References: <20201025145843.7776-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/5] avformat: fix typo in doxy X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" av_read_frame() reads new packets, av_read_packet() does not exist. --- libavformat/avformat.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/avformat.h b/libavformat/avformat.h index acfe25239d..2c54177591 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -356,7 +356,7 @@ struct AVDeviceCapabilitiesQuery; * sorting will have '-sort' appended. E.g. artist="The Beatles", * artist-sort="Beatles, The". * - Some protocols and demuxers support metadata updates. After a successful - * call to av_read_packet(), AVFormatContext.event_flags or AVStream.event_flags + * call to av_read_frame(), AVFormatContext.event_flags or AVStream.event_flags * will be updated to indicate if metadata changed. In order to detect metadata * changes on a stream, you need to loop through all streams in the AVFormatContext * and check their individual event_flags. From patchwork Sun Oct 25 14:58:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 23207 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 72452449ADF for ; Sun, 25 Oct 2020 17:00:23 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 45BF768A558; Sun, 25 Oct 2020 17:00:23 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail.red.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C3B5168025D for ; Sun, 25 Oct 2020 17:00:17 +0200 (EET) Received: from localhost (localhost [IPv6:::1]) by mail.red.khirnov.net (Postfix) with ESMTP id 3AC4D2964FA for ; Sun, 25 Oct 2020 16:00:17 +0100 (CET) Received: from mail.red.khirnov.net ([IPv6:::1]) by localhost (mail.red.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id XwZdRWxie3JT for ; Sun, 25 Oct 2020 16:00:16 +0100 (CET) Received: from libav.daenerys.khirnov.net (libav.daenerys.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.daenerys.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail.red.khirnov.net (Postfix) with ESMTPS id D03EE2964F6 for ; Sun, 25 Oct 2020 16:00:15 +0100 (CET) Received: by libav.daenerys.khirnov.net (Postfix, from userid 1000) id BD2E920E0047; Sun, 25 Oct 2020 16:00:11 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Sun, 25 Oct 2020 15:58:41 +0100 Message-Id: <20201025145843.7776-3-anton@khirnov.net> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201025145843.7776-1-anton@khirnov.net> References: <20201025145843.7776-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/5] avformat: extend documentation of event_flags X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Document how it is to be used for muxing (currently supported by flvenc). --- libavformat/avformat.h | 40 ++++++++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 2c54177591..3ad92a06e7 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -977,12 +977,24 @@ typedef struct AVStream { int nb_side_data; /** - * Flags for the user to detect events happening on the stream. Flags must - * be cleared by the user once the event has been handled. - * A combination of AVSTREAM_EVENT_FLAG_*. + * Flags indicating events happening on the stream, a combination of + * AVSTREAM_EVENT_FLAG_*. + * + * - demuxing: may be set by the demuxer in avformat_open_input(), + * avformat_find_stream_info() and av_read_frame(). Flags must be cleared + * by the user once the event has been handled. + * - muxing: may be set by the user after avformat_write_header(). to + * indicate a user-triggered event. The muxer will clear the flags for + * events it has handled in av_[interleaved]_write_frame(). */ int event_flags; -#define AVSTREAM_EVENT_FLAG_METADATA_UPDATED 0x0001 ///< The call resulted in updated metadata. +/** + * - demuxing: the demuxer read new metadata from the file and updated + * AVStream.metadata accordingly + * - muxing: the user updated AVStream.metadata and wishes the muxer to write + * it into the file + */ +#define AVSTREAM_EVENT_FLAG_METADATA_UPDATED 0x0001 /** * Real base framerate of the stream. @@ -1649,12 +1661,24 @@ typedef struct AVFormatContext { int strict_std_compliance; /** - * Flags for the user to detect events happening on the file. Flags must - * be cleared by the user once the event has been handled. - * A combination of AVFMT_EVENT_FLAG_*. + * Flags indicating events happening on the file, a combination of + * AVFMT_EVENT_FLAG_*. + * + * - demuxing: may be set by the demuxer in avformat_open_input(), + * avformat_find_stream_info() and av_read_frame(). Flags must be cleared + * by the user once the event has been handled. + * - muxing: may be set by the user after avformat_write_header() to + * indicate a user-triggered event. The muxer will clear the flags for + * events it has handled in av_[interleaved]_write_frame(). */ int event_flags; -#define AVFMT_EVENT_FLAG_METADATA_UPDATED 0x0001 ///< The call resulted in updated metadata. +/** + * - demuxing: the demuxer read new metadata from the file and updated + * AVFormatContext.metadata accordingly + * - muxing: the user updated AVFormatContext.metadata and wishes the muxer to + * write it into the file + */ +#define AVFMT_EVENT_FLAG_METADATA_UPDATED 0x0001 /** * Maximum number of packets to read while waiting for the first timestamp. From patchwork Sun Oct 25 14:58:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 23208 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 51A88449ADF for ; Sun, 25 Oct 2020 17:00:24 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 39F9868AA48; Sun, 25 Oct 2020 17:00:24 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail.red.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id CCF056891E1 for ; Sun, 25 Oct 2020 17:00:17 +0200 (EET) Received: from localhost (localhost [IPv6:::1]) by mail.red.khirnov.net (Postfix) with ESMTP id 317BA2964F9 for ; Sun, 25 Oct 2020 16:00:17 +0100 (CET) Received: from mail.red.khirnov.net ([IPv6:::1]) by localhost (mail.red.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id ltzn8thFTfU4 for ; Sun, 25 Oct 2020 16:00:16 +0100 (CET) Received: from libav.daenerys.khirnov.net (libav.daenerys.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.daenerys.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail.red.khirnov.net (Postfix) with ESMTPS id D160C2964F7 for ; Sun, 25 Oct 2020 16:00:15 +0100 (CET) Received: by libav.daenerys.khirnov.net (Postfix, from userid 1000) id 1580E20E00C0; Sun, 25 Oct 2020 16:00:11 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Sun, 25 Oct 2020 15:58:42 +0100 Message-Id: <20201025145843.7776-4-anton@khirnov.net> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201025145843.7776-1-anton@khirnov.net> References: <20201025145843.7776-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 3/5] ffmpeg.c: rename 'area' to 'score' X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Other factors besides area are used to pick the best video stream, so the name 'area' is misleading. --- fftools/ffmpeg_opt.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c index 19f719e3ff..a0d1b06f2d 100644 --- a/fftools/ffmpeg_opt.c +++ b/fftools/ffmpeg_opt.c @@ -2210,22 +2210,22 @@ static int open_output_file(OptionsContext *o, const char *filename) /* video: highest resolution */ if (!o->video_disable && av_guess_codec(oc->oformat, NULL, filename, NULL, AVMEDIA_TYPE_VIDEO) != AV_CODEC_ID_NONE) { - int area = 0, idx = -1; + int best_score = 0, idx = -1; int qcr = avformat_query_codec(oc->oformat, oc->oformat->video_codec, 0); for (i = 0; i < nb_input_streams; i++) { - int new_area; + int score; ist = input_streams[i]; - new_area = ist->st->codecpar->width * ist->st->codecpar->height + 100000000*!!ist->st->codec_info_nb_frames + score = ist->st->codecpar->width * ist->st->codecpar->height + 100000000*!!ist->st->codec_info_nb_frames + 5000000*!!(ist->st->disposition & AV_DISPOSITION_DEFAULT); if (ist->user_set_discard == AVDISCARD_ALL) continue; if((qcr!=MKTAG('A', 'P', 'I', 'C')) && (ist->st->disposition & AV_DISPOSITION_ATTACHED_PIC)) - new_area = 1; + score = 1; if (ist->st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO && - new_area > area) { + score > best_score) { if((qcr==MKTAG('A', 'P', 'I', 'C')) && !(ist->st->disposition & AV_DISPOSITION_ATTACHED_PIC)) continue; - area = new_area; + best_score = score; idx = i; } } From patchwork Sun Oct 25 14:58:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 23211 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id D6AC0449ADF for ; Sun, 25 Oct 2020 17:00:31 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BE23868AC4C; Sun, 25 Oct 2020 17:00:31 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail.red.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 408CA6800A9 for ; Sun, 25 Oct 2020 17:00:23 +0200 (EET) Received: from localhost (localhost [IPv6:::1]) by mail.red.khirnov.net (Postfix) with ESMTP id 39B552964DB for ; Sun, 25 Oct 2020 16:00:18 +0100 (CET) Received: from mail.red.khirnov.net ([IPv6:::1]) by localhost (mail.red.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id gIRYtLV0B9wI for ; Sun, 25 Oct 2020 16:00:17 +0100 (CET) Received: from libav.daenerys.khirnov.net (libav.daenerys.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.daenerys.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail.red.khirnov.net (Postfix) with ESMTPS id CE2512964F4 for ; Sun, 25 Oct 2020 16:00:15 +0100 (CET) Received: by libav.daenerys.khirnov.net (Postfix, from userid 1000) id DB87C20E00BE; Sun, 25 Oct 2020 16:00:11 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Sun, 25 Oct 2020 15:58:43 +0100 Message-Id: <20201025145843.7776-5-anton@khirnov.net> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201025145843.7776-1-anton@khirnov.net> References: <20201025145843.7776-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 4/5] avformat: add a stream event flag for new packets X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" --- libavformat/avformat.h | 6 ++++++ libavformat/utils.c | 2 ++ 2 files changed, 8 insertions(+) diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 3ad92a06e7..6aa7c310f7 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -995,6 +995,12 @@ typedef struct AVStream { * it into the file */ #define AVSTREAM_EVENT_FLAG_METADATA_UPDATED 0x0001 +/** + * - demuxing: new packets for this stream were read from the file. This + * event is informational only and does not guarantee that new packets + * for this stream will necessarily be returned from av_read_frame(). + */ +#define AVSTREAM_EVENT_FLAG_NEW_PACKETS (1 << 1) /** * Real base framerate of the stream. diff --git a/libavformat/utils.c b/libavformat/utils.c index e8335a601f..be275971d0 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -1533,6 +1533,8 @@ static int read_frame_internal(AVFormatContext *s, AVPacket *pkt) ret = 0; st = s->streams[pkt->stream_index]; + st->event_flags |= AVSTREAM_EVENT_FLAG_NEW_PACKETS; + /* update context if required */ if (st->internal->need_context_update) { if (avcodec_is_open(st->internal->avctx)) { From patchwork Sun Oct 25 14:58:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 23210 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 08B78449ADF for ; Sun, 25 Oct 2020 17:00:30 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E474268AAA0; Sun, 25 Oct 2020 17:00:29 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail.red.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9E46B68A854 for ; Sun, 25 Oct 2020 17:00:18 +0200 (EET) Received: from localhost (localhost [IPv6:::1]) by mail.red.khirnov.net (Postfix) with ESMTP id 39B702964F5 for ; Sun, 25 Oct 2020 16:00:18 +0100 (CET) Received: from mail.red.khirnov.net ([IPv6:::1]) by localhost (mail.red.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id SD4lWeTltGzz for ; Sun, 25 Oct 2020 16:00:17 +0100 (CET) Received: from libav.daenerys.khirnov.net (libav.daenerys.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.daenerys.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail.red.khirnov.net (Postfix) with ESMTPS id 827EF2964F8 for ; Sun, 25 Oct 2020 16:00:16 +0100 (CET) Received: by libav.daenerys.khirnov.net (Postfix, from userid 1000) id 413C120E00B1; Sun, 25 Oct 2020 16:00:11 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Sun, 25 Oct 2020 15:58:44 +0100 Message-Id: <20201025145843.7776-6-anton@khirnov.net> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201025145843.7776-1-anton@khirnov.net> References: <20201025145843.7776-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 5/5] ffmpeg.c: stop accessing private AVStream.codec_info_nb_frames X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Use AVSTREAM_EVENT_FLAG_NEW_PACKETS instead, which should provide the same information in this case. --- fftools/ffmpeg_opt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c index a0d1b06f2d..d58462b6ae 100644 --- a/fftools/ffmpeg_opt.c +++ b/fftools/ffmpeg_opt.c @@ -2215,7 +2215,8 @@ static int open_output_file(OptionsContext *o, const char *filename) for (i = 0; i < nb_input_streams; i++) { int score; ist = input_streams[i]; - score = ist->st->codecpar->width * ist->st->codecpar->height + 100000000*!!ist->st->codec_info_nb_frames + score = ist->st->codecpar->width * ist->st->codecpar->height + + 100000000 * !!(ist->st->event_flags & AVSTREAM_EVENT_FLAG_NEW_PACKETS) + 5000000*!!(ist->st->disposition & AV_DISPOSITION_DEFAULT); if (ist->user_set_discard == AVDISCARD_ALL) continue;