A question because I am ignorant about low-level software.

Are there any self-decoding complex file formats?

I remember when you had to download hundreds of different codec packs in order to watch movies.

Given the size of a movie or audio file, would it be possible to bundle it with a cross-platform (Java?) decoder?

@Edent Challenge with video isn't complexity its performance. You could bundle anything pretty much with a bytecode language format (java, wasm whatever) the question would be can you make it fast enough. For old formats maybe.
The second problem is that you don't really 'decode' a lot of modern formats, you throw them at the GPU in the right manner and magic happens.

@Edent it would basically be an executable with the 'content' embedded in a data section. No different to self-extracting zip file.

There are even techniques to do multi-platform run anywhere binaries, eg: https://github.com/jart/cosmopolitan

GitHub - jart/cosmopolitan: build-once run-anywhere c library

build-once run-anywhere c library. Contribute to jart/cosmopolitan development by creating an account on GitHub.

GitHub
@Edent Just imagine what kind of security attack vector this would be. Multimedia has always been a weak spot where exploits flourish.
@Edent Don’t know if it’s what you’re referencing but PowerPoint used to have (maybe still does?) a package option which would output an .exe of your presentation.
@Edent does zpaq count? "To preserve forward and backward compatibility between versions as the compression algorithm is improved, it stores the decompression algorithm in the archive." https://en.wikipedia.org/wiki/ZPAQ
ZPAQ - Wikipedia

@Edent yes, Cosmopolitan - single binary blob that’s executable cross platform! Can bundle with data too, eg llamafile https://github.com/Mozilla-Ocho/llamafile
GitHub - Mozilla-Ocho/llamafile: Distribute and run LLMs with a single file.

Distribute and run LLMs with a single file. Contribute to Mozilla-Ocho/llamafile development by creating an account on GitHub.

GitHub
@Edent If a client asked me to create something like this, I would politely discourage them from doing it.
@Edent
- Easy target for security breaches when you link executables to data
- Java is the wrong platform to manage performance-sensitive tasks such as data compression and audio/video
- Java has no native UI to play audio/video, so you would still need some other environment around it (e.g. Android mobile OS)
- A better choice would be to pick the codec appropriate (and supported by) the target platform