gyan 4 years ago

The linked commit simply adds the codec id. By itself, that won't do much.

FFmpeg relies on libjxl for decoding and encoding. Support added in

https://git.videolan.org/?p=ffmpeg.git;a=commit;h=458cc7e314...

https://git.videolan.org/?p=ffmpeg.git;a=commit;h=5f0b4e9c70...

The Windows static builds have binaries with this support. The linux and MacOS builds don't, as yet.

  • dusted 4 years ago

    Thanks, that answered my question before I asked it! :)

  • Kelteseth 4 years ago

    Not directly related, but looking at this commit: Why do people still write raw Makefiles?

    • gyan 4 years ago

      Legacy methods in large projects need a big motivation to change. Every couple of years, someone proposes a new build system. The conversation usually dies within a week or two.

    • capableweb 4 years ago

      Turning the question around (from someone who does write "raw" makefiles): What's the problem with writing "raw" makefiles?

      If it works, it works. Haven't encountered any major issues with writing them in my years.

      • jcelerier 4 years ago

        You're lucky to not have a name with spaces in it as make does not support that

        • th3typh00n 4 years ago

          Why would you have spaces in source code filenames? It's just a bad idea in general and makes things more complicated for no reason, regardless of what build system you're using.

          • jcelerier 4 years ago

            The spaces may be in parent folders, such as c:\Users\Jean-Michaël Celerier\Documents\Visual Studio Projects\Project 1\...

            Which your uni's group policy would make it so that you can only write there (thankfully mine was sane, but I've seen it aha).

            And even then, a build system that does not support arbitrary file names is just terminally broken and should not be used, even less encouraged.

            • planede 4 years ago

              Spaces are the lesser evil. Try newlines in file names. Also try having a directory that contains ":" in PATH.

            • mort96 4 years ago

              That's "only" a problem for absolute paths, most projects which use makefiles use relative paths.

          • stavros 4 years ago

            Spaces in filenames aren't inherently bad, they become bad because tools that don't support them are bad. Saying "why would you have spaces?" as a counterargument to "make doesn't support spaces" doesn't work, because the problem with spaces is exactly that make doesn't support them.

            • trinovantes 4 years ago

              Random trivia: Microsoft explicitly added the space in "Program Files" to ensure developers know they need to handle spaces in paths

              • stavros 4 years ago

                Really? Huh, that's very interesting, thanks!

              • sp332 4 years ago

                Joke's on them, I just use PROGRA~1.

                • CSSer 4 years ago

                  Sounds like you've got a handle on it!

                • kevin_thibedeau 4 years ago

                  You can't depend on that working. It could be another digit.

                  • iggldiggl 4 years ago

                    Or short file names might be turned off.

            • samatman 4 years ago

              I'm not entirely sure why "make, but it handles filenames properly and allows spaces for indentation as well as tab" isn't the most popular fork of make.

              Does it even exist?

              • jcelerier 4 years ago

                I don't understand why one would use make in 2022 when there's cmake+ninja which is a much better and faster way to build things

                • adrian_b 4 years ago

                  You believe this because you probably know well how to use cmake+ninja, but you do not know how to use make (more precisely GNU make, which has valuable extensions over the traditional UNIX make).

                  Almost all the makefiles that I have ever seen used in open source software projects are in my opinion horrible garbage, and they do not use properly the GNU make features and they are extremely difficult to understand and modify.

                  That does not mean that makefiles must be written in this way. It is possible to write makefiles in such a way, so that the per project makefiles become extremely simple and extremely easy to maintain.

                  All the cmake+ninja projects that I have seen were also exceedingly complex and hard to maintain, much worse than when using good makefiles. Maybe there also is a better way to organize the cmake+ninja projects, but I have never bothered to study in detail cmake or ninja, to see how that could be done, because I already knew how to write proper makefiles and I have not seen yet any additional feature that I would want when building a software project.

                  Regarding the claim that cmake+ninja is faster, I have not seen any realistic benchmark proving this in the right way, i.e. not by comparing some good cmake+ninja project with a bad makefile.

                  I do not see why any of the 2 methods for building a project could be faster for the other. For a properly written makefile, the time spent in executing make is completely negligible in comparison with the compilation/linking steps.

                  I assume that the same must be true for cmake+ninja, so the speed must be the same when using the same speed-up methods for both, e.g. when providing the same number of source files per compiler invocation, to minimize the compiler start-up times.

                  Because the same work must be done, there is no way to for one tool to be faster than the other. Any trick that you might do to accelerate the compilation with one tool can also be done when using the other tool.

                  The only difference between tools is in the maintenance effort that must be done by the programmer when making changes in the project, e.g. when adding source files, deleting source files, renaming source files, moving source files and so on.

                  With properly written makefiles, nothing must be done for any of the operations mentioned above.

                  I do not know if this is also possible with cmake, because I have never seen such a well-written cmake project, but even if it is possible, the maximum that cmake could do would be to match what could already be done with make many years before cmake existed.

                  So I have never seen any reason to switch to cmake or cmake+ninja. All the arguments in their favor that I have ever seen were given by people who have never read the GNU make manual, so they compared their favorite tools with bad makefiles, not with good makefiles, so those arguments had nothing to do with make itself, but only with good ways or bad ways to organize the building of a software project.

                  • jcelerier 4 years ago

                    > Almost all the makefiles that I have ever seen used in open source software projects are in my opinion horrible garbage, and they do not use properly the GNU make features and they are extremely difficult to understand and modify.

                    if tomorrow a pen maker released a new pen where the majority of artists using it only managed to produce shit artworks, everyone would rightly call this pen shit. Even if it's theoretically possible to use the pen in such a way as to not produce shit artworks. Likewise for, say, a tool used for making musical instruments, etc.

                    How well a tool lends itself to be used by the average person is an important property when choosing to use a technology over another.

                    Can you provide e.g. a project with your good makefiles, that I could use to build debug and release builds, with any of MSVC, GCC, and Clang ?

                    > I do not see why any of the 2 methods for building a project could be faster for the other. For a properly written makefile, the time spent in executing make is completely negligible in comparison with the compilation/linking steps.

                    can you provide one such makefile ? in my experience make always takes a few seconds for projects with >1k targets when changing a single file. Ninja is consitently instantaneous.

                    • adrian_b 4 years ago

                      > How well a tool lends itself to be used by the average person is an important property when choosing to use a technology over another.

                      The reason why most makefiles in open source projects are horrible has nothing to do with the qualities of make, because typically those makefiles are not written by some human who knows about make, but they are generated by some other tools, e.g. autoconf/automake.

                      Moreover, the generation method typically used is flawed, because it generates the entire makefiles, in an incomprehensible form. The maintenance of those makefiles would have been much easier if makefiles carefully written by a human would have been used, which would have included a file generated by the autoconf tools, and the included file should have contained only definitions, and neither rules nor targets.

                      Unfortunately there is an ancient tradition established decades ago to generate the makefiles in an overly complicated way and nobody has the courage to change that in any project, because probably nobody understands any more what would happen if changes would be made.

                      > Can you provide e.g. a project with your good makefiles, that I could use to build debug and release builds, with any of MSVC, GCC, and Clang ?

                      I never had any need to compile something for MSVC, GCC and Clang.

                      Nevertheless, many of my projects had to be cross-compiled for various embedded CPU targets.

                      The way I do that is that I have one makefile that contains only definitions for each project building target, so I could have e.g. 3 makefiles, 1 for a MSVC/Windows target, 1 for a GCC/Linux target and 1 for a Clang/Mac OS target.

                      Each such makefile will have definitions for the names of all executables that may be needed for bulding a software project, e.g. compilers, assemblers, linkers, librarians, object file converters, copy commands, move commands, rename commands and so on.

                      It will also have definitions for all the command-line option flags that must be provided to each executable in order to perform whatever tasks are needed for building a software project.

                      Writing such a makefile for a compilation is a one-time effort, I might write it in an hour or more, while searching through the documentation of various tools, but then I might use it unchanged, during many years, for all projects that I intend to build for that target.

                      I need to write such makefiles only infrequently, when I begin to use a new CPU, or a new operating system, or a new compiler.

                      These makefiles with definitions dependent on the compilation target are included with an include directive in the complete makefiles that build the software project.

                      I build each final file, e.g. executable file, dynamic library or static library in a separate build directory. When I want to build multiple files with a single command, then their build directories are subdirectories of a directory where there is a makefile which will invoke the makefiles in the leaf subdirectories and maybe move or copy the built files somewhere else, if the end result needs them to be in certain relative positions in a directory hierarchy.

                      The makefile in the build directory of some file has only a few lines. It includes the makefile with the definitions dependent on the compilation target and a makefile that is the same for all my projects, with general definitions, rules and targets.

                      Besides the include directive, there are a few definitions, the type of file that must be built, the name of the built file (when absent, the current directory name is assumed, with an appropriate extension) a list of directories that must be searched to find the source files (if absent the current directory is assumed) and an optional prefix for the list of directories.

                      Because make searches itself for source files and automatically generates their dependencies, I do not have to do anything when I add/delete/move/rename source files.

                      For debug and release I obviously have these 2 make targets in the included makefile with general make rules and targets, which are the same for all projects. The included files per compilation target have definitions for the debug and release command-line flags for all the tools, e.g. compilers, assemblers, linkers.

                      So if MSVC, GCC and Clang on certain operating systems would be my targets, I would have no problem to build these 3 targets either separately or simultaneously, without having to write a single word in the makefiles of the project. When I would create the build directories for the project, I would copy in each build directory the appropriate template makefile, in which I would change, if needed, only the name of the built file and the name of the directory or directories where the source files are located.

                      > in my experience make always takes a few seconds for projects with >1k targets when changing a single file. Ninja is consitently instantaneous.

                      You are right that this is the only case when the tool used to build the project can make a difference.

                      When a large number of files must be compiled, there is no chance to see any difference due to the speed of the project build tool.

                      However, when only a single file is recompiled, then there can be a significant difference.

                      Ninja is very simplified in comparison with make, so I have no doubt that it is faster.

                      For your example with many thousands of files where you frequently recompile only a couple of files, one could use make + ninja instead of cmake + ninja.

                      The general rules from my makefiles could be modified to generate ninja input files instead of invoking the build commands,

                      In that case I would invoke make only after making changes like add/delete/rename source files, and then ninja for the actual recompilation.

                      Nevertheless, I never had to do this until now, because the speed of make was always acceptable, which might be due to the fact that I have always used fast CPUs with generous quantities of installed memory and with fast SSDs.

                      Moreover, I usually think a lot before making changes and then I do all of them, so for me it happens very infrequently to need to recompile a single file many times in a row.

                      In conclusion, I agree with you that there is a use case for ninja, for very large projects where frequent recompilations of only a few files are needed.

                      Nevertheless, there are a lot of software developers who will never encounter this use case, so for them make is enough.

                      On the other hand for cmake I am not aware of any useful application, because all the examples that I have seen of cmake projects were not simpler than if those projects would have used make.

                      It is possible that I have seen only examples where cmake was not used well, but in any case, the best that cmake can hope is to be as easy to use as make.

                      • jcelerier 4 years ago

                        > I never had any need to compile something for MSVC, GCC and Clang.

                        I am lucky that this is your case ; many of the software I've worked on had this requirement.

                        > The general rules from my makefiles could be modified to generate ninja input files instead of invoking the build commands,

                        that's basically reimplementing cmake in make. I don't understand why I would do this work myself when cmake exists and is constantly updated to adapt to newer compilers, etc. without me having to lift a finger. + the generation of targets for the IDE - just in the last two weeks I had users come and ask me to have a build that can be worked on in both Visual Studio and Xcode. Good luck with doing that in make.

                        > When a large number of files must be compiled, there is no chance to see any difference due to the speed of the project build tool.

                        1k isn't very large though. There are projects out there with the source code without any asset sized in gigabytes.

                        > On the other hand for cmake I am not aware of any useful application, because all the examples that I have seen of cmake projects were not simpler than if those projects would have used make.

                            project(bla)
                            add_executable(my_app main.cpp)
                        

                        is the minimal CMake project and likely supports as-is more toggles and switches than your homegrown makefile system - toggles and switches that are necessary for pretty much any non-toy project.

                        • adrian_b 4 years ago

                          After reading your reply, I have browsed the cmake reference manual.

                          It is likely that for many people cmake may be enough, but my homegrown makefile system can do much more than cmake.

                          The cmake equivalent for the makefiles with compilation-target-dependent definitions is called a toolchain file.

                          However, unlike for make, where I have complete freedom, cmake allows in the toolchain file only a relatively small set of options from a closed set.

                          Because I cross-compile for many unusual combinations of embedded CPUs and operating systems, with cmake I would certainly need to write many custom toolchain files, but cmake would not allow me to specify everything that I need.

                          Besides C & C++, I use many less popular programming languages. Even if cmake supports a decent number of programming languages, when you want to use any language that is not on the currently supported list, you are out of luck.

                          With my make system, if I decide to use a new programming language, I would need only a few minutes to update the makefile with generic rules and the toolchain makefiles in order to be able to build a project with the new language.

                          Why would I need to use a rigid tool like cmake, when the same and more can be done with make ?

                          I see in the cmake documentation the following recommendation, which appears to have been followed in all the cmake projects that I have seen.

                          "We do not recommend using GLOB to collect a list of source files from your source tree. If no CMakeLists.txt file changes when a source is added or removed then the generated build system cannot know when to ask CMake to regenerate."

                          This recommendation is very wrong. Even if cmake has the limitation that it is triggered only by an updated CMakeLists.txt file, the workaround is not to avoid using GLOB.

                          The correct workaround is to use GLOB, but to also execute the command "touch CMakeLists.txt" whenever there are changes in the set of source files.

                          Executing a "touch" is much simpler than editing CMakeLists.txt.

                          The fact that the bad recommendation from the cmake documentation has been followed blindly in all the cmake projects that I have seen is one reason why I thought that cmake sucks.

                          However, like I have said above, even when cmake is used correctly, it is too rigid for those whose applications are not restricted to the targets understood by cmake.

                          "make" does not have any such limitations, so I still do not see any reason for the existence of "cmake", because to do what cmake does you do not need a new executable, you need just a set of generic makefiles, like those that I use, or like those that are used in some projects like FreeBSD (those, unlike cmake are not oriented towards multiple compilation targets, but they could be adapted for such a purpose with much less effort than writing a program like cmake).

                  • pstuart 4 years ago

                    Do you have any links to share that teach using make in the manner you're promoting?

                    • adrian_b 4 years ago

                      See my reply above

                  • coldpie 4 years ago

                    > Almost all the makefiles that I have ever seen used in open source software projects are in my opinion horrible garbage

                    I mostly agree with your post, and I use Make for my own projects. But, I think there's a reasonable argument that if a tool is so hard to use that no one uses it correctly, it's not a very good tool.

                  • lelandbatey 4 years ago

                    Can you link to some examples? I've dug around on Github and tried to find some examples of projects using different kinds of build systems, but I don't think they are great examples of what you're talking about. For others who may want to see examples, here they are:

                    - A Makefile that runs cmake which generates ninja build files that build the project. Neovim: https://github.com/neovim/neovim/blob/master/Makefile

                    - Cmake that generates ninja build files which build the application. OBS (Open Broadcaster Software) : https://github.com/obsproject/obs-studio/wiki/build-instruct...

                    - A makefile that builds the application. Localstack : https://github.com/localstack/localstack/blob/master/Makefil...

                    - Cmake that generates Makefiles that build the application. Krita : https://docs.krita.org/en/untranslatable_pages/building_krit...

                    • adrian_b 4 years ago

                      The makefiles indicated by you are relatively simple makefiles, they do not belong to the class "horrible".

                      The main problem even with these simpler makefiles is that they are too complicated, because they are written for a single project.

                      This is something that is difficult to change in the case of most open-source projects, which are intended to be independent from other software projects.

                      The greatest simplifications in makefiles are done by extracting the common parts of the makefiles from all projects in generic makefiles that should be included in the specific makefiles of each project.

                      Doing this, it is possible to reduce the effort of writing makefiles for 100 or 1000 software projects to little more than the effort of writing a single makefile.

                      Besides the reuse of the same make rules, of the same make targets and of many make definitions in all projects, other important simplifications are to never write manually the file dependencies when they can be detected automatically, which is normally true for all compilation tasks, and to never write manually the lists of source files, because they should also be detected automatically.

                • 112233 4 years ago

                  Agree that ninja+something can be much better than make. ninja is such a clean minimal design. But cmake? Really? cmake —-help-full is like 2.5MB, and looks like it refers to any know library and tool in the universe. Mahbe I am missing by a mile, but did we not get enough magic exposure with autoconf already?

              • eMSF 4 years ago

                Probably not. You'd need a lot more than a petty switch to grammar regarding indentation to convince people to switch to an unproven alternative, though.

                • throwaway894345 4 years ago

                  My snarky response is that unproven is better than disproven, but my personal feelings aside, make undeniably has marketshare and people aren't likely to switch to something else unless it offers them a more significant improvement than naming/indentation.

                  • samatman 4 years ago

                    I think, maybe, both of these responses are missing the fact that make is not a program, but rather, a number of programs with the same invocation name.

                    A fork of one of these makes, which did not have the two glaring flaws I refer to, but was otherwise make, would still be, well, make.

        • Vogtinator 4 years ago

          Spaces are almost ok. Colons however...

    • lifthrasiir 4 years ago

      For starters, ffmpeg does not use raw Makefile; it has to be generated by running configure. Historically configure (and autoconf etc.) was required due to the variety of platforms to support, which is increasingly less relevant today. The real "raw" Makefile---where you are supposed to run just `make` to build---is not as cumbersome as you may think; even the dependency among source files can be automatically generated.

    • bsenftner 4 years ago

      Makefiles are extremely powerful. I used to write them myself by hand, for a lot more than program generation. Makefiles can be used to recognize data events, and trigger responses - which I used for years in scientific visualization. In grad school, in the inevitable group projects where people lag and do the work at the last possible minute, I used makefiles to recognize when their contribution landed in the share folder so I could review and incorporate. Makefiles are the IFTTT of the pre-Internet era.

      • coldpie 4 years ago

        Makefiles are excellent, but I think they're hampered a bit by their extremely terse syntax (see also: perl). I wonder if a slightly different dialect would help modern users who are used to more verbose languages work with them.

        Off the top of my head, take this make example:

            %.o: %.c %.h
                gcc -o $@ $<
                mkdir $*
                cp $@ $*
        

        and spell it out a bit more:

            $MATCH$.o <- $MATCH$.c $MATCH$.h
                gcc -o $OUT$ $FIRST_DEPEND$
                mkdir $MATCH$
                cp $OUT$ $MATCH$
        

        Obviously this needs a lot more thought than that, but I think newbies would find the 2nd format much more friendly than the first.

        • mrlonglong 4 years ago

          I like it, reduces the need to browse through documentation to find out the exact syntax. Been there, got the t shirt many times.

    • mort96 4 years ago

      I use raw makefiles because I know (GNU) make and all the alternatives I've used are worse.

    • jedisct1 4 years ago

      Because if something works, and the actual project developers are comfortable with it, why change it?

      For new projects, people may prefer to use something like Zig as the build system. But a build system is not what will make the project faster or magically add new features and fix bugs. What makes that happen is developers being comfortable with the source code, including its build system.

elevaet 4 years ago

Sounds like this particular piece of news is underwhelming, but from my own casual experimentation, JPEG XL delivers much better quality vs compression ratio than Google's WebP (and the lossless compression is really good too).

I look forward to the day when JPEG XL is widely supported by web browsers.

https://caniuse.com/jpegxl

  • NavinF 4 years ago

    You should compare it to AVIF (already supported on chrome and firefox). WebP is much older and already supported everywhere.

    • elevaet 4 years ago

      Thanks, I didn't know AVIF was well supported alreadyA I remember I couldn't decide if I liked AVIF or JPEG XL better quality-wise, but the support would make AVIF the clear winner.

      • theandrewbailey 4 years ago

        I've been using AVIF on my blog for about a year. It's worth noting that AVIF seems to have better quality at lower sizes (~0.5 bits per pixel, ~120KB at 1080p) than JPEG XL (at least for right now), so even if browsers supported JPEG XL, you still might get better optimization with AVIF.

    • bick_nyers 4 years ago

      The coolest part about JXL that I want to use specifically (over AVIF) is progressive coding:

      https://youtu.be/UphN1_7nP8U

      • elevaet 4 years ago

        Very cool.

        Which reminds me, what the heck happened to old-school progressive JPEGs? I remember seeing them a lot in the early days of images on the internet, but it seems like you don't see them around anymore. Why is that?

        • theandrewbailey 4 years ago

          They're still being used. A newer, optimized JPEG encoder, mozJPEG[0], seems to use progressive encoding by default. I suspect with faster internet speeds, most JPEGs download and decode so fast that the cool 'enhance' animation is rarely seen anymore.

          [0] https://github.com/mozilla/mozjpeg

        • bick_nyers 4 years ago

          For it to be worth the effort to implement/maintain your users need to be bandwidth-constrained, which is not really a reality anymore, jpegs don't take upwards of a minute to load for most people.

          It has applications still, such as in medical imaging.

        • jonsneyers 4 years ago

          If you treat progressive jpeg and sequential jpeg as separate image formats, then progressive jpeg is currently the fastest growing image format on the web. If you look at the statistics, the opposite is true of what your feeling is.

          One thing that did change is that often the network is fast enough to make it unnecessary to show progressive passes, or if they're still shown, it happens quickly enough to be not really noticeable.

      • maxloh 4 years ago

        > This is likely to put too much pressure on the CPU and memory of the decoding client as each refresh event involves a full pass through the decompression system.

        > On average, decoding a progressive JPEG image is equivalent to decoding the baseline one 3 times.

        This feature wasn't added for a reason[0].

        [0]: https://developers.google.com/speed/webp/faq#does_webp_suppo...

        • bick_nyers 4 years ago

          Interesting, although it will depend on how bandwidth constrained your users are vs. their CPU/memory profile. If downloading images takes longer than decoding, it swings in favor of progressive decode.

          In .jxl, it is an optional feature.

        • jonsneyers 4 years ago

          Progressive JPEG has ~10 scans by default in libjpeg/mozjpeg. Lossy JPEG XL always allows minimal progression (2 scans, 1:8 followed by 1:1), and uses maybe 3-5 scans when encoding with more progression.

          In any case, I think the "costs too much cpu" argument is not really fair, since there is nothing forcing an implementation to do explicit flush/repaint at every scan. In fact, browsers will only do a refresh when cpu is _not_ the bottleneck, but network is. When cpu _is_ the bottleneck (e.g. the file is loaded from local cache), you can just decode the whole file non-progressively and have only a single refresh (just like with inherently non-progressive formats).

          If network is the bottleneck, then the choice is between cpu time (avoiding progressive previews to save some cpu effort) and human time (show previews so something can be shown earlier). I think human time is more valuable, by a few orders of magnitude.

  • rndgermandude 4 years ago

    Another feature that is very interesting to me is bit-exact lossless conversation between jpeg and jpeg-xl, in both directions that is. This essentially allows to take a jpeg, run the vastly improved lossless compression stages of jpeg-xl over the the original lossy compressed jpeg data (jpeg "coefficients"), preserve metadata, and get a jpeg-xl result that the jpeg-xl implementations understand, and which you can losslessly convert back to an ordinary jpeg that is a bit-exact reproduction of the original jpeg, if need be.

    The compression ratio will not be as good as full jpeg-xl (having skipped the lossy stages), but you still get something in the range of 20% smaller file sizes without any additional quality loss whatsoever.

    This is something WEBP/AVIF/HEIC does not offer. When using those codecs, you will either have to accept additional lossy compression artifacts on top of the artifacts of the original jpeg codec, or convert in lossless mode with worse compression ratio.

    • LinAGKar 4 years ago

      I wonder how the compression ratio of JXL-ified JPEG compares to WEBP/AVIF/HEIC.

      • rndgermandude 4 years ago

        Comparing compression ratios is tricky. What you usually want is "file size at same visual quality" or "visual quality as same file size" for comparisons. The problem here is that "visual quality" is in the eye of the beholder, Different base images will have different results.

        There are some attempts at such comparisons, e.g. https://cloudinary.com/blog/how_jpeg_xl_compares_to_other_im... (cloudinary might be biased, as they are a major driver behind jpeg-xl)

        My overall impression is that it's roughly on par or a little behind with AVIF, somewhat ahead of HEIC and very ahead of WEBP (and jpeg of course) in quality-per-byte.

        As for encode and decode speed, it's a bit slower than WEBP but beats AVIF and HEIC by a margin (unless these codecs are back by hardware encoders). However, all three codecs are relatively new and there may be a lot of future speed optimizations possible. Especially jpeg-xl, which isn't "backed" by general AV1 (AVIF), vpx (WEBP) or HEVC (HEIC) research, may have a particularly large yet to be tapped potential for (hardware-specific) optimizations. As far as I know, jpeg-xl is also "simpler" than those other codecs (which basically used the iframes of their complex sibling video codecs as a base), so it might be more feasible to have more competing implementations.

        But time will tell, and it will of course also largely depend on the adoption and thus network effects of these formats who much "love" each format receives from open source and proprietary software vendors.

        • jonsneyers 4 years ago

          Generally speaking the results I've seen so far indicate that at low bitrates (e.g. below 0.5 bpp), the video codecs (AVIF, HEIC, VVC) perform best, while at medium to high bitrates, JPEG XL performs best. This makes sense considering that video codecs aim at lower bitrates than still image codecs. Basically video codecs have more coding tools to "hide artifacts" at low bitrates (e.g. strong smoothing filters), while JPEG XL has more coding tools to "preserve detail" at high bitrates (e.g. strong entropy coding, more subtle filters).

    • bob1029 4 years ago

      This is of intense interest to me - I had no idea you could do this with an existing jpeg. 20% would be a world-changing difference for an application I am working on right now, assuming the added encoding/decoding stages do not add substantial latency to the process.

      Is there some variant of libjpeg-turbo that works for XL?

      • joshcryer 4 years ago

        Unfortunately as far as I can find there is no optimized encoder or decoder for JXL yet. Everything uses the spec encoder, which works fine on modern hardware, but for an example on my 20 year old laptop it takes several seconds to decode an image. Encoding an image with "tortoise" mode takes 10+ minutes. One nice feature though is that JPEG->JPEG XL lossless encoding was a priority, and it's as easy as doing "cjxl my.jpg my.jxl". The result is a lossless encode with EXIF data kept for a full bit perfect JPEG if you do "djxl my.jxl my.jpg." It's also pretty fast even on my old laptop.

        • bob1029 4 years ago

          > 10+ minutes

          Ouch.

          I'll stick to regular jpeg for now... I can crank out a 1080p encode in under 10 milliseconds using libjpeg-turbo on my target platform.

          • rndgermandude 4 years ago

            The 10+ minutes that OP observed where in tortoise (=9) mode tho. That's the slowest mode, comparable to "placebo" mode in x264, and meant as a "test" mode, not as a daily driver.

            The libjxl default is "squirrel" (=7), and you can go as low as lightning (=1), so you have a choice to trade compression efficiency for compression speed.

            Additionally, there are different decoder modes (in the encoder), allowing you to make tradeoffs between efficiency/density vs speed.

            But yeah, libjxl will remain slower than libjpeg-turbo, especially on encodes.

qwerty456127 4 years ago

Nice but we still need at least cameras, ideally also OSes' default picture viewers and major web browsers to support it OOTB or it will never become a thing.

  • bick_nyers 4 years ago

    https://www.npmjs.com/package/jxl-wasm

    Perhaps this means it can be shoehorned in anyways?

    • qwerty456127 4 years ago

      Browsers are the least important part. People use ordinary JPEG because that's what their cameras produce without asking and that also is what they can just click and open on all their PCs/whatever using their default picture viewer app. E.g. WebP still opens a browser when you click it and that's weird.

      • zokier 4 years ago

        Cameras are moving to support HEIF. Sony, Canon, and Nikon cameras support HEIF, as do iPhones. Android cameras may support HEIF depending on the vendor.

        • qwerty456127 4 years ago

          HEIF is a separate format, right? If so JPEG XL probably is doomed.

        • jonsneyers 4 years ago

          HEIF and in particular HEIC is a patent encumbered codec though...

          • qwerty456127 4 years ago

            Why patent-encumbered codecs use to end owning the market? E.g. nobody but Google itself ever seemed enthusiastic about WebM.

thrdbndndn 4 years ago

Kinda off-topic: which one is the "main" domain for FFMPEG repo, git.ffmpeg.org or git.videolan.org?

  • mr_sturd 4 years ago

    They both look like they're in sync, but at the top of git.videolan.org shows a notice saying they're moving their projects over to GitLab. The list of projects being moved over doesn't include FFmpeg, so I guess ultimate ownership is at ffmpeg.org.

donatj 4 years ago

I’m still waiting for JPEG2000 to take off.

  • elevaet 4 years ago

    Wavelet transforms!

  • mpfundstein 4 years ago

    well every cinema probably uses jpeg2000 (dcp) and the new interoperable master format is using it as well (though it also supports more mainstream codecs)

    dont see hollywood moving away from it pretty soon.

    problem is jpeg2k just is too heavy to compute.

  • jahewson 4 years ago

    Hey, it’s supported inside PDFs.

  • ksec 4 years ago

    Speaking of JPEG2000, anyone knows how long until its core patents expire? And Motion JPEG2000 ?

    • jonsneyers 4 years ago

      The core part of j2k was always royalty-free, actually.

ducktective 4 years ago

So what does it mean? FFmpeg can now do what imagemagick does?

  • mort96 4 years ago

    The biggest consequence would be that this opens the door for all software built on top of ffmpeg to add support for JPEG XL. Some might even support it automatically if they're linked against an ffmpeg which supports it.

    • yboris 4 years ago

      I've been waiting to use JPEG XL (.jxl) in my Video Hub App for over a year now! I even have a PR that shows that it works, but was waiting for FFmpeg to catch up.

      https://github.com/whyboris/Video-Hub-App/pull/702

      My software extracts screenshots from videos and shows them in a nice browsable searchable gallery.

    • 149764 4 years ago

      In particular mpv can now open jxl images, there is also a recent commit that adds support to make jxl screenshots.

      As I use mpv both as a video player and as an image viewer, this is great news for me.

  • LinAGKar 4 years ago

    It's not designed for still images, so it probably doesn't have all the features ImageMagick has for that. But it can convert between video files and loose numbered image files, and it can convert cover art. And there is animated JPEG XL.

jokoon 4 years ago

I managed to write a script to build a xstack command, that was great.

I recently tried to build a command to automatically add a silent audio track on inputs, while also adding pause and concatenate 300 small videos, all of this in a single command, but I still have a lot of trouble understanding how stream selector work.

declnz 4 years ago

TIL about JPEG XL itself, looks pretty cool. Thanks!

delanded 4 years ago

Does that mean I can convert a video to .jpg using JPEG XL now?