Overlaying boxes on top of a playing <video> - html

We're building a tool where we have a video playing in browser, and for each frame of that video, we want to draw object detection boxes on top of the video (essentially just a boundary around objects detected in each frame).
The boxes have been previously generated offline, and the vertex information for each box stored along with frame number. We're looking to pass the vertices up to the browser and have the browser render them over the video. We're looking to avoid encoding the boxes in the video itself.
What's the best html approach to solve this problem?

Related

I have a black square displaying for a second whilst my video loads. How can I stop this from showing on my page? (websites.cx/video.html)?

I have a black square displaying for a second whilst my video loads. How can I stop this from showing on my page? (websites.cx/video.html)?
I'm using the html5 video attribute.
I've declared MP4 ogv mov in my htaccess file.
There are a couple of approaches that could be used here-
Use the poster attribute of the video element to set an image that will be shown in place of the video until the video loads (the specification actually states until the first frame is available).
The poster attribute gives the address of an image file that the user agent can show while no video data is available.
Be aware that this will involve an extra HTTP request and as such may not be significantly advantegous in the event of a small video file and/or large placeholder image. You could mitigate the effect of the extra HTTP request by prefetching the image, using a cached image, or simply ensuring you are using a well optimised image that is appropriately sized for the space you are displaying it in.
Set the visibility property of the element to "hidden" through a class which you remove after the load event of the video element has fired (you would need to subscribe to/listen for this event when the DOM content has loaded). I am suggesting use of the visibility property rather than display (or use of the global "hidden" attribute) as the video will still take up the defined amount of space on the page - preventing a "flash of restyled content" and re-arranging of the content around the video after it loads.

How can I zoom into video and switch streaming of videos in the same HTML5 player?

I have video that will be divided into 4 videos.
First the player will stream a lower resolution of the original video, then the user can zoom into the video to see more details, I need the player to stream one of the 4 videos - that's higher in resolution- based on where the user zoomed in.
How can I make that using VideoJS or any other video player ?
After searching, this is the answer ...
For zooming into the video, you can follow this tutorial: Zooming and rotating for video in HTML5 and CSS3
For switch streaming of videos in the same player, you can make that by changing the source on html5 video tag and make some calculations to know where the user zoomed in and hence change the source video.
As there is no response yet let me analyse the problem. This is by no means meant as a full answer, but other people will probably be able to answer parts of the problem:
First the player will stream a lower resolution of the original video,
This means you will need to create/use a video stream. There are plenty of plugins you can use for videostreaming, and depends on what you want. You can consider writing it yourself using for example C#'s System.IO objects and transforming the video in bytes(And putting it back together) The resolution would be easiest reached by just having a seperate video file for this step of the proces. (a lower resolution one used for streaming only)
then the user can zoom into the video to see more details, I need the player to stream one of the 4 videos - that's higher in resolution- based on where the user zoomed in.
So you need to trigger a zoom effect. This means you would need to detect zoom. This would be possible with Javascript in a webbrowser, if you want a browser based application. When that zoom is triggered you can retrieve what position the mouse is on the screen/in the div or on some sort of overlay. Depending on this position you could show another stream.
How can I make that using VideoJS or any other video player ?
Basically these steps above is how i would start looking into this specific case. Considering your VideoJS as a suggestion i assume this is browser based. This would probably mean using Javascript libraries, maybe combined with a server side language.
Thats as far as i can go. Maybe someone can pick up specific parts of the thing i wrote and help you a step further.
Have a nice day!

How can I remove youtube logo from the youtube player for use in other application?

I want to use the Charmless youtube player in my application and I want to remove youtube logo from the Player. How can i achieve this thing? My application is developed using AS3.
Simply add ?modestbranding=1 to the end of your URL.
See more here.
modestbranding (supported players: AS3, HTML5)
This parameter lets you use a YouTube player that does not show a YouTube logo.
Set the parameter value to 1 to prevent the YouTube logo from displaying in the control bar.
Note that a small YouTube text label will still display in the upper-right corner of a paused
video when the user's mouse pointer hovers over the player.
try this API player code.
http://www.youtube.com/apiplayer?version=3&modestbranding=1&showinfo=1
Chromeless player, the modestbranding has no effect unless "showinfo=1" is must for API player.
I tried to remove youtube logo by many ways. But I didn't get success to remove it from the youtube player.
Finally I check the youtube player functionality and behavior. When video is attached to the player then it will be displayed in center. if player container height is bigger then video height so both (top and bottom) side Black strip will be appeared. Just we have to hide the Black Strip from the user display area using masking concept. (In Flash we can apply the mask to container and same thing will be done using the DOM model in Javascript.)
In directly it will be removed as per end user perspective not actually. so Indirect way youtube logo is removed from the player.
you can try GKPlugin this plugin using JWPlayer 5.x at:
https://drive.google.com/folderview?id=0B0OhZLpuvlSRTDZLMXowQWNMZTA#list

Draw text on top layer of video embed when it's fullscreen

Now, I embed video from youtube and I have a trouble Which I can't draw anything (text, image, etc.) when video is fullscreen. So, what can I do to draw text or image (div) to show it when video fullscreen. I tried to use z-index, but it's not successful. I want to make new controller for my video player don't user youtube controller, but video was embed from youtube. So, when user user fullscreen mod, I want to show a div which contains control like play, pause, etc. I already use ?wmode=transparent but it's not work with fullscreen, It mean my controller not showed when I stay in fulscreen mode
You haven't given much information, but this website details what you require, I think.
http://www.electrictoolbox.com/div-layers-float-over-flash-vimeo-youtube/

Html5 video overlay architecture

I want to create a html5 page with video and an image overlay - meaning some image that is showing over the video. This overlay will in time also be text in some cases. Is there any good way to achieve this?
What I've been trying this far is to use a <video> tag to hold the video, and draw the image into a canvas, which I place on top of the video. To show it I need to move the video back setting z-index to -1, but then the video controls won't work. Maybe there's a solution to make the controls work again, but I'm not sure if I'm on the right path here.. I am assuming there is a recommended solution to this. Maybe using a canvas which I fill both video and overlay into. Or something completely different?
Note: I edited the question as it originally pointed in the wrong direction regarding what was important here. I'd love to have a solution which makes this work seamlessly in fullscreen and everything, but the focus is: What is the appropriate way to place items on top of video - in html5?
Achieving what you want and have it supported in out-of-the-box fullscreen is problematic. Fullscreen support in html5 video is only optional and in any way not accesible thorugh the API (See discussion here).
Even if you used the built in fullscreen there is no way you could inject content above it unless you are willing to change the video file itself on the server in runtime.
what you can do however (And what I did in a similar case) is to implement your own video controls, run the video tag without the built in controls, and have fun with overlaying as many layers as you want on top of your now out of focus video.
As for fullscreen, you can implement some sort of custom background fullscreen similar to what's been done here
edit: The problem you're having by placing a canvas over the video is blocking the built in html video controls. My suggestion is to implement your own video controls (play, pause, volume, seeker, etc.) using html and javascript calling the video API. You can probably even make it prettier then the ugly built in controls.
Your controls can be contained in a layer above the overlaid canvas, and thus the video will be shown, above it the overlay and above it your control set.
You can read a little about implementing your own controls here or here
And anyway this can easily be much better than this.