Which lossless video codec has the smallest file size? And what does incoding mean for videos?
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays!
+ Reply to Thread
Results 1 to 16 of 16
Thread
-
Last edited by Jay123210599; 25th Dec 2023 at 12:06.
-
Usually x264 or ffv1 , but it can depend on the pixel format and scenario
But if you're starting with a lossy source, using a lossless video codec will actually make the filesize many times larger - Because video is decoded to uncompressed data before re-compressing with the lossless codec. -
-
ffmpeg
Code:-c:v libx264 -qp 0
Code:ffmpeg -i input.ext -c:v libx264 -qp 0 output.mkv
No, lossless x264 uses P frames for temporal compression to reduce the filesize by default. If you wanted all keyframes, add -g 1 . Filesize will increase for the intra (all keyframe) version. Both versions will be significantly larger than a source version that used lossy compression -
-
I think you're asking the wrong question. Not all lossless is lossless, format matters.
What is the purpose here?
- intermediary?
- capture?
- archive?
The best is not the same for all.Want my help? Ask here! (not via PM!)
FAQs: Best Blank Discs • Best TBCs • Best VCRs for capture • Restore VHS -
Not possible.
Just as there are work projects which have 3 constraints (Fast, Cheap, Good/High quality) and you have to pick 1 or at best 2 of those constraints to prioritize, video & audio compression has similar constraints of size, quality, complexity, speed, latency, etc.
The very feature which allows for small sizes does so by being more complex in its Gop structure/length and in being lossy.
In other words, you cannot have your cake and eat it too. Or, there is no such thing as a free lunch.
ScottLast edited by Cornucopia; 26th Dec 2023 at 10:34.
-
Want my help? Ask here! (not via PM!)
FAQs: Best Blank Discs • Best TBCs • Best VCRs for capture • Restore VHS -
I have h264 and h265 videos that I want to losslessly cut into smaller parts, but there are certain sections that can only be cut at P or B frames instead of I frames. I'm also planning on converting said smaller parts into apng/gif files and uploading them into DeviantArt.
-
Can always try -g 1 as suggested by poisondeathray , but to make for a smaller
file, use it with something like CRF 14 and preset Medium. It's not lossless,
but it gives very good results and it's easy to edit since it's all "I" frames.
In a case like this, as has been suggested by many esteemed forum members,
you have to find the right compromise -
You don't need to encode using I frames for your scenario, because you can specify the exact section you want beforehand (e.g. mark in/out in vdub, or avidemux, or avisynth etc... ) and encode normally using long GOP ( I,B,P frames) , or for lossless - I,P frames only
Since it's already "marked" perfectly with the exact frames , there is no reason to export using I frames, unless you plan on cutting that segment again later.
Typically I-frame only would require 25-50% more bitrate (thus larger filesize) for a similar level of quality compared to long GOP . If you take the sample clip you uploaded in the other thread, I-frame lossless 10bit444 x264 is 300MB, long GOP lossless is 221MB. Both lossless . You would see similar trend for minimally lossy and lower bitrate ranges (correlating them with some "quailty" measure , such as VMAF, PSNR , SSIM)
For the the apng or gif scenario, then vdub2 can trim to the section and export those directly as well , if you didn't want to keep the video segment or intermediate step .
Apng encoding does not have that many materially different options, but there are dozens of gif optimization strategies. Because gif can only have 256 colors, there are many pallette optimization and dithering strategies . For that reason , you might not want to use vdub2 for gif creation since vdub2 doesn't have very many gif optionsLast edited by poisondeathray; 27th Dec 2023 at 22:01.
-
-
long GOP is the default setting for x264, x265 .
If you don't change -g in ffmpeg or the max keyframe interval. Default is 250 already instead of 1 . ffmpeg should use the same pixel format is input
For your 10bit444 case , in vdub2 you'd have to select x264 10bit, YUV444 (normall it would be set to 420), rate control single pass - lossless . Or if you didn't want lossless, but some high quality but smaller filesize, use some low crf value instead . Do some tests to see what is an acceptable tradeoff for filesize vs. quality. But Long GOP is a must for reducing filesize at a given quality level if that was your main goal
-qp 0 is lossless for libx264 in ffmpeg for all libx264 supported pixel types . -crf 0 is not lossless for 10bit, so use -qp 0
For ffmpeg libx265 , you need -x265-params lossless=1
Similar Threads
-
lossless 4.2.0 video to lossless 4.2.2 - any issues?
By spicediver10191 in forum Video ConversionReplies: 21Last Post: 10th Jun 2023, 01:00 -
Lossless Audio
By musia in forum Video ConversionReplies: 2Last Post: 14th Mar 2022, 01:18 -
Does anyone here know how to use these lossless codecs?
By Guernsey in forum Newbie / General discussionsReplies: 16Last Post: 25th Jul 2021, 17:17 -
Quick sanity check: Lossless to lossless encoding HuffYUV to UTVideo
By nicholasserra in forum Video ConversionReplies: 2Last Post: 20th Aug 2020, 11:41 -
FFMPEG - hevc_nvenc & h264_nvenc lossless presets not truly lossless?
By AnomalyDetected in forum Video ConversionReplies: 5Last Post: 27th Oct 2019, 02:24