I am working on iPhone application where i have included bright cove SDK to play video. I am able to play video but found letter boxing issue around sides of player view(black space on top and side bar). How can i avoid letterboxing around UIView corners? it would be great if you can provide any example or any sample code.I am attaching screenshot for player as well.
Get the ratio of the video from the video properties:
video.properties[kBCOVCatalogJSONKeyFLVFullLength][#"frameWidth"];
video.properties[kBCOVCatalogJSONKeyFLVFullLength][#"frameHeight"];
Then adjust the size of your video player view (playbackController.view) to suit the required height. This may involve the view being wider than its parent and clipping of the left and right sides, but will achieve the desired result.
Related
I want to use AVFoundation to set up my own camera feed and process the live feed to detect smiles.
A lot of what I need has been done here: https://developer.apple.com/library/ios/samplecode/SquareCam/Introduction/Intro.html
This code was written a long time back, so I needed to make some modifications to use it the way I want to in terms of appearance.
The changes I made are as follows:
I enabled auto layout and size classes so as I wanted to support different screen sizes. I also changed the dimensions of the preview layer to be the full screen.
The session Preset is set to AVCaptureSessionPresetPhoto for iPhone and iPad
Finally, I set the video gravity to AVLayerVideoGravityResizeAspectFill (this seems to be the keypoint)
Now when I run the application, the faces get detected but there seems to be an error in the coordinates of where the rectangles are drawn
When I change the video gravity to AVLayerVideoGravityResizeAspect, everything seems to work fine again.
The only problem is then, the camera preview is not the desired size which is the full screen.
So now I am wondering why does this happen. I notice a function in square cam: videoPreviewBoxForGravity which processes the gravity type and seems to make adjustments.
- (CGRect)videoPreviewBoxForGravity:(NSString *)gravity frameSize:(CGSize)frameSize apertureSize:(CGSize)apertureSize
One thing I noticed here, the frame size stays the same regardless of gravity type.
Finally I read somewhere else, when setting the gravity to AspectFill, some part of the feed gets cropped which is understandable, similar to ImageView's scaletoFill.
My question is, how can I make the right adjustments to make this app work for any VideoGravity type and any size of previewlayer.
I have had a look at some related questions, for example CIDetector give wrong position on facial features seems to have a similar issue but it does not help
Thanks, in advance.
Basically I have an SKScene, and I want to play a video over the scene. The video is confetti falling with an alpha background. It will play when the player gets a high score. I am using an SKScene with shapes and images drawn with shape nodes and image nodes. I just was wondering if anyone could please tell me how to play the video over the screen and still see the game in the back, and be able to touch the buttons through the video. It is supposed to look like an animation playing.
I am using a video because I was just thinking that playing a video would be more processor efficient than having the game generate particles.
There is no built-in iOS solution. You can play 24BPP (fully opaque) movies under iOS, but the only built-in way to display alpha channel video would be to load a series of PNG images with alpha. Downside is that takes up a huge amount of memory and it bloats the app download. If you want to have a look at some working examples of this kind of functionality with a 3rd party app then see Alpha Channel Examples. You might also be interested in this blog post which shows example code of how to impl Alpha channel textures in OpenGL would could be implemented on top of SpriteKit too. The cube example shows rendering an alpha channel movie onto a cube, it was adapted from a Ray Wenderlich tutorial.
Here as an answer how to do that with GPUImageView. Also project on GitHub here and similar question from stackoverflow
The video stack doesn't yet support formats with alpha. For confetti, you should use SKEmitterNode. Size it to the area you envisioned for your video, and see Creating Particle Effects, i.e., its link to Add a particle emitter to your project and try out the "Snow" effect. It looks more like confetti when you give it a different color than white. Click the dot under "Color Ramp" to set the color.
I want to develop a feature into an application, by which an vintage projector effect can be given to a recording video or a pre recorded video. If you want i an share an image. i want the effect similar to it, one part of the recording video is showing in the bottom frame and the bottom part of the recording video is showing in the top frame. Along with this the whole view should shake like a real vintage projector recording.![enter image description here][1]
Did you take a look at GPUImage?
It has lots of options for video recording/processing and allows to add/combine different filters.
I have a home theater setup and the beam is just barely too wide, and I'd like the video to come in a bit. I'm really surprised there is no was to zoom out, as in add black boxing to the video/squeeze it in. Any thoughts?
With O (key), you set auto-scaling to "Original Size". Then, Alt-O and Alt-Shift-O increase and decrease scale factor.
Take in mind that Alt-O and Alt-Shift-O don't work on "Scaled to screen" auto-scaling.
The hot keys are in this vlc page.
Looks like VLC has a zoom feature under Window > Video effects...
Video Magnification/Zoom In & Out
Another intriguing feature is Video Magnification. Under Geometry tab,
enable Magnification/Zoom option, to let it zoom in/out the video. You
will see a small window at top left corner with the main magnification
control. Fill in the triangle by clicking it to zoom into the video.
To view the desired video portion, move the square capturing screen
across the box.
VLC Player - Interactive zoom / Magnify
First go to VLC installation directory and than execute this command
vlc --video-filter "magnify" "path/to/video"
I am playing video in Blackberry,it plays well but i need to show the video in full screen mode.Now it plays video with spaces at top and bottom i have to play in full screen
For this i used methods
videoControl.setDisplayFullScreen(true);
_videoControl.setDisplaySize(Display.getWidth(),Display.getHeight());
But those are not working how can i solve this.
The video player can be incredibly fickle when it comes to what sizes it will display. From my testing, it seems that you have to hit one of the magic ratios (half size seemed to work pretty reliably) or it just won't show anything.
Rather than setting the size that would equal fullscreen as well as telling it to be fullscreen, you should probably use VideoControl.setDisplayFullScreen() without the setDisplaySize()
I have an answer about camera programming that might help Black berry camera programming