From patchwork Sun Jun 20 19:08:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thilo Borgmann X-Patchwork-Id: 28587 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2042:0:0:0:0 with SMTP id z2csp1298635iod; Sun, 20 Jun 2021 12:09:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxOwdiV3ohpElv7epnO2zu4h0RGzs2k+ZaHOX1fAi0IOmfxcmZgCAjs4Q5oiXDUa6KyYyiG X-Received: by 2002:aa7:d713:: with SMTP id t19mr16800660edq.83.1624216147477; Sun, 20 Jun 2021 12:09:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624216147; cv=none; d=google.com; s=arc-20160816; b=FGs75NUDlERZ5prWE53g/0FRXbBJ2/xM7T8BGIVb91trFRiPaKd8qjgi+YOiOWWPO4 dLUQ0OBI7YREvaVUkn+9TJY9ypgfAEG/NYyNDlXw5KrKWqzGu7ePC9w+vYAwVCSXtVvm oz/8cT38nKgUEpWAtaHMnVhpmyLA0kp7/Mzg1/onLUxYlOmkSPHFYA8daw6xFBS9+nQu 7tx+z99xD7lnrv3g2aUAli2BwHd4cvurS8X3v8iL9Kmt1D71xCYJ3Fieaz795SqAqSEo 0TkLjxIeMO1K7XjdRZIOM8ySMlNllAjYCSATd7cnHkQzy6+9YI9bs4S0DzNFQgLYh6sJ gWbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject :content-language:mime-version:date:message-id:from:to :dkim-signature:delivered-to; bh=/OHFn7Qwr6uRodl1xVTn64eICt5bj5kEO0635R4kCso=; b=lvQYJ5eqMOKtIIzLkvbaYRgBsv0mwq5ipMcMMzpQwvFY8gfEyeoTKdpkwSpEjERCzD W1k0zUh5LmDBr12N8+Xwj9X8oi41XTZNW+5F2nNUIyo8bOklzEtNSquzUUBlanWNhsgJ 8t4XdfonjHbRitVKbEYlnL0roAHOBkEBJX6/rk/0+sGCKZMyjeniPXDEMZJZcBfgW3+3 o4Jnos3OyHeSjYSfxF+JwXnglQ0xoq66OqlFa6oUgMrj9c7eNf17Gyfsn2S27KBadVot b9vd8eQFXWPjdahHRGp/zKv1Qu1WhMAncSzB4OfE6oCFOq4N7vR4vRZ2ZZrqDcWeLRp1 Ycpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@mail.de header.s=mailde202009 header.b=d09ET+bJ; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mail.de Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id b26si7583757edw.185.2021.06.20.12.09.06; Sun, 20 Jun 2021 12:09:07 -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; dkim=neutral (body hash did not verify) header.i=@mail.de header.s=mailde202009 header.b=d09ET+bJ; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mail.de Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CA374689986; Sun, 20 Jun 2021 22:09:02 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from shout02.mail.de (unknown [62.201.172.25]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4A99B680633 for ; Sun, 20 Jun 2021 22:08:56 +0300 (EEST) Received: from postfix01.mail.de (postfix03.bt.mail.de [10.0.121.127]) by shout02.mail.de (Postfix) with ESMTP id CC035C01F5 for ; Sun, 20 Jun 2021 21:08:45 +0200 (CEST) Received: from smtp02.mail.de (smtp02.bt.mail.de [10.0.121.212]) by postfix01.mail.de (Postfix) with ESMTP id B2298801F5 for ; Sun, 20 Jun 2021 21:08:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mail.de; s=mailde202009; t=1624216125; bh=s6aNIY+OBaV7yExhIKwrZCZK5YbF0wt5yLrbWbbtyvQ=; h=To:From:Subject:Date:From; b=d09ET+bJE+szv5YtfpLsah4Wp5yvSNqS6/Hv2uzfRhxc/l5zvHJL1DcRMk1YnZZjc SjEvqHH3rhgpr6N1OMyygCPMUuwr2zTu9oOn/EbsO3Nvf4BJu+QmU5LY7fEotftEGg VG4bgwNgpbGw9P5AocQye7wP+MDHIrlWjc9ACVmx19oT7/MV8nUmHMv5G6Ccs4PbTo kQBFuxKM3/Viz6wlQ5mmYaQvDNuRtLVRqIM1fl4G/iyV987dDmzxQt4q2xj9Wzy97W xZURXzMVgrpDtHUFZtCq2Wopah/NUATEs9RnDLpQeo9x18XcH5tKQW7THHox6/ziU9 p+XCdNeHQXnNA== Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by smtp02.mail.de (Postfix) with ESMTPSA id 85CABA02C7 for ; Sun, 20 Jun 2021 21:08:45 +0200 (CEST) To: FFmpeg development discussions and patches From: Thilo Borgmann Message-ID: <25c125e5-5f74-492f-1c8d-ac9035058aac@mail.de> Date: Sun, 20 Jun 2021 21:08:44 +0200 MIME-Version: 1.0 Content-Language: de-DE X-purgate: clean X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate-type: clean X-purgate-Ad: Categorized by eleven eXpurgate (R) http://www.eleven.de X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate: clean X-purgate-size: 2630 X-purgate-ID: 154282::1624216125-000001E5-C16CB518/0/0 Subject: [FFmpeg-devel] [PATCH] lavd/lavfi.c: Set time_base for 608 cc to container 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: ZO52IRu2whsp Hi, when transcoding 608 cc, the cc stream frame pts is set to the same value as its container frame's pts. However, the time_base is always set to 1/90000 (default) in the initialization stage. Which causes timing issues when the container time_base is actually not 1/90000. -Thilo From 98e48c5c34edaefd5a9310dab3803259efdfd502 Mon Sep 17 00:00:00 2001 From: Yun Zhang Date: Sun, 20 Jun 2021 21:08:00 +0200 Subject: [PATCH] lavd/lavfi.c: Set time_base for 608 cc to container time_base. Suggested-By: ffmpeg@fb.com --- libavdevice/lavfi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavdevice/lavfi.c b/libavdevice/lavfi.c index 57d977e..e07f20c 100644 --- a/libavdevice/lavfi.c +++ b/libavdevice/lavfi.c @@ -100,6 +100,7 @@ static int create_subcc_streams(AVFormatContext *avctx) LavfiContext *lavfi = avctx->priv_data; AVStream *st; int stream_idx, sink_idx; + AVRational *time_base; for (stream_idx = 0; stream_idx < lavfi->nb_sinks; stream_idx++) { sink_idx = lavfi->stream_sink_map[stream_idx]; @@ -109,6 +110,8 @@ static int create_subcc_streams(AVFormatContext *avctx) return AVERROR(ENOMEM); st->codecpar->codec_id = AV_CODEC_ID_EIA_608; st->codecpar->codec_type = AVMEDIA_TYPE_SUBTITLE; + time_base = &avctx->streams[stream_idx]->time_base; + avpriv_set_pts_info(st, 64, time_base->num, time_base->den); } else { lavfi->sink_stream_subcc_map[sink_idx] = -1; }