Adding watermark bitmap over video in android: 4.3's MediaMuxer or ffmpeg -


here scenario:

  • download avi movie web
  • open bitmap resource
  • overlay bitmap @ bottom of movie on frames in background
  • save video on extarnal storage
  • the video length 15 seconds usually

is possible achieve using mediamuxer ? info on matter gladly received

i've been looking http://bigflake.com/mediacodec/#decodeeditencodetest (thanks @fadden) , says there:

"decoding frame , copying bytebuffer glreadpixels() takes 8ms on nexus 5, fast enough keep pace 30fps input, additional steps required save disk png expensive (about half second)"

so having 1 sec/frame not acceptable. thinking 1 way save each frame png, open it, add bitmap overlay on , save it. take enormous time accomplish.

i wonder if there way things this:

  1. open video file external storage
  2. start decoding it
  3. each decoded frame altered bitmap overlay in memory
  4. the frame sent encoder.

on ios saw there way take original audio + original video + image , add them in container , encode whole thing...

should switch ffmpeg ? how stable , compatible ffmpeg ? risking compatibility issues android 4.0+ devices ? there way use ffmpeg acomplish ? new domain , still doing research.


years later edit:
years have passed since question , ffmpeg isn't easy add commercial software in terms of license. how did evolved? newer versions of android more capable on default sdk?

i don't know mediamuxer ffmpeg support overlaying functionality. ffmpeg has various filters 1 of them overlay filter. understand want overlay image (i.e. png) on video, ffmpeg surely useful framework job. can set output format can set co-ordinates of image overplayed.

e.g.

ffmpeg -i input.avi -i logo.png -filter_complex 'overlay=10:main_h-overlay_h-10' output.avi 

above command adds overlays logo.png on input.avi video file in bottom left corner.

more information filters available @ following website,

https://www.ffmpeg.org/ffmpeg-filters.html#overlay-1

if solution problem need c code equivalent above command. need see performance of ffmpeg because pure software framework.

hope have understood question correctly , helps.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -