From patchwork Mon Dec 2 09:05:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?J=C3=B6rg_Beckmann?= X-Patchwork-Id: 16529 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 B1F8B448E28 for ; Mon, 2 Dec 2019 11:05:41 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8B42268ADCD; Mon, 2 Dec 2019 11:05:41 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail01.scisys.de (mail01.scisys.de [194.231.52.239]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 71B7568AC85 for ; Mon, 2 Dec 2019 11:05:35 +0200 (EET) Received: from mail01.scisys.de (localhost.localdomain [127.0.0.1]) by localhost (Email Security Appliance) with SMTP id 913B73891C5_DE4D3DEB for ; Mon, 2 Dec 2019 09:05:34 +0000 (GMT) Received: from CITBO-EX01.vcs.de (citbo-vlm-int.vcs.de [172.17.2.200]) by mail01.scisys.de (Sophos Email Appliance) with ESMTP id 3E0AE387600_DE4D3DEF for ; Mon, 2 Dec 2019 09:05:34 +0000 (GMT) Received: from CITBO-EX12.vcs.de (10.148.80.20) by CITBO-EX01.vcs.de (172.16.16.21) with Microsoft SMTP Server (TLS) id 14.3.468.0; Mon, 2 Dec 2019 10:05:34 +0100 Received: from CITBO-EX12.vcs.de (10.148.64.22) by CITBO-EX12.vcs.de (10.148.64.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1531.3; Mon, 2 Dec 2019 10:05:33 +0100 Received: from CITBO-EX12.vcs.de ([10.148.64.22]) by CITBO-EX12.vcs.de ([10.148.64.22]) with mapi id 15.01.1531.003; Mon, 2 Dec 2019 10:05:33 +0100 From: =?iso-8859-1?Q?J=F6rg_Beckmann?= To: "ffmpeg-devel@ffmpeg.org" Thread-Topic: [PATCH] Patch for memory optimization with QuickTime/MP4 Thread-Index: AdWo7RNXG0ouYV7VQ6ipI/WfziiDpQ== Date: Mon, 2 Dec 2019 09:05:33 +0000 Message-ID: Accept-Language: en-GB, en-US Content-Language: de-DE X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.16.166.10] MIME-Version: 1.0 X-SASI-RCODE: 200 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 Subject: [FFmpeg-devel] [PATCH] Patch for memory optimization with QuickTime/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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Hi, this patch invents a new option "discard_fragments" for the MP4/Quicktime/MOV decoder. If the option is not set, nothing changes at all. If it is set, old fragments are discarded as far as possible on each call to switch_root. For pure audio streams, the memory usage is now constant. For video streams, the memory usage is reduced. I've tested it with audio streams received from a professional DAB+ receiver and with video streams created on my own with "ffmpeg -i