I'm making a (local - Multi-Platform) video protection app but I don't know what is the right solution to first "encrypt->save on HDD" and then "load from HDD->decrypt->play" encrypted video.
I read about MPEG-DASH and some DRMs and found this Bento4 command:
mp4dash --encryption-key=000102030405060708090a0b0c0d0e0f:00112233445566778899aabbccddeeff --encryption-args="--property 1:ClearLeadFragments:10 --property 2:ClearLeadFragments:10" movie.mp4
but I'm not sure that MPEG-DASH can be a part of solution or not.
How can I solve this?After many searches on google I found the answer of @erti-chris-eelmaa here:
I wrote my own Videoplayer using openGL+FFMPEG that could play mp4 and decrypt each frame in the GPU using shaders. I also experimented with another possible solutions, such as streaming from a webserver using VLC. (VLC offers some kind of encryption/decryption when dealing with streams), and yada yada yada.
Also one solution was to use 4 mediaelements(WPF) and the actual video was virtually split into 4 areas and each area was rotated so the video was not viewable. Once you loaded the video into 4 mediaelements, you could map out which part you wanted to show and also rotate it back. But in all honesty, MediaElement is bad.
However I ended up exactly with what RomanR said. I built DirectShow graph using mp4splitter, ffdshow, videorenderer and I modified mp4splitter sourcefilter. The reading happens in BaseSplitter/AsyncReader.cpp (just modify SyncRead function) that mp4splitter uses.
If you would like to implement it yourself, just use MPC-HC project and modify the filters as you like. It took me some time to get around the DirectShow concept, but once you understand it, it becomes great weapon.