7 ms·
The reason this can be done with JPEGs is the compression hasn't been updated. There are folks that have used h264 for compressing images and webp uses vp8 com
by colechristensen 10y ago
The reason this can be done with JPEGs is the compression hasn't been updated. There are folks that have used h264 for compressing images and webp uses vp8 compression, both with much better results than JPEG.
Lepton is cool because it helps make existing technology a whole lot better, but what we actually need is a better image format.
You wouldn't see the same leap for videos because people have been working hard to make those great for a while while JPEG has been left to rot.
- neuronexmachina 10y agoI'd love to have something like this for archiving DVD ISOs though, where the VOBs are compressed with old-school MPEG.
- stephenr 10y agoHow does h.264/5 not fit the bill?
- IanCal 10y agoCan you run those losslessly?
- deleted 10y ago[deleted]
- thescriptkiddie 10y agohttps://trac.ffmpeg.org/wiki/Encode/H.264#LosslessH.264 https://trac.ffmpeg.org/wiki/Encode/H.264#LosslessH.264
- niftich 10y agoWhile there's a lossless H.264, it doesn't fit the implied use-case proposed in the thread. Using lossless H.264 to recompress lossy MPEG-2 would be akin to using PNG to recompress a JPEG -- silly and wasteful. Sure, it's an inexact analogy because PNG is not a block-based DCT coder, but all lossless H.264 does is set the quantizer as absurdly high as it needs to go to losslessly encode a particular frame. Staring from a compressed source, this is not a good recipe for achieving a space-saving result.
- beernutz 10y agoI don't think h.264/5 is bit-for-bit retrievable is it? Neuronexmachina might be wanting to be able to get back the 1:1 version maybe?
- dublinben 10y agoWhy bother trying to losslessly compress your DVDs when they're already a low quality, compressed MPEG2 source? The small amount of content that isn't available in higher quality won't take up that much space left as is.
- tedunangst 10y agoThis is why I come to HN. To find out what's in my video archive and how easy it is to replace.
- antisthenes 10y agoIn the case you're being facetious, maybe you could clarify how big is your video archive exactly and what sort of compression you're trying to achieve on it?
- cbhl 10y agoShouldn't you just use Handbrake and H.264/AAC? (Assuming your computer is fast/new enough to play it back.)
- astrange 10y agoIt wouldn't get much smaller. The reason DVDs are such a high bitrate compared to Handbrake rips isn't that MPEG2 is inefficient, it's because there's a keyframe twice a second. Most movie rips have a keyframe every 10 seconds. It's mostly to let you fast forward, but there is a technical issue there. MPEG2 decoders aren't all mathematically identical, so what happens is the picture tends to drift away from the real thing after a while, and there's hacks like frequent keyframes and flipping the smallest DCT coefficient to get around it…
- phire 10y agoI've always wondered if it would be possible to losslessly convert the MPEG2 DCT coefficients, motion vectors etc to the equivalent subset of h.264 and then take advantage of the better prediction and entropy encoding of the later standard. Maybe you could even go further and actively remove keyframes (in a fully reversible way, just keep a record of where they were) I'm not sure how much you would save, and for losslessly archiving DVDs you might be better off creating a special format like Lepton for mpeg2
- niftich 10y agoThe first part of your question was posed on Doom9 in 2009. It's the opinion of Dark Shikari, longtime lead x264 developer, that it would be possible [1]. Not sure what you mean by the keyframe removal, though. Such an act would be lossy, significantly impair any P-frames or B-frames (unless you majorly modify them), and, it frankly doesn't sound very reversible. Mind elaborating? [1] http://forum.doom9.org/showthread.php?t=149895 http://forum.doom9.org/showthread.php?t=149895
- phire 10y agoWhat I mean is transforming I-frames into equivalent P-frames (or even B-frames) that decode to the exact same pixels. The transformation might result in something that is bigger than a directly encoded P-frame (which can tolerate some small errors) but I suspect the new P-frame will be smaller than the original I-frame. There is no restriction that P/B-frames only reference I-frames, so you don't even need to touch those frames. For conversion back to MPEG2 it would be ideal to detect or mark the original I-Frames, so you can convert them back (a simpler transformation). But you could also pick any random P/B-frame and convert it to an I-frame with little issue.
- sliverstorm 10y agoIs JPEG, PNG, etc a container format that could use arbitrary compression, like MKV? Or do we need a brand new format.
- halomru 10y agoPNG is a very nice, extensible container format. In principle you can use it to store arbitrary image data, and still make use of all established metadata fields. In practice you probably shouldn't do that without changing the file extension and the magic bytes to avoid confusion among users and poorly written software.
- animal531 10y agoIf I remember correctly PNG can use different compression algorithms per scanline, although I doubt it's ever used as such.
- rleigh 10y agoWhile PNG (and libpng) are reasonable for their intended purpose as a GIF replacement for simple RGB and greyscale graphics, it doesn't compare when it comes to the power and flexibility of TIFF, from sample format and depth, to sample count, image orientation, tiling and many additional features. TIFF is showing its age at this point, with a some high-end scientific applications switching to HDF5. But PNG simply isn't featureful enough for this type of data.
- joosters 10y agoThe JPEG file format is pretty detailed, there are lots of places in the file where you could indicate that the image has been compressed with a different algorithm. But it wouldn't really help, because older decompressors will still not be able to interpret the new codec. They would be able to parse the file and read the metadata in it - like image width and height, timestamps, camera details, and so on, but there's no way it can decompress the data.
- guelo 10y agoIndeed. In one project where I converted jpegs to webp I saw around 70% savings at similar quality. This was on Android where it's fully supported. On the web pretty much only Chrome supports it, I'm not sure why Firefox, IE and Safari are hesitant.
- Sinaf 10y agoThis [1] is from 2013, so I don't know how it holds up, but I found it in the criticism section of the Wikipedia article for webp [2]. edit: This [3] is a follow-up from 2014 to the article/study from 2014. TL;DR: "We consider this study to be inconclusive when it comes to the question of whether WebP and/or JPEG XR outperform JPEG by any significant margin. We are not rejecting the possibility of including support for any format in this study on the basis of the study’s results. We will continue to evaluate the formats by other means and will take any feedback we receive from these results into account." [1]https://blog.mozilla.org/research/2013/10/17/studying-lossy-image-compression-efficiency/ https://blog.mozilla.org/research/2013/10/17/studying-lossy-... [2]https://en.wikipedia.org/wiki/WebP#Criticism https://en.wikipedia.org/wiki/WebP#Criticism [3]https://blog.mozilla.org/research/2014/07/15/mozilla-advances-jpeg-encoding-with-mozjpeg-2-0/ https://blog.mozilla.org/research/2014/07/15/mozilla-advance...
- therealmarv 10y agoI've heard that Safari (10) on upcoming iOS 10 supports webp. Don't know about Safari 10 on macOS Sierra.
- ksec 10y agoWhere did you read that? Since Apple has yet to commit on H.265, ( Due to Insane patent Licensing payment ), I am hoping they jump onboard with Open Media Alliance.
- joosters 10y agoAll that is true, but it misses out a key point: Lepton is risk-free. I could re-encode all of my JPEG photos with a better codec, but the problem is that then they have gone through a lossy compression scheme twice: once with JPEG, and once with the new codec. This could ruin the image quality on some photos, giving them nasty artefacts. The newer codecs might even be hindered further by the fact that they are being asked to compress an image that's been JPEG'd. I don't think any of the codecs you mentioned are tuned to work their best with image data that already has been butchered by JPEG. They expect to be given the 'pure' original image. This may well cause the codec to perform worse than expected. Using Lepton gives none of these risks, since jpeg<->lepton is lossless. I could throw away all the JPEGs afterwards, safe in the knowledge that if I want to go back, I can. Also, it's not really true that JPEG has been left to rot. There are lots of programs available that greatly improve upon the basic JPEG compression, while still outputting a JPEG file that any compliant decoder can read. And there's an even simpler way to shrink your photo file sizes - just drop the JPEG quality level slightly. Most cameras and programs default to a very high quality value. Dropping the default by even a tiny amount can produce remarkably smaller files, and you'll probably never notice the miniscule image quality loss. I suspect that JPEG is so popular because it is 'good enough'. Most people and programs don't care so much about squeezing out smaller files, so they'll keep using JPEG regardless.
- manigandham 10y agoYes, it should all just switch to FLIF http://flif.info/ http://flif.info/
- rattray 10y ago> FLIF is a novel lossless image format which outperforms PNG, lossless WebP, lossless BPG, lossless JPEG2000, and lossless JPEG XR in terms of compression ratio. > 74% smaller than lossless JPEG XR compression. > Works on any kind of image
- jacobolus 10y ago> outperforms PNG, lossless WebP, lossless BPG, lossless JPEG2000, and lossless JPEG XR PNG was not designed to be used for photograph-like images. The rest of those were not designed to be lossless formats, the lossless version is just a tacked-on afterthought. Very unsurprising to find a codec that can beat those.
- are595 10y agoIn my own tests, I found FLIF generally beats PNG (PNG Crush/Optipng both in brute-force mode) for comics (greyscale, majority white) as well, but by a less significant margin. It's also worth noting that there aren't many other lossless formats, so it's still a valid comparison. I'm sure neither TIFF nor RAW outperform FLIF either.
- rleigh 10y agoThat's not a valid comparison for TIFF. TIFF is a container which supports multiple compression algorithms. You could plug FLIF in as a compression algorithm and use it directly.
- are595 10y agoAlright, well against current commonly supported TIFF compression algorithms such as LZW, Packbits, and ZIP.
- unexistance 10y agoperhaps BPG is better? By the great Fabrice Bellard http://bellard.org/bpg/ http://bellard.org/bpg/
- kalleboo 10y agoBPG is based on h265
- iopq 10y agoActually, high quality JPEGs are just as good as BPG, VP8, etc: https://people.xiph.org/~jm/daala/revisiting/subset1_psnrhvsm.png https://people.xiph.org/~jm/daala/revisiting/subset1_psnrhvs... so when you use a better encoder like mozjpeg, JPEG is actually competitive with the newest formats, given enough quality it gets slightly grainier results with blocking artifacts, but BPG and WebM look like they had a painting algorithm blur out all of the details