I'm doing a project where I have AES 256bit encrypted chunks of video (Original format of chunks is MP4)
When a user select start date and end date of the video which he wants to see,I have to decrypt the corresponding chunks and play them in a video player. The problem is that I can't store decrypted files on disk, but only load them into memory,say, I can only send byte arrays to the videoplayer.
I would like to implement this project in java, but I don't know how to stream chunks to the video player without having a physical file. Any ideas? Xuggler? Indeed, Is it possible to have a a web application or should I opt for a standalone application? Thanks
The best way to achieve this currently, in Java FX is to use an embedded HTTP server and use HTTP Live Streaming (video on demand). See this link to learn about HLS. So, whenever you are ready to play the video, before you create the Media object...
...on your local machine, in the directory that you passed to the CustomHttpHandler, you need to have a .m3u8 file and the files for playback. For the simplest case, the files for playback should be .ts files, but they can be ANYTHING as long as you convert them to the MPEG-2 TS format when you handle their request. Let's look at the CustomHttpHandler...
...notice that this HttpHandler is assuming the files you are going to serve are already in .ts format, but if you have something else (encrypted data, zipped data, MP4, RAW H264, binary, etc.), all you need to do is get it into the .ts format and write that data to the output stream above. Then all you do after you have this server up and running is create your Media!
...and that's it! Now you have a Java FX media player, that can load from anywhere and supports full playback capabilities (fast forward, slow motion, seek, etc.). d(-_-)b