From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 7E7AF43F89 for ; Mon, 21 Nov 2022 16:23:18 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3CF0A68B1B3; Mon, 21 Nov 2022 18:23:15 +0200 (EET) Received: from out203-205-251-73.mail.qq.com (out203-205-251-73.mail.qq.com [203.205.251.73]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E41F868AF9F for ; Mon, 21 Nov 2022 18:23:08 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1669047785; bh=Cmbv8Q1RafvXz2jGFOvIMFXnEQC+UmrEcQg6QJyDceg=; h=Subject:From:To:Date:In-Reply-To:References; b=ciFjbaxVoglZpzpupiahOe/BrXR9GLUB5sskGVHVnPAQ4X+4lMr8PyFwjOSvjZYLc iXk10PolOZMzN6l0yHjzkTQVTqb8xfrVmR/BrTlpFPiQhfaK+lK0ekKDkNiUDERjrT 7P2owMY77b2KffXZ4Oc4jPxsxO5B6lVnGqIEej2M= Received: from zhilizhao-LC4 ([14.153.77.200]) by newxmesmtplogicsvrszc1-0.qq.com (NewEsmtp) with SMTP id 5C4254AE; Tue, 22 Nov 2022 00:23:04 +0800 X-QQ-mid: xmsmtpt1669047784t4y1a53v5 Message-ID: X-QQ-XMAILINFO: Mdc3TkmnJyI/7MExkkowN2OM89DxojHZFJPXfIq9qcnqoFdbbG7CRJTn9Rd/Tq yAQovZrTkr089imUW/+LZepjXqVcuTNehmeIlalqGQd3Vy4dR+mYq1fsoPRTmh1nvmRTFY68WgPm lz5MHa7PVsk7CvpfnnlUewLNZZJIZLXcIk/zjlYc3CKtHb4WjjAoL6WRg79m8D6Yp0qiASLuWOZm ZiuBOfd299XHTVvmtjBMSFMs3rEr7Ly2xw7KUfDNF1qEnN4jo2btC8BE9uFuvBGoNIcQijDe6OhB 3TT8Sa1bAjpNFEATYFgOUASCOe06V5YKMZsxlg3Nqd0fKj/sMQLo1bxDJm0AA8druVP+2UtoXkIk 0Zr4OKyNMCGMpGoVLebkhCoq5cW1t8HHFDzlso3GWIPj+/jvuTG7Ut/5jGVYJmoJyEJkZDZNPytW hT42rwlTKnKhymmMqSMFkjaeQ1PJ19nKnw6Bno6FmSJsG2v0q45oY/IBJOANfwobOFPoHrA+fFdz o1gIZxTXkgrVi/vpzZ6khyo+f+aTqQgTGhevhz85ARv2+AVvBm11WEKFUcCt1zm5N1LIHKRV84j3 bbVG2pvY180IsnP1sP1LsfVYvdN4Bf1y075qRtPxi91itcbv0M8ya4/QMCOZjVFxul/6BzdGP8t0 IaGbbFc5fPG0JdPnXXBptJt7Om4NNTWEmSsiQeiX86BfuZ5VqAPjS2Owk58dGK/KNAZE9IKLwYrn muB82pNhHyEYxawKN613E9NtHK5eUYTDZXmVuM2ap0xZi4/ywlU8AfEwnzlXKBVe6D2apGHiHdaX xNm0tnNvfMOCwlCSc/x/IHtHqOMnVCLqc1L8kxGrIArGWUZnlmE5Ut4DyGWE1cDhbBViSy4keMIA zzhMxVCCvVHNa6Qz6v0fw+hQqD69MJksqU0T2ZT2ooOPZIV6fiCicfKFvk8hC9rOOJkd7N2s41wX GJL68h+RA= X-OQ-MSGID: From: Zhao Zhili To: ffmpeg-devel@ffmpeg.org Date: Tue, 22 Nov 2022 00:23:04 +0800 In-Reply-To: <6d2f54dd-88a0-45aa-a795-96b3cef69c70@EX-SZ069.tencent.com> References: <6d2f54dd-88a0-45aa-a795-96b3cef69c70@EX-SZ069.tencent.com> User-Agent: Evolution 3.36.5-0ubuntu1 MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [Internet][PATCH v2 00/12] Add MediaCodec encoder and NDK MediaCodec support 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On Sun, 2022-11-20 at 14:49 +0800, Zhao Zhili wrote: > From: Zhao Zhili > > > v2: > > Rebased on master. > > 01/12: Use crop-width/crop-height as fallback and add TODO. Co- > authored-by: Aman Karmani > 07/12: Fix libavcodec/version.h conflict > 10/12: Change default i-frame-interval to 1 and add log message; bump > minor version > 12/12: Fix rebase conflict > > > v1: > Firstly, some bugs were fixed (patch 1-4). > > Patch 5 and 6 make mediacodec_wrapper support Java MediaCodec and NDK > MediaCodec. The use case I'm considering is run FFmpeg on cmdline > without JVM, > for example, run FFmpeg inside of termux (an Android terminal > emulator). It's > well known that NDK MediaCodec missing some important functions, like > get the > list of codecs, but still useable. > > Patch 7 add NDK MediaCodec decoder support. It can be enabled via > options, > and enabled automatically if no JVM is available. > > Patch 8 add ANativeWindow support to hwcontext_mediacodec. It can be > set by > user, and can be created via AMediaCodec_createPersistentInputSurface > automatically. This is a preparation for encoder. > > Patch 9 makes MediaCodec decoder to support ANativeWindow directly. > It worth > to note that AVMediaCodecContext has only surface. Although we > provided > av_mediacodec_alloc_context(), we didn't strictly prevent users to > allocate > AVMediaCodecContext on stack. I'm not sure if it's OK to add new > field to > AVMediaCodecContext. > > Patch 10 add MediaCodec encoder support. Frame can be feed to encoder > via > buffer, or via Surface/ANativeWindow. If Surface/ANativeWindow is > used, and > the frames come from our MediaCodec decoder wrapper, we can control > it's > 'render' (send to encoder's surface) via > av_mediacodec_release_buffer(). A DTS > generation strategy works in this case. However, if frames comes from > other > sources, like a camera, there is no way to control the 'render' yet, > so DTS is > missing in this case. > > Finally, we can do mediacodec transcoding with FFmpeg cmdline on > Android. > More importantly, we can do MediaCodec decoder to encoder without > copy frames, > although it's very limited since most of avfilters doesn't work. For > example: > > ./ffmpeg -hwaccel mediacodec -hwaccel_output_format mediacodec -i > /sdcard/test.mp4 -an -c:v h264_mediacodec -y /sdcard/out.mp4 > > Since there is no real AVHWFrameContext implementation in > hwcontext_mediacodec. > there is no hwframe_ctx for mediacodec and av_hwframe_transfer_data() > doesn't > work. So if -hwaccel_output_format isn't being specified like: > > ./ffmpeg -hwaccel mediacodec -i /sdcard/test.mp4 -an -c:v > h264_mediacodec -y /sdcard/out.mp4 > > It will trigger a crash in av_hwframe_transfer_data. Patch 11 add a > check on > hwframe_ctx. Patch 12 set hwaccel_output_format automatically to > avoid such > case. > Applied. _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".