How to show different images based on Object ID
Here's a solution using OSL to read from multiple images based on the Object Index.

Enable OSL and paste the following into a new Text Editor datablock named something like dynamic_texture.osl :

shader dynamic_texture(
    vector Vector = P,
    string FileName = "",
    float Index = 0,
    string Suffix = ".png",
    output color Color = color(1,1,0)
    ) {
    int _index = (int)Index;

    Color = texture(format("%s%i%s",FileName,_index,Suffix), Vector[0], Vector[1]);

}


In the Node Editor you can now add a Script node and point it at the new Text block. This should create you a new node with inputs for Filename, Suffix, and Index. This can be used to feed the Object Info Object Index to dynamically select the required texture from a set of images :



Note that the filename is absolute in your filesystem - so you need to specify the full path - or prefix with //to specify a relative path in relation to your saved .blend file (eg, //rendered/ for a local subdirectory named ‘rendered’). In my example I placed the files in c:\users\rsedman\Pictures and named them 1.png, 2.png, 3.png, etc. The Suffix indicates the filename suffix - in this case .png.



EDIT : In order to allow for multiple 'frames' per image set you could amend the OSL shader code to the following :

shader dynamic_texture(
    vector Vector = P,
    string FileName = "",
    float Index = 0,
    float Subframe = 0,
    string Suffix = ".png",
    output color Color = color(1,1,0)
    ) {
    int _index = (int)Index;
    int _subframe = (int)Subframe;

    Color = texture(format("%s%i_%04i%s",FileName,_index,_subframe,Suffix), Vector[0], Vector[1]);
}


This will add an additional 'Subframe' input to the socket and the filename will now be built using the subframe as an additional suffix (with up to 4 leading zeros).



For example, setting the Filename parameter to '/tmp/images/', the Index to 3, the Subframe to 26, and the Suffix to '.png' will pick up the image from /tmp/images/3_0026.png. In this way you can use the node to pick out a particular frame of your particular set of images. To drive this from an MP4 video you would need to split out the individual frames and name each file appropriately.

This can produce the following result :



NOTE : I don't know exactly how OSL manages memory and file access when accessing multiple images in this way - there may be a noticeable practical limit of how many images can be accessed by an OSL shader. If nothing more, it will certainly require a significant amount of additional memory to cache a large number of images.