From patchwork Tue Jul 4 17:26: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: 42432 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1e:b0:12b:9ae3:586d with SMTP id c30csp5252103pzh; Tue, 4 Jul 2023 10:26:21 -0700 (PDT) X-Google-Smtp-Source: APBJJlFIqQuiGlswnxlqBqfYXwUB0vnGd0Yn4YPiP5SIRLRoihGpv9tBAZ1UKMIcPtxfNlNWkSGj X-Received: by 2002:aa7:d50e:0:b0:51e:22db:813 with SMTP id y14-20020aa7d50e000000b0051e22db0813mr1691494edq.22.1688491581433; Tue, 04 Jul 2023 10:26:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688491581; cv=none; d=google.com; s=arc-20160816; b=SbVYYX6GpdiNyhQicvo1jeCENJI/Hvs+bkt7zsliIh2efEikUXtj8AzZv4xqWhsQsQ xikCahhYWw75fcvMJF6+c2XmqdaOGx6Alu7oEktgOf1mPk11XVcQojm9pfST6Soo5Jmx OZAyJJ6d2QbYum9O92EJChIyefk3tEpHo/rKnWeFfZkRnSjTym9Dk2cSbaax1eC7BVy/ V+6ieOVNVPtsIHRjJSi4o8WdwTQtVTK8WKL7egkFItu17cSGmC2FwH6GoMJ4ZmX3jkVj TtBX53a3pfA41SYM6+n7C9LeObht5eFk7CncGu+nF1IWNB3ylLRpfb43F+0oqsHIJMA8 nHNQ== 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=mmWYxbGQM/UAdDL+A+4AB36QKCry7dbvQYfTIRYdaUU=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=HM+GMusCBwOldNCM7uqH8IGPIP5KgnDvZebSFWCBO1UHkOtGFvvB0UyAzAl2hzQonK C4H9bEGPniyXcX4mA5MDePyBNkSTuOKlh+m3MCbuCkVsGd/t9VMffLxt1ddwKTQBVR3X KcfCnklO1qDqjg86upnbvIHysOBOlKpeepEG7Il6JNxTFIrx/Sv4IJuOSh+110Yr6drG efdJViYwdEtiZ3DrFZXxqhBJnUfsgaA+LPxDiuC/leMZdZuryBVKWHiu4fEWCHbLnhx2 X6jij+wZFw+0PKJnUQHqHHxnTGW47pau6aMk9aoCdIoN7cQ6w3s2loH7a2T8Eyd+wPpi 5aRQ== 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 be5-20020a0564021a2500b0051dd487b0d6si7527300edb.361.2023.07.04.10.26.20; Tue, 04 Jul 2023 10:26:21 -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 8E3A568C39F; Tue, 4 Jul 2023 20:26:16 +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 2B45F68C39F for ; Tue, 4 Jul 2023 20:26:10 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id BEDD22404EE for ; Tue, 4 Jul 2023 19:26:09 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id AEZXPlVkzsE7 for ; Tue, 4 Jul 2023 19:26:07 +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 3294A2404EC for ; Tue, 4 Jul 2023 19:26:07 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id DC4333A0F6C for ; Tue, 4 Jul 2023 19:26:06 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Tue, 4 Jul 2023 19:26:03 +0200 Message-Id: <20230704172604.15781-1-anton@khirnov.net> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/2] lavc/dvdec: export bitrate 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: cSrlupkN/m/u Changes the result of fate-mxf-probe-dv25, where the bitrate is now exported. Also changes the result of fate-bsf-dv-error-marker, where the exported bitrate is now different. Note that the codec layer bitrate does not match the container bitrate, because container timing is 25fps, while the DV profile is 50. --- libavcodec/dvdec.c | 3 +++ tests/fate/dvvideo.mak | 2 +- tests/ref/fate/mxf-probe-dv25 | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/libavcodec/dvdec.c b/libavcodec/dvdec.c index 750e25a4af..c57578a208 100644 --- a/libavcodec/dvdec.c +++ b/libavcodec/dvdec.c @@ -650,6 +650,9 @@ static int dvvideo_decode_frame(AVCodecContext *avctx, AVFrame *frame, frame->pict_type = AV_PICTURE_TYPE_I; avctx->pix_fmt = s->sys->pix_fmt; avctx->framerate = av_inv_q(s->sys->time_base); + avctx->bit_rate = av_rescale_q(s->sys->frame_size, + (AVRational) { 8, 1 }, + s->sys->time_base); ret = ff_set_dimensions(avctx, s->sys->width, s->sys->height); if (ret < 0) diff --git a/tests/fate/dvvideo.mak b/tests/fate/dvvideo.mak index 24e50ca357..33686d7762 100644 --- a/tests/fate/dvvideo.mak +++ b/tests/fate/dvvideo.mak @@ -1,7 +1,7 @@ fate-bsf-dv-error-marker: CMD = md5 -i $(TARGET_SAMPLES)/dv/dvcprohd_720p50.mov -flags +bitexact -fflags +bitexact -c:v copy -bsf noise=100,dv_error_marker=color=blue -f avi fate-bsf-dv-error-marker: CMP = oneline -fate-bsf-dv-error-marker: REF = 4e884d3e8045299d0d45ec920fa58a44 +fate-bsf-dv-error-marker: REF = 3190a334b1ceef2d9fd050a1590da7c6 FATE_DVVIDEO-$(call ALLYES, MOV_DEMUXER DV_ERROR_MARKER_BSF NOISE_BSF AVI_MUXER) += fate-bsf-dv-error-marker FATE_SAMPLES_FFMPEG += $(FATE_DVVIDEO-yes) diff --git a/tests/ref/fate/mxf-probe-dv25 b/tests/ref/fate/mxf-probe-dv25 index 8b12a17838..f89357e191 100644 --- a/tests/ref/fate/mxf-probe-dv25 +++ b/tests/ref/fate/mxf-probe-dv25 @@ -31,7 +31,7 @@ start_pts=0 start_time=0.000000 duration_ts=25 duration=1.000000 -bit_rate=N/A +bit_rate=28800000 max_bit_rate=N/A bits_per_raw_sample=N/A nb_frames=N/A From patchwork Tue Jul 4 17:26: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: 42431 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1e:b0:12b:9ae3:586d with SMTP id c30csp5252193pzh; Tue, 4 Jul 2023 10:26:31 -0700 (PDT) X-Google-Smtp-Source: APBJJlHguPSoGZ5AyMRsoZTy8xkUbYheA4xQMoMyZhfBpBDsroZgU4HmmqJmS1OWkBgdnH77icYd X-Received: by 2002:a2e:b052:0:b0:2b4:6ca3:7747 with SMTP id d18-20020a2eb052000000b002b46ca37747mr9661112ljl.28.1688491591437; Tue, 04 Jul 2023 10:26:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688491591; cv=none; d=google.com; s=arc-20160816; b=iOVTYuNa8us+hI4+rr/PIH4pbR24V1C94DNvFdUb3GK9S6M6B7emOY8FWzWmKw/Ku3 JHDPS9PgLW4qoFyhxk7gXCgX9mH+QPKbTc3Sz2EXQw59Eu0H9L+g/o4lHsiEnrgkkNdB p/Fp9RU9oA/qU/B9z+5NYr63y9wOM3M3XHzYMpOaCXjzkgn7ypDZ50aplEPI62clsa5C QNnF4q9N4NNzja2o9H019xDmz6ztsE3ybxaAw7eZ88tECO6ziGtkUnjMS4xvKw5J8UiE 4pEfF9K4tkrZ8kld8eSGLBYC0NlQ7+zX/Ve44opv3zQvWHv8ItxR1u0k30MZLbfc5pit 2hEA== 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=D85oMVgn42GqutGBl/n+nAPB2M3dBf0l1QOfbtDygK4=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=fimgS38xZBxF+jRXSMLg6mTSGs3qFjbiPg6EIWOVFeh0cFLapNvd6Jb/C+SMxxH1Ta GQt9XxUfsDHlcf4OtnK9FPFWtcS20Z/n9+vBguSL8WLP/yiXz7nzFhCnx6iA5rwqXDKe OG5DigC9UQ/r5gPYRlMyNnf4iXUyjvC4AlFuC/5qVUcnERACBCjX2jGrsnOzeJnVVlOo MBobMf+uwA9IZZvMBgGp3cZu81CGIf+ZNo0mnJQhXRUeKL4cc0QQDctIrtXterUBXb+F nB8zGr0NERhnR6kHQ85ZVNMlM30CDs341s1IUAx4/ZSyqv/9QhewKRXSYwiKwzpYp1k2 EIYw== 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 s11-20020a170906060b00b009659573b4e3si13197948ejb.51.2023.07.04.10.26.30; Tue, 04 Jul 2023 10:26:30 -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 9C87E68C5F7; Tue, 4 Jul 2023 20:26: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 15FCF68014E for ; Tue, 4 Jul 2023 20:26:11 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id CE4C32404EC for ; Tue, 4 Jul 2023 19:26:10 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id xuhNvhRAY88k for ; Tue, 4 Jul 2023 19:26:07 +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 3093A2404EA for ; Tue, 4 Jul 2023 19:26:07 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id E90AC3A0F81 for ; Tue, 4 Jul 2023 19:26:06 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Tue, 4 Jul 2023 19:26:04 +0200 Message-Id: <20230704172604.15781-2-anton@khirnov.net> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230704172604.15781-1-anton@khirnov.net> References: <20230704172604.15781-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/2] lavf/dv: stop setting a random video bitrate 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: brPQbJGaUi8n A real value is determined from the bytestream. --- libavformat/dv.c | 1 - 1 file changed, 1 deletion(-) diff --git a/libavformat/dv.c b/libavformat/dv.c index d01ecedc62..6df93fe416 100644 --- a/libavformat/dv.c +++ b/libavformat/dv.c @@ -358,7 +358,6 @@ static int dv_init_demux(AVFormatContext *s, DVDemuxContext *c) c->fctx = s; c->vst->codecpar->codec_type = AVMEDIA_TYPE_VIDEO; c->vst->codecpar->codec_id = AV_CODEC_ID_DVVIDEO; - c->vst->codecpar->bit_rate = 25000000; c->vst->start_time = 0; avpriv_set_pts_info(c->vst, 64, 1, DV_TIMESCALE_VIDEO);