Page 1 of 1

Hide or obfuscate mp4 videos

Posted: Sat Nov 11, 2017 12:13 pm
by Batninja
Hi

I’m working on an application that uses included mp4 videos with Indy Livecode. However the mp4 files are easily copied from the standalone resource folder. Aside from using encrypt/decrypt commands which I assume will take a while on a large video does anyone have any other suggestions to hide or prevent copying of included mp4 files?

All suggestions welcomed.

Thanks

Roger

Re: Hide or obfuscate mp4 videos

Posted: Sat Nov 11, 2017 12:38 pm
by bogs
Well, if the clips are really large, this may not work for you, but you could always import the clip into the stack itself, which would surely keep anyone from copying it from a folder, at least easily.
Comments:
Unlike a player, a video clip contains the movie that it displays. This increases the memory required by your stack, because the movie data is loaded into memory whenever the stack file is open. However, it prevents the movie from being accidentally separated from the stack file and lost.

Video clips can be in QuickTime, AVI, or MPEG format.

A video clip is contained in a stack. Video clips cannot contain other objects. (A video clip is not a control, since it has no user interface and cannot be owned by a card.)

Re: Hide or obfuscate mp4 videos

Posted: Sat Nov 11, 2017 12:41 pm
by Batninja
Thanks for the suggestion but the videos are actually part of a web page that I use the browser widget to display.

Re: Hide or obfuscate mp4 videos

Posted: Sat Nov 11, 2017 2:15 pm
by richmond62
Anyone can download video content from a webpage.

Re: Hide or obfuscate mp4 videos

Posted: Sun Nov 12, 2017 10:16 am
by bogs
Batninja wrote: ↑
Sat Nov 11, 2017 12:41 pm
Thanks for the suggestion but the videos are actually part of a web page that I use the browser widget to display.
Your welcome, and I will leave the reply to the way your first question was worded in case some future visitor has this question.

Craig is correct, though, if the video(s) are already on a webpage, I don't know that you can do much about it if anyone with a regular web browser can access them.

Re: Hide or obfuscate mp4 videos

Posted: Sun Nov 12, 2017 10:40 am
by richmond62
Who is Craig?

Re: Hide or obfuscate mp4 videos

Posted: Sun Nov 12, 2017 11:53 am
by bogs
Well, thats what my cat said your name was, but if your going to be that way about it :P

My apologies to richmond.
bogs wrote: ↑
Sun Nov 12, 2017 10:16 am
Craig is correct, though, if the video(s) are already on a webpage, I don't know that you can do much about it if anyone with a regular web browser can access them.
should read
richmond is correct, though, if the video(s) are already on a webpage, I don't know that you can do much about it if anyone with a regular web browser can access them.
Image

Re: Hide or obfuscate mp4 videos

Posted: Mon Nov 13, 2017 9:41 pm
by Batninja
Hi thanks, but whilst the videos are embedded into a web page, the entire html page and mp4 is part of the application and loaded by the web browser widget on startup. I.e the page is not acquired from the internet but from the local resource folder. The URL is not identifiable to the user, it just looks like another card to them.

So I need a method to include a local file but make that file inaccessible to the user. :D

Re: Hide or obfuscate mp4 videos

Posted: Mon Nov 13, 2017 11:05 pm
by jiml
Well could you simply hide/show the folder containing the movies?

This works on macOS:

Code: Select all

constant hidName = "/resources/.movies", visName = "/resources/movies"

on showMovieFolder how
   if how = true then
      rename folder hidName to visName
   else
      rename folder visName to hidName
   end if   
end showMovieFolder
See here for other Ones:
https://en.wikipedia.org/wiki/Hidden_fi ... _directory

Jim Lambert

Re: Hide or obfuscate mp4 videos

Posted: Tue Nov 14, 2017 10:52 am
by Batninja
Thanks for the suggestion, however the hidden folder can still be accessed by a user if they turn hidden folders off (in Windows for example).

I think I have an approach that might work from reading another post about changing the bytes in the file i.e.

In development
1. Use the live code command Open file (specialfolderpath/video.mp4) for update
2. Append a few bytes to the start of the video file so it cannot be played
3. Manually rename the video file from video.mp4 to video.dat

On application launch, use live code to
1. Open file (specialfolderpath/video.dat) for update
2. Remove the few bytes from the start to revert the file to original
3. Change video.dat name to video.mp4 (so that the html page can load it)

This would not stop a determined hacker but would deter most regular users from accessing the video file.

If anyone can help with the steps 2 above i.e. Append bytes and Remove bytes using the Open file command directly on a file (i.e. not via a text field, since the video is too large) I'd be really grateful.

Roger

Re: Hide or obfuscate mp4 videos

Posted: Tue Nov 14, 2017 1:10 pm
by shaosean
If the videos are already on the end user's computer, you can Base64 encode the videos and embed them direct in to the HTML.. Obviously only you will know if this works for you.. You could always Base64 encode the videos and save them as .dat files and then do a replace on the HTML file with that data, that way your HTML files are kept small (and perhaps are part of the LiveCode stack)..

Code: Select all

<video><source type="video/mp4" src="data:video/mp4;base64,%BASE64_ENCODED_VIDEO"></video>