11 ms·
Comparing H.265 (HEVC) and H265 video file size
- miles 6y ago> Some more Ducking made me aware that using '-tag:v hvc1' in FFmpeg creates files that QuickTime can eat. Can you please share the full ffmpeg syntax used for converting the H.264 files to H.265?
- jonnycomputer 6y agoI recently did this, and used this to guide me: https://unix.stackexchange.com/a/38380/86174 https://unix.stackexchange.com/a/38380/86174
- BelenusMordred 6y agoIf you can spare the time I'd also add a slower type preset in there for better compression. eg. -preset slower # You control the tradeoff between video encoding speed and compression # efficiency with the -preset options. # ultrafast, superfast, veryfast, faster, fast, medium, slow, slower, veryslow. # Default is medium.
- LeoPanthera 6y agoIf your videos are already h.264, you probably should not convert them to h.265. You'll lose some quality to generation loss and the difference in size is not huge.
- viraptor 6y agoYou're responding in context of an article which says: > "what if I convert my screen recordings from H.264 to H.265?" Well, two things happend: My files shrink to 6% (not a type) Sounds like the difference can be huge.
- mirthflat83 6y agoYeah so if he re-encoded his video in H.264 I bet he would have seen a similar level of compression.
- gnopgnip 6y agoThe article doesn't make any claims to the quality, you could reencode the same video to quicktime or mp4 with a similar final size depending on what quality settings you use
- janandonly 6y agoThe author here. :-) Sorry for my lame English. I really should not write blogs after midnight... Anyways, a lot of you are asking for what command-line options I used for FFMPEG. So here it is: ffmpeg -i input1.mov -c:v libx265 -tag:v hvc1 output1.mp4
- mohankumar246 6y agoCompression depends on a variety of factors - content, type of frames being used (I-P, I-3/7B-P, etc.). Bit rate vs Distortion curve also has to be considered. PSNR of encoded content is a metric. Click bait without much info.
- mrtnmcc 6y agoThis is compressing video recordings of a computer desktop. The frames don't change much so this isn't surprising.
- boomboomsubban 6y agoCan you clarify this please? Does h.265 have some better deduplication compression or does reencoding apply something that the original recording could not, meaning h.264 would have the same benefit.
- azernik 6y agoA compression algorithm allows multiple different encodings of the same underlying data - spend more CPU time finding redundancies in the data, and you can make the file smaller. I strongly suspect that the difference here is between real-time compression that runs while capturing the screen recording, and less time-constrained offline compression during transcoding.
- Dylan16807 6y agoI'm willing to bet it's not about CPU time constraints. My guess is that it's bitrate settings and/or keyframe interval settings. And that you could get similar results by tweaking those, even if you're encoding at veryfast.
- userbinator 6y agoAlthough I have not worked with '265 or any of the other newer codecs past '263, I suspect it's the latter --- encoders running in realtime tend to aim for a constant bitrate rather than maximum compression.
- dylan604 6y agoh.265 makes files smaller than h.264 for a given bit rate. So an h.265 I-frame will be smaller than an h.264 I-frame. If it's a mostly static computer screen, then you can get even better encoding effeciency by using a longer GOP structure so the I-frames are spread out even futher. Of course, the trade of is seeking gets worse, but works out great for push play and watch type of deliverables. h.264 can do this as well, but it still goes back to the purpose of h.265 is to be better than h.264
- deleted 6y ago[deleted]
- eikenberry 6y agoThe main hurdle for adoption, aside from onerous patents, is waiting for hardware acceleration to be common place. What is the current state of h.265 hardware accel? Does it come with everything yet like h.264 does?
- oplav 6y agoMost Turing and above Nvidia cards have support for hardware accelerated decode of h.265 [0]. Modern Intel chips also support hardware accelerated decode (support started with Skylake [1]). Not sure about AMD. [0] https://developer.nvidia.com/video-encode-and-decode-gpu-support-matrix-new https://developer.nvidia.com/video-encode-and-decode-gpu-sup... [1] https://en.wikipedia.org/wiki/Intel_Quick_Sync_Video#Hardware_decoding_and_encoding https://en.wikipedia.org/wiki/Intel_Quick_Sync_Video#Hardwar...
- Macha 6y agoRight, so that's 2 of the top 10 and 4 of the top 20 gpus per the steam hardware survey, representing 10% of steam users: https://store.steampowered.com/hwsurvey https://store.steampowered.com/hwsurvey But I don't think desktops are the problem anyway as opposed to laptops/tablets. Desktop cpus are perfectly capable of decoding h265 in real time without acceleration
- p1necone 6y agoLooks like most of the cards in the top 20 support H.265 4:2:0 (NVidia 10XX and up), just not 4:4:4 (NVidia 16XX and up). I don't think the steam hardware survey is a good sample of the wider computer market though - the majority of people using youtube/netflix/etc on x86 devices are probably using Intel laptop chips with integrated graphics, not $500+ dedicated GPUs. (Although presumably this is probably becoming less true over time, those low end users are moving more and more to mobile devices and smart TVs/chromecast/console, leaving workstation/gaming systems to be a larger percentage of the market)
- namibj 6y ago
- PostThisTooFast 6y agoIn general, that claim is bogus. H.265 may have some additional optimizations for areas of pure color and static content like a computer screen, but no way will you get that level of compression and quality with photographic motion-picture content. Also... I've never seen Mac screen-capture functions record audio. What Mac OS built-in screen recorder also captures audio? Instead of memorizing undiscoverable hotkey combinations, I just keep the Screenshot app in the dock.
- minimaxir 6y agoAs of macOS Big Sur, you can Export videos from QuickTime (i.e. the screen recording) in H.265, and it's faster than converting it via ffmpeg as it can leverage the GPU via VideoToolbox. ...but you still have to record-and-save it in H.264 first then reload into QuickTime, and for some reason the H.265 quality isn't great. This is still the case even when using GPU VideoToolbox via ffmpeg/Handbrake, and it's something I've never figured out why. As an aside, for more serious recordings (and if you don't want to use paid software), I recommend using OBS instead, as it gives you a lot more recording flexibility that the native macOS screen recorder lacks.
- dsiegel2275 6y agoWithout reading the details, to see a compression improvement of that magnitude I can only suspect that it is a "middle out" compression algorithm...
- kayson 6y agoThe title is a bit of an exaggeration... Maybe I'm missing something but there's actually nothing in the article about the FFMPEG setting used, most importantly the encoding bitrate or quality. There's also no quantitative comparison between the old video and the new. It's relatively straightforward to measure the noise added during the encoding process. That being said, H265 definitely does improve filesizes.
- KMnO4 6y agoMostly static a screen recordings are pretty much the ideal content to show off H.265. The screen would be broken down into blocks, and ones that don’t contain much motion or complexity would use nearly no bandwidth. This image should demonstrate that: https://postimg.cc/D8MZyzHd https://postimg.cc/D8MZyzHd Also, I’m not criticizing the authors English (which is much better than my Dutch), but some of those mistakes were almost poetic: > Some more Ducking made me aware that using '-tag:v hvc1' in FFmpeg creates files that QuickTime can eat.
- Const-me 6y ago> pretty much the ideal content to show off H.265 Same applies to H.264. I think the main reason for OP’s observation, the codecs optimized for real time streaming (including the hardware codecs inside GPUs) don’t have enough time (both CPU time, and maximum allowed encoder latency) to achieve what ffmpeg does when asked to re-encode a video clip from hard drive.
- rubatuga 6y agoIngest would be a better choice
- bawolff 6y agoSounds likely that the initial recording was a live screen recording so mac probably uses lowest compression settings so to be able to transcode in real time well at the same time not monopolizing the cpu. Maybe i'm wrong, but the comparision is stupid without having ffmpeg re-encode the video with the same codec. Otherwise its just apples to oranges.
- hendry 6y agoHe doesn't appear to show his ffmpeg invocation let alone his report, which is a shame. I wonder which hardware accelerates h265 encoding on Linux.
- darwingr 6y agoApparently there is hardware support for H.265 in the latest version of MacOS. I'm very eager to have it working/playing with the classic QuickLook shortcut from finder by simply hitting the space bar with a video file highlighted.
- The_rationalist 6y agoIt's such shame that browsers don't support h265 (maybe that edge do though?) As any rational user I have to use the UWP Netflix app to get the best bitrate because of this artificial limitation.. I have paid h265 on the windows store for 1 symbolic dollar and I'm sure you can find a license for cheaper, people should respect the media they consume not using h265 for regular video consumers is nonsensical. And no vp9 is inferior and av1 too in addition to the absence of hardware acceleration for av1. H266 has been released last summer, I can't wait for it to become widespread and push the boundaries of the user experience.
- irrational 6y agoOr just use VP9 (or the upcoming AV1) which has fairly wide support and doesn't have any patent issues.
- lifebypizza 6y agoAside from all the comments mentioning that reencoding in h264 would probably yield similar results (albeit not as good as h265), another issue is the statement that DivX is the same thing as h264. They are related, but not the same: https://videoconverter.wondershare.com/convert-divx/divx-vs-h264.html https://videoconverter.wondershare.com/convert-divx/divx-vs-...
- vjeux 6y agoBtw, the way to get it to a clipboard is not exactly cmd-shift-ctrl 3. It’s cmd-shift 3 in order to enable screenshotting and when you end, if you have ctrl active then it puts it on your clipboard. Knowing this makes it less annoying to do it as you don’t have 4 keys combinations.
- jetzzz 6y agoThe comparison of H.264 and H.265 in this article doesn't make any sense. Lossy codecs can make files almost arbitrarily small at the expanse of quality. You should look at both quality and size; size alone doesn't mean anything. Also H.264 and H.265 are just formats; there are many encoders of varying quality which can generate such files and each encoder has tons of settings. I don't know which encoder macOS uses but ffmpeg includes state-of-the-art H.264 encoder (x264). Simply reencoding video from H.264 to H.264 using ffmpeg can give you better quality/size ratio than the original file. > H.264 codec (or MPEG-4 Part 10), once upon a time know in the scene as DIVX. No, DivX refers to MPEG-4 Part 2 which is a completely different codec.
- sidpatil 6y ago> No, DivX refers to MPEG-4 Part 2 which is a completely different codec. Poster is referring to the DivX Plus HD codec [1]. [1] https://en.m.wikipedia.org/wiki/DivX_Plus_HD https://en.m.wikipedia.org/wiki/DivX_Plus_HD
- vermilingua 6y agoI don’t really understand the technical details of compression schemes, but my piece of anecdata is this: in my experience installing/maintaining CCTV systems, using H.265 over H.264 approximately halves the used bandwidth and storage for the same video quality. This is much more pronounced in static/less active scenes, but is still a measurable benefit in highly active scenes.
- iaw 6y agoAssuming you meant H.265 over H.264 but could someone confirm?
- vermilingua 6y agoYup sorry, typo
- gnopgnip 6y agoThe submission title claims they are the same quality but the article has a different title, and doesn't make any claims to video quality. Converting video from a lossy format to another lossy format with these settings will significantly degrade the quality. For a desktop recording that could be problematic, still frames could be unreadable. Going from a lossless video file to both h264 and h265 will typically have h265 files about 30% smaller at the same quality, but this comes with significant tradeoffs for transcoding time. And there is some nuance to getting the best quality, generally there are more resources on how to do this with h264. And h265 hardware support isn't quite universal, many older mobile devices do not support it for instance.
- exikyut 6y agoWat. This is totally offtopic, but in the linked screenshot, https://1.bp.blogspot.com/-4qInHSs_urA/YFvYMbVGmgI/AAAAAAAA4Ac/_tBoVTG8tRYnCF1L5aKI3Q7HSP_DXDUVQCK4BGAYYCw/s1600/GeplakteAfbeelding-1-756936.png https://1.bp.blogspot.com/-4qInHSs_urA/YFvYMbVGmgI/AAAAAAAA4..., the border between the titlebar and the window content on the left Show Info window is, um, so misaligned it's eating into the text. 199x called, it wants its human interface guidelines back
- 867-5309 6y ago>My files shrink to 6% (not a type) of their original size typoception
- spiznnx 6y agoThis would be true even re-encoding to AVC. Recording, even hardware accelerated, is designed to use little compression and have good quality, so it can keep up with the stream without slowing down your PC. The resulting bitrates are necessarily very high. Re-encoding more efficiently, without the realtime requirements, will usually yield good results.
- fireattack 6y agoContent aside, the title alone makes no sense.
- fuzxi 6y agoSeems like a typo. It should be, "Comparing H.265 (HEVC) and H26*4* video file size".
- jolmg 6y agoThere's a missing dot, too. "H.264" not "H264". With the current title, I thought maybe there were 2 formats that differed in name only by a dot, and that this post was about clearing up that confusion between the nearly identical names.
- janandonly 6y agoYes. That should have been H.264 to H.265 comparison. Sorry.
- mckirk 6y ago> video: the H.264 codec (or MPEG-4 Part 10), once upon a time know in the scene as DIVX. That is incorrect and bothered me enough that I scoured the web trying to find old scene release standards. Fascinatingly, there's a whole Wikipedia article on those[1] and it's still possible to find the original .nfos in strange corners of the internet[2]. But long story short, a DivX release was standardized to DivX 3.11, which was actually a reverse-engineered Microsoft codec and not actually MPEG-4 compatible[3]. But later DivX versions implemented MPEG-4 Part 2[4] -- that is still a completely different thing than MPEG-4 Part 10[5] though, which describes H.264 (but calls it AVC). [1]: https://en.wikipedia.org/wiki/Standard_(warez) https://en.wikipedia.org/wiki/Standard_(warez) [2]: http://lunamoth.biz/pe.kr/cgi-bin/gm/archives/tdx2k2.nfo http://lunamoth.biz/pe.kr/cgi-bin/gm/archives/tdx2k2.nfo [3]: https://en.wikipedia.org/wiki/DivX https://en.wikipedia.org/wiki/DivX [4]: https://en.wikipedia.org/wiki/MPEG-4_Part_2 https://en.wikipedia.org/wiki/MPEG-4_Part_2 [5]: https://en.wikipedia.org/wiki/Advanced_Video_Coding https://en.wikipedia.org/wiki/Advanced_Video_Coding
- mikkelam 6y agoDoes anyone know what is the SOTA approach to lossless video encoding?
- aaron695 6y agoI hoped it would be a comparison to H266 https://en.wikipedia.org/wiki/Versatile_Video_Coding https://en.wikipedia.org/wiki/Versatile_Video_Coding I feel like it's the year of 4K. Greater than 24 inch, 4K monitors and 4k TV's are getting somewhat standard/affordable. But looking at EZTV only around 18% of torrents are released as H265, which is disappointing.
- kevincox 6y agoThe writing here is just bizarre. - The use of the term "Ducked" instead of "searched" or "looked up" which is clearly forced and I guess trying to promote DuckDuckGo. - "Brew.SH" The program is called Homebrew and it is odd to capitalize the website like that. I have never seen someone say Duck.COM. - FFMPEG should be FFmpeg - photos.app should be Photos.app like Terminal.app that he mentioned earlier. - macOS is capitalized a different way literally every time is used. For any one of these I wouldn't have thought twice, people make up new capitalization for names all the time. It seems to give the writing a condescending tone (helped by comments like "command line for non-Appleonians").
- janandonly 6y agoThe author here. :-) Sorry for my lame English. I really should not write blogs after midnight... Anyways, a lot of you are asking for what command-line options I used for FFMPEG. So here it is: ffmpeg -i input1.mov -c:v libx265 -tag:v hvc1 output1.mp4