0

I have a html5 video tag with src attribute pointing to some website with mp4 file. Is it possible to get contents of this video when it has loaded as base64 string?

UPD: I need binary video data inside browser.

Thanx.

Stepan Yakovenko
  • 8,670
  • 28
  • 113
  • 206
  • If "some website" is not on the same domain as your webpage then you probably will not be able to get frames from the video exported to base64 urls -- that's because of security restrictions. If the security restrictions don't apply then check this previous post showing [how to capture frames from a video element](http://stackoverflow.com/questions/33917800/screenshot-from-video-at-different-time/33925844#33925844). – markE Jan 29 '16 at 18:36
  • @markE I'm not sure if OP wants each frame as dataURI or the whole media. For the later, xhr+filereader would be a better option (almost same crossorigin restrictions though) – Kaiido Jan 30 '16 at 05:39
  • @Kaiido. You mean re-encode the whole video? Awfully inefficient to use canvas to do that. – markE Jan 30 '16 at 06:11
  • @markE yep, but except the tag, there is no mention of canvas in OP, nor in my comment ;-) – Kaiido Jan 30 '16 at 07:38
  • @Kaiido. But isn't the 'canvas' tag there to do the re-encoding...else why have the canvas tag at all? Anyway, I don't understand what the OP is asking ... what are they trying to do? Do they really want to re-encode a whole video as a set of base64 strings --- weird? – markE Jan 30 '16 at 07:47
  • 1
    @markE I'm not sure either :/ IMM, canvas is one way OP does know for encoding still images, hence the tag. But clearly this is not the best way for a full video. Looking forward for more info from OP. – Kaiido Jan 30 '16 at 07:49
  • @Kaiido, -- updated q. to give more details – Stepan Yakovenko Jan 31 '16 at 07:49
  • @StepanYakovenko "binary" or "base64 string" ? Also you do realize you will play with heavily large objects ? – Kaiido Jan 31 '16 at 08:03

0 Answers0