From patchwork Fri Sep 10 09:34:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Gaullier X-Patchwork-Id: 30107 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2a4a:0:0:0:0 with SMTP id k10csp1343934iov; Fri, 10 Sep 2021 02:34:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxq5VzawDZH8+wBFEEO8qlcmajmrp/NJ94KJAXCabi3ZzJ2KHlh0o3k+2Qwe+7Gcgonat58 X-Received: by 2002:a05:6402:1cb9:: with SMTP id cz25mr8112649edb.11.1631266466914; Fri, 10 Sep 2021 02:34:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631266466; cv=none; d=google.com; s=arc-20160816; b=ROg7ssRkolHx808lTK0rP0asODJuyyjqQjyggCrwAkaEKyPCo6zwSt9hIMF9zzq+e1 OxVUTJ0IbPKyha5JIOfVGkY1aBDLkpUR9/y0DkzY4naqac45/bCqAao4z6KdVIS17PZH wfxN504YIwJkUXG6wjs72v++IL/zaWYCv9PyxIrEOggniPicE13Yk7QkP9G8eqwI/Di9 xiGaVAK05V/LH+tYDVHdP/t37V3CzF1mrRY9LVR2kiOS6b+EGMJd42P4wh8dFupsV/+j xWRloIGZmdBxnJTnBBNP8Gx80OSe5peU0u6AHOA7H9R8JeIZlZnpftAL1oPysIjeBJHn aGMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc: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=P7MrnKJgCyu3TFa0L2TdzaxHLlCh05K5PepHBpQG8Uk=; b=UYhcVAyzHPGFjEM/+jnRzUsO6eWHspXu4gAbAhOr9T43HMzsmwU7d4qVUSAZEJ+jaV KsB4zYNRqysAaUOneBgCO7q90U1Q915vizjOZSgYGU4VuQa+57b99rZ6YYcAxbsJ7LVX ylbUktB9jVcGu5gaBpaPCsuaEQ//l5VFBjJXSoCS8K2+ZOI6KL/uDf4nOjITcos/+BvA jGKxogXEqvgcTrX1jnTu2H0IJLciwjezf2i7xqwBYLncpfVi0pp2yh/+Pg9pAqbnD+Ly eXdu09rSV2lSgwBvZ9/7g8BvQjCwtvPulpfNtZiSxYD8FEWRu2lyvJ5VXsYSJxSu5auD +s0g== 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 l7si6485565edb.409.2021.09.10.02.34.25; Fri, 10 Sep 2021 02:34:26 -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 6B27068A62A; Fri, 10 Sep 2021 12:34:20 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from srv-infra-1.infra.inf.glb.tvvideoms.com (www.inf.tvvideoms.com [213.205.126.156]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7779468A5E7 for ; Fri, 10 Sep 2021 12:34:14 +0300 (EEST) Received: from cji.paris (unknown [172.16.3.159]) by srv-infra-1.infra.inf.glb.tvvideoms.com (Postfix) with ESMTP id A7F6F27EEF; Fri, 10 Sep 2021 09:34:12 +0000 (UTC) From: Nicolas Gaullier To: ffmpeg-devel@ffmpeg.org Date: Fri, 10 Sep 2021 11:34:07 +0200 Message-Id: <20210910093410.47858-1-nicolas.gaullier@cji.paris> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 0/3] Detect field_order when probing MP4/H264 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 Cc: Nicolas Gaullier Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: pUIJ0vSsoSqi My use case is a typical ffprobe+ffmpeg scenario where there are many MP4/H264 progressive materials. I just want to avoid inserting a deinterlacing filter if it is not required. NOTE: many MP4 files don't have a 'fiel' box. I may be missing sth, but in my information, this is actually a quicktime atom, not an iso box... And looking at movenc.c, the writing of 'fiel' is conditionnal on the codec_id and disabled for H264. At the end, H264 extradata are not very rich, so parsing is required to get field_order. Patch 1/3 and 2/3 are improvements required to avoid regressions when applying patch 3/3. Seems to close definitely ticket #7157 whose current status is 'closed defect (needs_more_info)' Nicolas Gaullier (3): avcodec/h264_parser: Set AVCodecContext.framerate avformat/utils: Use r_frame_rate in compute_frame_duration if codec_framerate is unknown avformat/mov: Set AVSTREAM_PARSE_HEADERS flag for H264 libavcodec/h264_parser.c | 11 + libavformat/mov.c | 2 + libavformat/utils.c | 2 +- tests/ref/fate/h264-lossless | 18 +- tests/ref/fate/h264_mp4toannexb_ticket2991 | 238 ++++++++++----------- tests/ref/fate/mov-zombie | 2 +- 6 files changed, 143 insertions(+), 130 deletions(-)