From patchwork Mon Jan 31 13:51:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Gaiser X-Patchwork-Id: 33953 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2c4e:0:0:0:0 with SMTP id x14csp2740599iov; Mon, 31 Jan 2022 05:52:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJzVkGs2+aZTknObO3IiMYKEEJy+jqXAVhPOWpTWmZyqLWeG9Qr8e0jPb+t4f964HN76GcNA X-Received: by 2002:a05:6402:2549:: with SMTP id l9mr8501716edb.129.1643637169449; Mon, 31 Jan 2022 05:52:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643637169; cv=none; d=google.com; s=arc-20160816; b=mJ/gmfX9HJAodFvcsl/aSjMlVAWJXpViOPbGTWDxFRw1SGxGAKpgRtVtn+LMfBOsFg B87q/d45ZBtitz0zZSq1k2vxoxF9sOVkk/vC7nILFp9AcEGFeH5CudAYhEU8/bxytQ6j IbBSjvdueKEKO8zBe2ClzFBe/IE6sYSrRn2YNu8YOV+iHSgHVFrdl2Dr9fcUWpfhw9MX DA6Jet3RGbsEWBLsRaQxcGJ34bSrUk1/3YTyP7H0k75W3dsNzRm2an5HwMldwY+qyzto ItkaGT++WSVD6HJ5ZFG/mbFkRJetvfaVtfYxifInLv8jYN8L8d3RUuJ4hsPMeTGXd7zG PY9A== 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 :dkim-signature:delivered-to; bh=wBTLQUXJ+HL/ld9xEeVRXopsqITD92bmMZSl6J4iVIw=; b=CNJ0ZvEqZ3ZN736a63IAcvWddaTzPi7tntXQlPK3r4uToDd+rf26Iid4uDIj5oHrXL WOYhYt4JKZY8uDdNnUQ1wwvG/agpBeq3x7cOZeVeAGNck/9Lq7y8Q/izDan6s03MyfmX 8wW5CE/6VcZ8FNwtRvKfrPW27De2wz/SodqpXHiet1hMiKvrLm+Q0iX1OeT1+26fCp+H pp1aqjyF4pMNlSpIN3GIH81TN491ZcHVMrBQTbN67vrebhK74Dolwx/QFIlIn8ZIyspX JSGhDf5SUii8c6SG/A/m9Ay6qtJ1p/gZVOI7yqhGZhCuLKrVMWQ2JXS+k7kP9fIl4+Bq 2BYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=HT9waznP; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id fj1si8502996ejc.948.2022.01.31.05.52.48; Mon, 31 Jan 2022 05:52:49 -0800 (PST) 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; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=HT9waznP; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 65CD568B2A1; Mon, 31 Jan 2022 15:52:45 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.48]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3207768B14E for ; Mon, 31 Jan 2022 15:52:38 +0200 (EET) Received: by mail-ej1-f48.google.com with SMTP id ka4so43196424ejc.11 for ; Mon, 31 Jan 2022 05:52:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=yqF2hPphh0RWzpJT0LVTDoze1aCXksdHUtGYoMC5+bE=; b=HT9waznPUyvikdQDwxFTzHofqjsrfd6+TaVFP0lc8rq689/WAXhvA2ez841/RDmAoM bZ21qBsB7X9npshPPrljnsi5HRPosbmEssDYqBpVSXFon2Lq16WaOSfset80n4FETbDp yZ/M/zEtGC3omq+6qpZGlSRrZjroivavTWYAhhBqkfE/pW4x+A6rnKNKHq03ei9cAiWR jZVVkQmtblIju07lLW5ya5x3+Lv9Qrx3cjwu/4Ufgw0SWY/A4ptkxY8Imk4oyf8SOxGI 2E00xTEi/+zbxegFXpt9HX/bvGZIAAQqqhUMxzCNN312UooffntchtyMGhG65BzP/j0G Pvcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=yqF2hPphh0RWzpJT0LVTDoze1aCXksdHUtGYoMC5+bE=; b=oL0ig6jlvUcSDX9YeeHlpmnIlhBMHayaPWnYFQo9mRQtrl4DaAv9e9Ibn9UpxqfOQ+ hn3ksT9iXEG0cyOJSoVvYu929MMwxE5hbQnkDVuMLcj33JiNKUqlzB1DzXN2aTSPxrOr G1zFcuZ4NiLzWRTxoPH5yWLJcwE5/pR94j0s8j+XRPzpWiMY+kHJITolviKtXT/boHVu mRkQVtnbzf7o07oQAO9dix4t8bAlM3lLHrKpDuOeRqr06xna64RKlZHGTP1KBB1LkHwN aclUAwyfdmALUYu/4rQH26w5wYCmszvn5RyHqastnTBL1wI5xpv/SQ+zuiiA3QkJdL9L dpig== X-Gm-Message-State: AOAM532AxSxwwLmjG0RYEZP+SHobTZQC0diUtMshLmetkeTAJzuJ6DhI qpzHH2neA272hP9C4qvR2sdSOCnRikqIwQ== X-Received: by 2002:a17:906:99c1:: with SMTP id s1mr13081022ejn.298.1643637157295; Mon, 31 Jan 2022 05:52:37 -0800 (PST) Received: from localhost.localdomain (ip60-253-211-87.adsl2.static.versatel.nl. [87.211.253.60]) by smtp.gmail.com with ESMTPSA id l19sm5431885ejq.139.2022.01.31.05.52.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jan 2022 05:52:36 -0800 (PST) From: Mark Gaiser To: ffmpeg-devel@ffmpeg.org Date: Mon, 31 Jan 2022 14:51:11 +0100 Message-Id: <20220131135116.14035-1-markg85@gmail.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 0/5] Add IPFS and IPNS protocol 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 Cc: Mark Gaiser Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: u3tBQ14CQ/Mt Hi, This patch series adds support for IPFS. I've been adviced to keep the patches as they are (split). If needed, I can squash them to a single patch. The following is a short summary. In the IPFS ecosystem you access it's content by a "Content IDentifier" (CID). This CID is, in simplified terms, a hash of the content. IPFS itself is a distributed network where any user can run a node to be part of the network and access files by their CID. If any reachable node within that network has the CID, you can get it. IPFS (as a technology) has two protocols, ipfs and ipns. The ipfs protocol is the immutable way to access content. The ipns protocol is a mutable layer on top of it. It's essentially a new CID that points to a ipfs CID. This "pointer" if you will can be changed to point to something else. Much more information on how this technology works can be found here [1]. This patch series allows to interact natively with IPFS. That means being able to access files like: - ffplay ipfs:// - ffplay ipns:// There are multiple ways to access files on the IPFS network. This patch series uses the gateway driven way. An IPFS node - by default - exposes a local gateway (say http://localhost:8080) which is then used to get content from IPFS. Much of the logic in this patch series is to find that gateway and essentially rewrite: "ipfs://" to: "http://localhost:8080/ipfs/" Once that's found it's forwared to the protocol handler where eventually the http protocol is going to handle it. Note that it could also be https. There's enough flexibility in the implementation to allow the user to provide a gateway. There are also public https gateways which can be used just as well. After this patch is accepted, I'll work on getting IPFS supported in: - mpv (requires this ffmpeg patch) - vlc (prefers this patch but can be made to work without this patch) - kodi (requires this ffmpeg patch) Best regards, Mark Gaiser [1] https://docs.ipfs.io/concepts/ Mark Gaiser (5): Early version of IPFS protocol support. Fix up IPNS support. Merge IPNS and IPFS handling. Implement logic to determine the IPFS gateway. Fix review feedback configure | 2 + doc/protocols.texi | 30 +++++ libavformat/Makefile | 2 + libavformat/ipfs.c | 283 ++++++++++++++++++++++++++++++++++++++++ libavformat/protocols.c | 2 + 5 files changed, 319 insertions(+) create mode 100644 libavformat/ipfs.c