From patchwork Thu Aug 27 13:12:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linjie Fu X-Patchwork-Id: 21949 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 44FD144B02E for ; Thu, 27 Aug 2020 16:33:26 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 221FE68A79B; Thu, 27 Aug 2020 16:33:26 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pg1-f195.google.com (mail-pg1-f195.google.com [209.85.215.195]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DE07768A760 for ; Thu, 27 Aug 2020 16:33:18 +0300 (EEST) Received: by mail-pg1-f195.google.com with SMTP id w186so3374578pgb.8 for ; Thu, 27 Aug 2020 06:33:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=4coWjLHhUu4/issrykvj2QQ+qhIHuBTQErAL1nBNMoY=; b=cmwtad9K111TwkCP5e/ZPTSYYlLFUVlfLRi/PiIUIx4647HTkKJN+Drt1Sl8dwQSdn L/svUtLXJfe2rTn6GnOVVjqyzgSWr8nqHxjuKeAk+TQEHoekc6OC8b+kaBMKyycJmoya GpJt1oN/in6LnsnG8daAn9PNbEVgTKlIPm/FeXl6UHu5VVcRfhBqD4b/h9iGHhp016Kk SRSZ+I7WiGclao8PepSWrmiTd+OVxI9v3JEtvh4NZLwUxPkP/yjw0Fj3pR2BytT28bx7 FSu1GfNNuQNQgY2Y4i0MnN87gLwk7aeizFTeFNjpxS25HkhMoDvoVaqIpNddyYnyFQjI csWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=4coWjLHhUu4/issrykvj2QQ+qhIHuBTQErAL1nBNMoY=; b=FtlkqUoa+/cSeUmL6Odf9S8Zzw0HvvyOqUXi841pQ3R3li0UC2WH+v+NivKfsr5ItL onqwyH3hZsO4D4+QZtiNg/QJll0WmsiSElYphD1lqYZaJGNY1hO6LgZJV52R3sfrJohV yoY8by9JFzbEgemeJQkP1cOLr9g6XKUIF9qtv4cJGHZDBfbCermHVCln9cz1jSLAXt0v JFJz6iietPBz6AhboHMDdHHBB88pE6L9GPvpWWoa+VzbaQlYHxcazIH2RO8GbuL1aFHd AdJ4CkGXK0YQDMHurWZZ0aTbbLT4gxXmMV+tJXgnv7kCkEtDUQB3WQhCvPxdQE+Z/7nU dZvg== X-Gm-Message-State: AOAM533n7DJEo3V54WQk2npxU0Ub08eTLy/OO+B1iTMJGxxwe6SS5bdQ QIS169VhRkAV2rurD4qVR7ao91x+YgQe3Q== X-Google-Smtp-Source: ABdhPJzcrdRBbm410/VE4SsAh2i5zf5p8lfKupxeNjdjcCum5bCCvwP0TF2aYlo34siv0okWjVWr+Q== X-Received: by 2002:a17:902:44f:: with SMTP id 73mr15976694ple.178.1598533956629; Thu, 27 Aug 2020 06:12:36 -0700 (PDT) Received: from localhost.localdomain ([47.89.83.10]) by smtp.gmail.com with ESMTPSA id b5sm1777499pgi.83.2020.08.27.06.12.35 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Aug 2020 06:12:36 -0700 (PDT) From: Linjie Fu To: ffmpeg-devel@ffmpeg.org Date: Thu, 27 Aug 2020 21:12:17 +0800 Message-Id: <20200827131217.23384-1-linjie.justin.fu@gmail.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] lavf/mux: allow unofficial extension by default for spatial data in mp4 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 Cc: Linjie Fu Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Mp4 unofficial extension allows Stereo3D and Spherical Mapping data in header if users explicitly set "-strict unofficial" or values less than "-1". Currently side_data like stereo3D and spherical data in mp4 would be dropped by default in a transcoding procedure even if user uses streamcopy to get the same bitstreams. Spatial data missing in containers seems to cause troubles for the players like VLC while detecting the projection type for 360 video. Set the default value of "strict" to "unofficial" for mp4. Signed-off-by: Linjie Fu --- I would prefer to add the default value for format-specific options in something like AVCodecDefault, however didn't find one. libavformat/mux.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libavformat/mux.c b/libavformat/mux.c index 44d5e5d1c0..ffb9109a6f 100644 --- a/libavformat/mux.c +++ b/libavformat/mux.c @@ -237,6 +237,11 @@ static int init_muxer(AVFormatContext *s, AVDictionary **options) const AVCodecDescriptor *desc; AVDictionaryEntry *e; + if (s->oformat) { + if (!strcmp("mp4", s->oformat->name)) + s->strict_std_compliance = FF_COMPLIANCE_UNOFFICIAL; + } + if (options) av_dict_copy(&tmp, *options, 0);