From patchwork Wed May 31 15:32:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 41932 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:c51c:b0:10c:5e6f:955f with SMTP id gm28csp3357127pzb; Wed, 31 May 2023 08:32:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4H/9YFtVv7Da12eFiytV/OgdA/IzHqQK5Iv/Iqatu1sa/6nDAc3DkwOVyPLPNeKj8FLp4D X-Received: by 2002:a17:907:a414:b0:96f:5f44:ea02 with SMTP id sg20-20020a170907a41400b0096f5f44ea02mr5720259ejc.8.1685547160167; Wed, 31 May 2023 08:32:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685547160; cv=none; d=google.com; s=arc-20160816; b=Gh4sVCEbCzalqbrY8BFpu59oXkqBgbepG8d9EpYiz/AIvU9JOwtEhfk1WtjDJBPjFL 6ppo49AECRatGYoqr0MmZSE7JSwAGl+qd/oa+/Gh0W0TcgOufl8jMpIhsy7y/fchjLn+ IV4MZbBdXK4G3FBJqcM6//Flpw/oim7TEGRQlUTodOZfz+eiHaIj78eWkVC7ofd5CFPL AxW91IgHXPk54m7kLf4RdB/g1sItAEV8uUE9XQqxbf5nBZL7fM2dlfn79pSW6U09+RnT Yw5qbD1clmL8JSZASkSD70PGpXRguNuTDhETfWRGKUFuDExELdt2fS7+hCdTCIJx77Za IDbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:message-id:date:to:from :delivered-to; bh=JZF7gO4hJCX2FXGwTNdVOTsU1S7mjSISE+WFHFA1KdU=; b=TRzPaKo8nP/43Ai2aanrwF1hm3ncaQMQad4Fr7O3SNxmNalqqiCbUpoXy4QE3IBvFE jw6LlEN829AtazpH6xV3glPBQYRO6yINLmaWoO8vc9gJi8jANh4ebyydVjXLqozIqgVk Kd42wyzNc8NjPV6TflI/o5a0nYVuLSwwy+aCcq3RxtOtmECRdHfxwDnWn26rmjR4uyE0 OpAEHlaZQ4R079763FY8E0OXVBrjDfZ+hGE+Jqp2C1WBYFpE+5YprQPuVAScLbZF6REd T59jdOo+0xa8SmoQbvs6jk5WFlfZ2Izw5E7EcBm04AWkfQniMJmEA6qcGqRypU+1P0lL yW/g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id p8-20020a1709065dc800b00973865702ffsi1687004ejv.493.2023.05.31.08.32.39; Wed, 31 May 2023 08:32:40 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id EEC3F68C2A9; Wed, 31 May 2023 18:32:19 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DE4FF68C1D5 for ; Wed, 31 May 2023 18:32:11 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id B2CB42404EE for ; Wed, 31 May 2023 17:32:11 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id GEt9eqGAE_B2 for ; Wed, 31 May 2023 17:32:09 +0200 (CEST) Received: from libav.khirnov.net (libav.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.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id 9E72D240177 for ; Wed, 31 May 2023 17:32:09 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 4E86B3A0139 for ; Wed, 31 May 2023 17:32:09 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Wed, 31 May 2023 17:32:03 +0200 Message-Id: <20230531153205.24424-1-anton@khirnov.net> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/3] doc/examples/transcode: set packet timebase for decoding X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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" X-TUID: e+t2AxgDqa5v It is recommended for callers to set it, though not required. --- doc/examples/transcode.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/examples/transcode.c b/doc/examples/transcode.c index 805a028ed7..7110816fe6 100644 --- a/doc/examples/transcode.c +++ b/doc/examples/transcode.c @@ -97,6 +97,9 @@ static int open_input_file(const char *filename) "for stream #%u\n", i); return ret; } + + codec_ctx->pkt_timebase = stream->time_base; + /* Reencode video & audio and remux subtitles etc. */ if (codec_ctx->codec_type == AVMEDIA_TYPE_VIDEO || codec_ctx->codec_type == AVMEDIA_TYPE_AUDIO) { From patchwork Wed May 31 15:32:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 41930 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:c51c:b0:10c:5e6f:955f with SMTP id gm28csp3356916pzb; Wed, 31 May 2023 08:32:22 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5Rp7cdasmvs+yiqKTRhJJiDvMBYirdM8YQksiL+qa83XXqi9HDA6ku0v4OKHbnjy0OlK1R X-Received: by 2002:ac2:47f8:0:b0:4ed:c5a4:28dc with SMTP id b24-20020ac247f8000000b004edc5a428dcmr2686098lfp.38.1685547142298; Wed, 31 May 2023 08:32:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685547142; cv=none; d=google.com; s=arc-20160816; b=ujXMz7JZ5yZ00of1+5sL0osa/j8Rzqm6yEUIjUPU5/CsbG/DLy3XGUOsEpkaELgjuB frKa2ux6VLLTcxkD5R9TAxiiEY8tUsfw2+jbRRK7K7YNOv50cmcllxqXLYFdpH+e3kFZ z7WaANvriP7DXudSiXnU+CvMTlPa/jinLh8TP6JruE7ro3LSTSCMJGB+EiPQIL5nG2qW EWPBIW/3saM4djfd44hSxjwRXTTV06Nc0MIKkzGBUQLh8u3QTmiH2TDAWWfgmIDR6yUI hgS9v8tnSQMJzpPc/BNO7Ordsj6xoGBOOnBE5fy8Ql8zd1Ov6OoX3kQilgKx+epyHc7S t5ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=kq+KgDeXsJnINt4lfuRuNOW8uGis/8y8CxyPQUWAl4o=; b=DdAP9HKorJhz4Lv2pbfFxELepzeRggbAwN98of8TWH+jUCNzJuBl+leVPAUmYNUedO d0diFzeJM/9xXRnb7LuaPxK9Qrxe+kCAgLHwMpCd1eCg7tDYRqoqcSoJJy3exJKpZ3m6 mHen5pfqAUldtwb4x5Jc2OmkJYCYhnn1Fw5V24Tgq1Lg1Zan49BtjZNqim1igF/b9zlK ves0oqy0se/10HZZsy/G+A0WX+X3+nggvg47ye7TbmPFMkTeGQC8ELzKygqLqUI4tfmI RkEnPSjqoJlmhKixeHA8napH8sfsy/dLcwLiu1yt2BJvkW1AgECwCALi2rZ353amOqXi AAqQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id m3-20020aa7d343000000b00514bba0cd8bsi1283130edr.45.2023.05.31.08.32.21; Wed, 31 May 2023 08:32:22 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D9DFC68C25C; Wed, 31 May 2023 18:32:17 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D819268C1D5 for ; Wed, 31 May 2023 18:32:10 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 52C6E2404F5 for ; Wed, 31 May 2023 17:32:10 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id nq7wOHcMpdJz for ; Wed, 31 May 2023 17:32:09 +0200 (CEST) Received: from libav.khirnov.net (libav.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.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id A003A2404EC for ; Wed, 31 May 2023 17:32:09 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 5B7203A03F3 for ; Wed, 31 May 2023 17:32:09 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Wed, 31 May 2023 17:32:04 +0200 Message-Id: <20230531153205.24424-2-anton@khirnov.net> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230531153205.24424-1-anton@khirnov.net> References: <20230531153205.24424-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/3] doc/examples/transcode: stop using decoder's AVCodecContext.time_base X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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" X-TUID: PUAF79/GuCTs The contents of this field are not defined for decoding. Use pkt_timebase, which is the timebase of demuxed packets. Drop a tautological av_packet_rescale_ts() call, as the stream and decoder timebases are the same. --- doc/examples/transcode.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/doc/examples/transcode.c b/doc/examples/transcode.c index 7110816fe6..2e1491f432 100644 --- a/doc/examples/transcode.c +++ b/doc/examples/transcode.c @@ -269,7 +269,7 @@ static int init_filter(FilteringContext* fctx, AVCodecContext *dec_ctx, snprintf(args, sizeof(args), "video_size=%dx%d:pix_fmt=%d:time_base=%d/%d:pixel_aspect=%d/%d", dec_ctx->width, dec_ctx->height, dec_ctx->pix_fmt, - dec_ctx->time_base.num, dec_ctx->time_base.den, + dec_ctx->pkt_timebase.num, dec_ctx->pkt_timebase.den, dec_ctx->sample_aspect_ratio.num, dec_ctx->sample_aspect_ratio.den); @@ -309,7 +309,7 @@ static int init_filter(FilteringContext* fctx, AVCodecContext *dec_ctx, av_channel_layout_describe(&dec_ctx->ch_layout, buf, sizeof(buf)); snprintf(args, sizeof(args), "time_base=%d/%d:sample_rate=%d:sample_fmt=%s:channel_layout=%s", - dec_ctx->time_base.num, dec_ctx->time_base.den, dec_ctx->sample_rate, + dec_ctx->pkt_timebase.num, dec_ctx->pkt_timebase.den, dec_ctx->sample_rate, av_get_sample_fmt_name(dec_ctx->sample_fmt), buf); ret = avfilter_graph_create_filter(&buffersrc_ctx, buffersrc, "in", @@ -547,9 +547,6 @@ int main(int argc, char **argv) av_log(NULL, AV_LOG_DEBUG, "Going to reencode&filter the frame\n"); - av_packet_rescale_ts(packet, - ifmt_ctx->streams[stream_index]->time_base, - stream->dec_ctx->time_base); ret = avcodec_send_packet(stream->dec_ctx, packet); if (ret < 0) { av_log(NULL, AV_LOG_ERROR, "Decoding failed\n"); From patchwork Wed May 31 15:32:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 41931 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:c51c:b0:10c:5e6f:955f with SMTP id gm28csp3357017pzb; Wed, 31 May 2023 08:32:32 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6iIAwXI4R3hgGPYMvypIb7WRpKuT5vW6Tt45DgghOJ8q4LXb2sZM7taSxa7mtdzK3cGJVs X-Received: by 2002:a17:907:724a:b0:957:12a6:a00f with SMTP id ds10-20020a170907724a00b0095712a6a00fmr5258630ejc.21.1685547151893; Wed, 31 May 2023 08:32:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685547151; cv=none; d=google.com; s=arc-20160816; b=BA0N1zStvGWD/GZ9TyiLndU4PPqNaIRhYxYAT1/cUVxEGHKQcrtxV4NscSit3E0p+k 6tXVUa5tgekTZ9gYoFdk+qlu4CAblziL0nDfvljfAsEsVGxdAOlLuDglWWM3NMHC3y1q tenC0+N31+GDSRmdfysdez7xwcSnMK2LN2lE3SlQWuwSKuV15w/yb0So0V0oA81Zl/RD pjyrCMnSwjdOzK4paC4AEWXg/hTloYjrrmK2rmdbBcIDoCjEaTnq+oParhTMI9trKE6H sjrxV71oJaKhtKaGU0r3agUjhyu2IWKcVuLxUJ+C7t6mt7rtIiNhvzqc0Isej0P4mKAo bUCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=makMftolKfrZ3rpc2vfX5A4zzBJHx6YiD0UenkJjO9w=; b=V7TjWAOyNF7tN7vEgx2RYrqwzzoTMOoAFJ93GC6dYESBywaykzx+QytIWsnq09FDvp 321mAa9EHmzEgYoYgkztZSgqtV3tFORX/eIweIHSfD7zbWTaO2tbX4c+/38PnGybDZkf XnBHo/miPh5KOM1Iyu6p3NsOMFXeV5ksb9Sgtt5f/5DXrJXMurT3K0s+u9/phd5CF/yv /45jiuudtkns7mEQ3VJ3c31zECn9PBH/GBbK1Jd4tV4luaGmVDIWxytTv08Y8m2cAOp3 2enaefz0VxzsUcPttvC0eskxUvbP21LvU/nYfjgjp3stOxF+h2siiiwdTP3Wh9AzfTH/ Dfmg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id h21-20020a170906719500b00969c3b8ff16si2127195ejk.741.2023.05.31.08.32.31; Wed, 31 May 2023 08:32:31 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E0DB068C29F; Wed, 31 May 2023 18:32:18 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1995968C1D5 for ; Wed, 31 May 2023 18:32:11 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id CF3312404EC for ; Wed, 31 May 2023 17:32:10 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id LlXFsJRopYci for ; Wed, 31 May 2023 17:32:10 +0200 (CEST) Received: from libav.khirnov.net (libav.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.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id A9F492404EE for ; Wed, 31 May 2023 17:32:09 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 66AE23A04D0 for ; Wed, 31 May 2023 17:32:09 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Wed, 31 May 2023 17:32:05 +0200 Message-Id: <20230531153205.24424-3-anton@khirnov.net> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230531153205.24424-1-anton@khirnov.net> References: <20230531153205.24424-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 3/3] doc/examples/transcode: convert timestamps between filtering and encoding X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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" X-TUID: bPpsQy9q1J1+ The timebases do not have to match. --- doc/examples/transcode.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/examples/transcode.c b/doc/examples/transcode.c index 2e1491f432..ebe5ad2a42 100644 --- a/doc/examples/transcode.c +++ b/doc/examples/transcode.c @@ -439,6 +439,10 @@ static int encode_write_frame(unsigned int stream_index, int flush) /* encode filtered frame */ av_packet_unref(enc_pkt); + if (filt_frame && filt_frame->pts != AV_NOPTS_VALUE) + filt_frame->pts = av_rescale_q(filt_frame->pts, filt_frame->time_base, + stream->enc_ctx->time_base); + ret = avcodec_send_frame(stream->enc_ctx, filt_frame); if (ret < 0) @@ -493,6 +497,7 @@ static int filter_encode_write_frame(AVFrame *frame, unsigned int stream_index) break; } + filter->filtered_frame->time_base = av_buffersink_get_time_base(filter->buffersink_ctx);; filter->filtered_frame->pict_type = AV_PICTURE_TYPE_NONE; ret = encode_write_frame(stream_index, 0); av_frame_unref(filter->filtered_frame);