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 3E26442A09 for ; Fri, 10 Jun 2022 23:37:40 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7C74F68B553; Sat, 11 Jun 2022 02:37:37 +0300 (EEST) Received: from mail-vs1-f51.google.com (mail-vs1-f51.google.com [209.85.217.51]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8073768B2AF for ; Sat, 11 Jun 2022 02:37:31 +0300 (EEST) Received: by mail-vs1-f51.google.com with SMTP id x9so641707vsg.13 for ; Fri, 10 Jun 2022 16:37:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=+5jSt8K3F2pOTt14+NnNsWQgjjdFB6IpmheH/z8P+ck=; b=LocdMMaNBE+EGFUXq3DnSQ280jLRIwirc07fhMEawg5J6VkeVpvPRfIGRjox7uJIrL aM1Bi95fLSwPrF7hnYRGirdtIM85flDHmAkpschxBBuKd4eh8eDVajRfjUA4tuGOQ9Gi mIwkAqoVFCgrqfb0iMzLAn8zetdBOFZMpfn4I04dXADL0PepWUIwbPiyypgWahSjorkP 3228uVxXspVf3XvjeLsrb/L+S4a4fs8ynDMJJnA94u4WXG0xMcXDC79bblEWer7ue9d9 KnzgaVgIDp2VOnb1DLKTvUdLRfep5OjdL1T4n8avgjQV3bXVeNiWBQ09gaqdspBuBf4X sz2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=+5jSt8K3F2pOTt14+NnNsWQgjjdFB6IpmheH/z8P+ck=; b=2cZz/w2q1Atax3oI+Khx5eG2S0sa3itzlzWc0uB3fi/lVdEgCmDfTs62fJ8Cz7vSQD TVJYg4rps5VUQX6VtJgvzCIT9fD2lwodIvBOMc1Eq6utSPevr5r8tNi7gtwJvvxxnyjJ MOCEcCi5lRww4Q0NznxzPBgWlQeZSiYCtVmwAVeWnI0KA2YBFL6Q1SaNXMHlrwuRKInX HDJIacoGDWCcDr2jjwLgHbh6MbfZafss0TzJTooIxcisahH4fcxVZNDfvEiVB6mOaVKK eb+jxxrC6hCbVo2ABegHBqK483n7e/uAv3thPLJw8DWW59TG0WqJPiwfSqp+Fry/ZDaA XwEg== X-Gm-Message-State: AOAM530aMLMCmaR5+hd63ObQwijXp0o5OyVcx+uftIyo/VexIUAPX67w 9/uMzpbHbMezZ6BC2dVPG4f/caGArIX+6ikGIYatifpQTm0= X-Google-Smtp-Source: ABdhPJzxO4alfVU2P5oVFlIYCVE51OavtsUHjWggCTp+mQnOYLjfg23eq3BxtO7cdBzBAcA3Vk6T6JumNJ6KYJx5aho= X-Received: by 2002:a67:f797:0:b0:34c:3cb:8508 with SMTP id j23-20020a67f797000000b0034c03cb8508mr5915956vso.34.1654904250115; Fri, 10 Jun 2022 16:37:30 -0700 (PDT) MIME-Version: 1.0 From: =?UTF-8?B?0JDRgdC60LDRgCDQodCw0YTQuNC9?= Date: Sat, 11 Jun 2022 02:37:19 +0300 Message-ID: To: ffmpeg-devel@ffmpeg.org Subject: [FFmpeg-devel] Trivial codec based on QOI and zstd compresses better than all lossless ffmpeg codecs on my data from screen 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: Hi. I use Debian Linux. I always capture my screen. I do this using my own program, which takes rgb24 frames from X server and saves them lossless in my own format. At fps 4 (but duplicate frames are dropped). My codec is absolutely trivial (and lossless), it is based on ideas from QOI ( https://github.com/phoboslab/qoi ) and QOV ( https://github.com/wide-video/qov ). First I apply something like QOV encoding (with interframe coding) and then compress every frame using zstd with level 8. Surprisingly such trivial codec performs very well on my data. It gives better compress ratio than all lossless ffmpeg codecs I tried (x264, x265, vp9, av1, ffv1, ffvhuff, flv). I write this not because I want to brag. I write this because it is possible that you will be interested in my ideas, that you will incorporate my ideas into your code. ffv1 spec reads: "FFV1 is designed to support a wide range of lossless video applications such as... screen recording..." Unfortunately, ffv1 turned out to be bad compared to my codec on screen recording data, so it is possible ffv1 could benefit from my ideas. Now let me show you some data. I have a test video named "test-video-2022-05-16-17.mkv" in lossless x264 fullhd, which was captured from my screen. Uncompressed PAM size is 208,268,339,335 bytes (208.2 G). Unfortunately I cannot share it, because it contains a lot of my personal info. Now let me show you how different codecs perform on this file. All data was collected with this premises: pix_fmt is rgb24, everything is lossless, gop is 32, everything is on aws ec2 c3.4xlarge with 16 cores, everything on Debian sid with sid's version of ffmpeg. Codec: x264 Command line: ffmpeg -loglevel warning -i /tmp/t.mkv -pix_fmt rgb24 -c:v libx264rgb -preset veryslow -qp 0 -threads 16 -g 32 /tmp/out.mkv Size: 2506211845 (~ 2.5 G) Time: 1218.22 Codec: ffv1 Command line: ffmpeg -loglevel warning -i /tmp/t.mkv -c:v ffv1 -pix_fmt rgb24 -level 3 -threads 16 -g 32 -context 1 -slices 4 -coder -2 /tmp/o.mkv Size: 9431473324 (~9.4 G) Time: 1125.15 Codec: my codec (single threaded!) Command line: ffmpeg -loglevel warning -i /tmp/t.mkv -c:v pam -pix_fmt rgb24 -f image2pipe pipe: < /dev/null | /tmp/nrdy encode 8 32 Size: 1860479127 (~1.8 G) Time: 470.88 So, as you can see my codec beats ffv1 and x264 both by compress ratio and speed. Moreover, my single-threaded codec beats other multi-threads codecs by time. Are you interested? If yes, I can share my code. Of course, under some permissive license. Again: there is no any magic here, just something like QOV + zstd. Also, I can specially extract some sample from my videos, which doesn't contain personal info, and perform tests on this sample and publish sample _______________________________________________ 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".