Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 731553
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T07:02:24+00:00 2026-05-14T07:02:24+00:00

So I have simple video tag on HTML 5 page playing OGG video. I

  • 0

So I have simple video tag on HTML 5 page playing OGG video. I want to take Its RGB colors in the format of the array (assuming we know width and height) containing colors for each pixel (from pixel 1,1 to maxWidth,maxHeight) like

{{R:Color, G:Color, B:Color}, {R:Color, G:Color, B:Color} ,...}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T07:02:25+00:00Added an answer on May 14, 2026 at 7:02 am

    You can use the HTML5 Canvas element’s drawImage function.
    http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#the-canvas-element

    Basically, you create a canvas with the same size as your video.
    Then, you acquire the canvas’s context with canvas.getContext("2d");
    call the drawImage(sourceVideo, dx, dy) function of the context. dx and dy should both be 0.
    Then, get the canvas’s imagedata via context.getImageData(sx, sy, w, h);
    Store the above image data into a variable, i’ll call it id.
    Your pixeldata array is stored in id.data in the format:
    `[r, g, b, a, r, g, b, a, r, g, b, a… etc]

    var canvas = document.createElement("canvas");
    canvas.width = video.width;
    canvas.height= video.height;
    
    var context= canvas.getContext("2d");
    context.drawImage(sourceVideo, 0, 0);
    var id = context.getImageData(0,0,video.width, video.height);
    for(var y = 0; y < video.height; y++)
    {
       for(var x = 0; x < video.width; x++)
       {
          //r = id.data[y*video.width + x + 0]
          //g = id.data[y*video.width + x + 1]
          //b = id.data[y*video.width + x + 2]
          //a = id.data[y*video.width + x + 3]
       }
    }
    

    Hope that helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple video html5 tag, bound to an ended event: $('#video').show().trigger(play).bind('ended', function
I have a mediaelement tag in my wpf-window. It's playing a simple animation, similar
I have a simple html5 video tag: <video autobuffer=true id=video controls=true> <source src=some_url></scource> </video>
I have simple html code that plays YouTube video after click on the image:
We have a simple HTML5 video tag and video which, when played, should play
I have an ogg video which works just fine using the video tag when
I have a simple page with an embedded video. Below is an example. I
I own a video streaming website and currently I just have a simple hit
I have people inserting video code to be displayed on my website. I want
I have a simple video encoding worker role that pulls messages from a queue

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.