Log in

View Full Version : Embedding a CODEC in a container...


Laraul
17th August 2006, 18:48
You know what would be a great idea? Storing the codec required to play a video/audio stream inside the container so it'll play regardless what the user has installed on his system. This would increase the file size a little... but it would be worth it for the convience of not worrying about it not playing... of course the codec would have to either be compiled on the fly or precompiled for multiple platforms upon distribution. The former would be better of course. There is probably a very dumb (i.e. legal) reason why this hasn't been done.

mod
17th August 2006, 18:52
Actually it's possible to burn the container together with a standalone software player (as MPC, VLC or Mencoder) and make a full working autorun that doesn't require to install anything on the target pc.

GodofaGap
17th August 2006, 20:31
Compiling the codec on the fly and accomodating for different players/APIs and platforms. That's funny. What about all the people who do not have a compiler installed (not even mentioning a compatible one)?

Reino
17th August 2006, 21:08
Haha, the first thing I remembered after reading the first post was "CyberMP4" with its exe-files. I still have several of those exe-audibles on my computer. I took the liberty to upload one.
Perhaps it's just MPEG-2 AAC, but I'm still amazed by it's audioquality, even after more then 6 years!
It was a nice idea, having an exe-file which was infact a small application/audioplayer with a nice cover of the artist and sometimes even backgroundinformation was included.
I haven't seen any of those things ever since.
http://d.turboupload.com/d/888661/Medicine_Drum.exe.html

bond
17th August 2006, 21:19
you could attach a codec/player/whatever in the udta atom of mp4 but i dont think it would be possible to autostart that player from inside the mp4 to play the mp4...

apart from that, what if someone tries to play the file on a system the codec/player doesnt work on?

zambelli
18th August 2006, 01:36
Theoretically it could work - but it'd be up to the player to extract and install the codec before it even attempted to build a playback graph.

The biggest issue here is security. If you were to include binary code in a container, there'd be no way to guarantee the code is safe to run. Somebody could easily write a malicious DShow filter that, once registered, gets inserted into every graph, and then distribute it around with some highly popular media clip.

There are a number of other issues, such as installing the codec in non-admin user mode, maintaining and updating the codec once it's stored in a file, etc.

avih
18th August 2006, 11:43
@zambelli:
You do know that not every playback system in the world is windows based, right? :) e.g. mplayer, VLC. bsplayer in it's older versions, etc.

Also, the code can always run in a kind of sandbox, like java, javascript (not strictly binary, but compiled by the browser into binary code), or activeX (yay ;) ).

@mod:
actually, i know how to do that with mplayer or VLC (np, non-installer with all decoders built in), but not with MPC.

How do you make MPC use decoders which are not already installed (dshow ones because that's what it does) without any kind of installation? I was trying to do that with ffdshow.ax and some dlls, but with no success. Will you enlighten me pls? :)

mod
18th August 2006, 12:18
How do you make MPC use decoders which are not already installed (dshow ones because that's what it does) without any kind of installation?

Directly from the help file of MPC:
"You can directly connect filters' files without need to install them in your system. This allows you to burn configured MPC with all needed codecs on CD, so you can watch movies on any computer with Windows installed"

Go to Help -> CommandLine Switches . With /filter "filtername" you can make MPC load an xternal filter, that can be located also on the source cd. For a more detailed explanation just open the mpc_en.chm file available :)

Hope this helps.

I also think that this (http://www.theorica.net/autorun.htm) could be interesting if you're looking for a standalone player solution.

avih
18th August 2006, 12:43
thx, will try and update the other thread i've opened on that subject. cheers :)

zambelli
19th August 2006, 03:28
@zambelli:
You do know that not every playback system in the world is windows based, right? :) e.g. mplayer, VLC. bsplayer in it's older versions, etc.
I do realize that, which in turn only makes the idea more complicated to implement in a platform agnostic way. Anyway, I was under the impression the OP was talking about Windows, that's why I used DShow as an example.

Also, the code can always run in a kind of sandbox, like java, javascript (not strictly binary, but compiled by the browser into binary code), or activeX (yay ;) ).
It could, but that'd only work on a specific player that's been designed to use such code - which kinda makes the whole exercise pointless. If a special player is required, then one might as well just include the codec in the player, like MPC and VLC. :)

Koepi
19th August 2006, 10:12
I'm glad to see that security issues are discussed in every microsoft division! Putting a codec into a container is indeed a very bad idea. Even if you use a sandbox there's nearly always a possibility to break out of it. Also, performance-wise, it'd be a killer. Imagine a HDTV (1080i) encode decoded with a java-based codec...

Cheers
Koepi

avih
20th August 2006, 18:56
I'm glad to see that security issues are discussed in every microsoft division! Putting a codec into a container is indeed a very bad idea. Even if you use a sandbox there's nearly always a possibility to break out of it. Also, performance-wise, it'd be a killer. Imagine a HDTV (1080i) encode decoded with a java-based codec...

Cheers
Koepi

mate, long time :)
yeh, i was just teasing about embedded codec. i still can't see it practical. but it's always been a neat idea :)

Hellworm
26th August 2006, 20:51
eMoviX (http://movix.sourceforge.net/) is a small (8MB) linux distribution which can is put on a cd together with a movie or other media files. It boots from cd and plays the embedded media files. On Linux a you can burn a eMoviX CD using k3b. I tested some time ago and it worked quite well. It uses mplayer to play the contents. Sadly it seems its not developed any more and the main page is down. Also the mplayer version is very old, it doesn't even play avc. I tried to compile it with a newer mplayer version, but failed :D.

This is not really an embedded codec, but it nicely demonstates the possibilities.

Sharktooth
27th August 2006, 16:28
embedding a codec is not a good idea... but embedding something like an avisynth script (or something similar) could be interesting...

Hellworm
28th August 2006, 13:34
You mean something to do advanced postprocessing? But avisynth heavily relies on plugins ...

Sharktooth
28th August 2006, 14:11
yeah. the idea is:

1- A standardized scripting language
2- A highly optimized multiplatform common runtime/framework that can be integrated on the player or installed as a filter...
3- A common plugin interface that will make plugin work on any OS and system (you just need the runtime installed).