VideoPrivacyMasker - Work In Progress - (2020-07-03)

Started by kevin, July 03, 2020, 09:48:04 PM

Previous topic - Next topic

kevin

VideoPrivacyMasker - Work In Progress - (2020-07-03)

  This tool started out as bit of joke, I needed a way to sync sprites over a video as my video editing platform of choice kept giving me problems.  So in typical coder fashion, I figured I'd try and make my own tool.    

  The objectives of the project are to let a user import a frame separate video,  quickly edit some animations that will sync with video and ultimately export the animation rendered over the input animation.  

 


PlayBASIC Live - VideoPrivacyMasker  V0 11   Code Review - (2020-07-03)



 Today we'll look at a simple tool that helps the user sync up privacy masking over videos.  So in short the tool lets the user overlay 'blur' effects in sync with the video.  The animation effects are created by interpolating between a series of key frames.  So the user positions the key frames and the program renders the animation. The goal is to allow the user select sprites / effect to added and burn them into the final animation for export back a video.   But it doesn't do that as yet.



 



-------------------------------------------------------------------------------------------------------------------------------------
Credits:
-------------------------------------------------------------------------------------------------------------------------------------

     Video By:
  Kevin Picone
  http://playbasic.com  
  https://underwaredesign.com


  Video Cast:
  Sox and Sophie
  Ava and Kevin Picone
 

  Music:
 Spirit of Fire by  Jesse Gallagher

-------------------------------------------------------------------------------------------------------------------------------------

PlayBASIC LIVE PLAYLIST
https://www.youtube.com/playlist?list=PL_dvm0gvzzIVGlAhx34N6z2ce0ffMMOZ8

PlayBASIC BLOG PLAYLIST
https://www.youtube.com/playlist?list=PL_dvm0gvzzIU0Hnr6veV5UvwkSapHCo1J

PlayBASIC on FACEBOOK
http://www.facebook.com/pages/PlayBasic/127905400584274   (Facebook Page)

PlayBASIC on TWITTER
https://twitter.com/PlayBasic

-------------------------------------------------------------------------------------------------------------------------------------
#playbasic #sourcecode #animation




Downloads


  Attached bellow..

kevin

  
VideoPrivacyMasker - Draw Methods



   So looking at this today and dropped in some file name caching functions.  These will be used by animations with attached sprites.  So the anim is loaded and the key frame adds the filename of the 'image' at this frame to a the global list.   Then we load or pull the image as needed.  So if two anims use a common image it's not loaded two or more times.   This got me thinking though about how to handle how to select the display method of the keyframe.    I could use flags or something or nested child types, but was thinking about one step further and store the display list as a string.   Then parsing this this like to render it out.  


   Imagine if we have two display methods.   MaskedCircle (as seen in the video) and SPRITE option.   Which rotates and aligns the sprite to the 'size' at this location.  You can have some draw mode/method flags and fall through a select/case statement based upon the method.   But what if you wanted to combine things ?   Then you ended up have a bunch of combination methods are 'jumping' logic in your display routine.    Doable, but gets uglier and uglier the more display options to have.


   Alternatively what you could is store a list of Display methods in text.  Then write a simple parser that skims through the list and follows the user defined operations n order.   This is bit more work to write, but gives as much flexiblity as required.  


   Example:

PlayBASIC Code: [Select]
    DrawMethods$  = "MaskedCircle(Blur) "+PB_EOL$
DrawMethods$+= "Image(File=Filename Tint=$ffff0000 CenterHandle)"+PB_EOL$




   So parse cuts this into rows.   Looks at the operation on the left, then skims through the fields within the barkets, which apply these settings to the sprite.  

   Seems like a pretty doable and flexible on the surface at least.    We'll give it a go later


   

 

   



kevin

VideoPrivacyMasker - Draw Method Parser


   Today we look into coding a simple text parser that will decode a list of draw methods attached to what will be an animation event. So the idea is that we can write a list of draw method in text where each method includes a list of parameter variables that will need to be decoded and then interpreted by the animation rendering routines, for now we're just looking at a way to pick through the text and pull out the key bits of information that we'll need...  



   
Video:
 
 
     




   
Source Code:
 

    Attached.

kevin

VideoPrivacyMasker - Draw Method Parser - V0.05


   Here's a progression of the draw mode parser. Still working out the kinks really, but it's starting to take shape.     The attached demo includes the parser and the display part of the code.   This version is detached from the privacy tool, so i'm just drawing circles and loading sprites in this version.  But we're getting there as the ideas stack up.  

    Ideally, it'd be best to write a full lexer for such things, but this type of approach would do for most things.  




Download

   Attached