frame

How to use custom video resolution when use AVFoundation and AVCaptureVideoDataOutput on mac

元气小坏坏 提交于 2020-01-03 10:43:50
问题 I need to process each frame of captured video frame, although AVCaptureDevice.formats provided so many different dimension of frame sizes, it seems AVCaptureSession only support those frame sizes defined in presets. I've also tried to set AVCaptureDevice.activeFormat before AVCaptureInputDevice or after, no matter what setting I set, if I set AVCaptureSessionPresetHigh in AVCaptureSession , it always give me a frame of 1280x720. Similar , If i set AVCaptureSessionPreset 640x480, then I can

Force iframe to Load Full Frame

廉价感情. 提交于 2020-01-03 02:48:06
问题 I have an HTML page (say welcome.html) which contains an iframe to a page I have no control over (say app.html). The user performs some actions using the app within the iframe and clicks submit. Once they do this, they are taken to a new page (say thanks.jsp), which loads within the iframe. Is there a way in which I can force thanks.jsp to load in the full frame and not the iframe once submit is clicked? Remember, I have no control over the logic behind that Submit button or app.html. I do

How can I remove pages from a Frame's history?

僤鯓⒐⒋嵵緔 提交于 2020-01-02 07:43:12
问题 How can I manipulate a Frame's history in a WinRT XAML app? The user will start on my hub page, where they can select an existing project to go to its edit screen, or they can select "new project". "New project" will take them through a short wizard, then take them to the "edit project" screen. It makes sense for the wizard pages to just be pages that I navigate to in the frame; that way the user can back out of the wizard if they change their mind. (It'll only be two pages, so "back" can

boundingRectWithSize does not respect word wrapping

牧云@^-^@ 提交于 2020-01-02 01:11:51
问题 I create a UITextView, add text to it, and put it in the view (with a container) UITextView *lyricView = [[UITextView alloc] initWithFrame:screen]; lyricView.text = [NSString stringWithFormat:@"\n\n%@\n\n\n\n\n\n", lyrics]; [container addSubview:lyricView]; [self.view addSubview:container]; I then get the size of it for use with a button and add it to the UITextView CGRect size = [lyrics boundingRectWithSize:CGSizeMake(lyricView.frame.size.width, MAXFLOAT) options

How to present a view controller with smaller size

可紊 提交于 2020-01-01 13:19:32
问题 I want presented view controller vc2 in smaller size than the screen, how to do that in Swift 3 ?? Thanks for help. This is my code: @IBAction func leftButtonPressed(_ sender: UIButton) { let vc2 = self.storyboard?.instantiateViewController(withIdentifier: "Controller2") as! ViewController2 vc2.modalPresentationStyle = .currentContext present(vc2, animated: true, completion: nil) } 回答1: Try this.. @IBAction func leftButtonPressed(_ sender: UIButton) { let vc2 = self.storyboard?

How to present a view controller with smaller size

a 夏天 提交于 2020-01-01 13:18:51
问题 I want presented view controller vc2 in smaller size than the screen, how to do that in Swift 3 ?? Thanks for help. This is my code: @IBAction func leftButtonPressed(_ sender: UIButton) { let vc2 = self.storyboard?.instantiateViewController(withIdentifier: "Controller2") as! ViewController2 vc2.modalPresentationStyle = .currentContext present(vc2, animated: true, completion: nil) } 回答1: Try this.. @IBAction func leftButtonPressed(_ sender: UIButton) { let vc2 = self.storyboard?

Download first frame of video android programmatically

删除回忆录丶 提交于 2020-01-01 07:03:33
问题 I want to download a single frame of a video file from a server from my android application. I do not wat to download the full video at front. Use that frame as a thumbnail to display to the user, so that if choosen by user it can be downloaded. 回答1: ffmpeg can create a thumbnail from a video stream using this command: ffmpeg -itsoffset -4 -i http://somevideosite/test.avi -vcodec mjpeg -vframes 1\ -an -f rawvideo -s 320x240 thumb.jpg To get ffmpeg into android seems doable. 回答2: It will be

Download first frame of video android programmatically

与世无争的帅哥 提交于 2020-01-01 07:03:22
问题 I want to download a single frame of a video file from a server from my android application. I do not wat to download the full video at front. Use that frame as a thumbnail to display to the user, so that if choosen by user it can be downloaded. 回答1: ffmpeg can create a thumbnail from a video stream using this command: ffmpeg -itsoffset -4 -i http://somevideosite/test.avi -vcodec mjpeg -vframes 1\ -an -f rawvideo -s 320x240 thumb.jpg To get ffmpeg into android seems doable. 回答2: It will be

Where to get frame size of custom UIView in its subclass

烈酒焚心 提交于 2019-12-31 20:08:03
问题 When does the correct frame size of the UIView is calculated when I add my custom UIView by using storyboard? I can't get correct frame size in UIView's init(frame: CGRect) or init(coder aDecoder: NSCoder) or awakeFromNib() . I get the correct size in override func layoutSubviews() but this time the view is not added to the view controller's view. Edit: I want to do this in the UIView subclass because I add a CAGradientLayer layer (which has same size with my view) to my custom UIView . There

How to get raw frame data from AVFrame.data[] and AVFrame.linesize[] without specifying the pixel format?

China☆狼群 提交于 2019-12-31 13:13:29
问题 I get the general idea that the frame.data[] is interpreted depending on which pixel format is the video (RGB or YUV). But is there any general way to get all the pixel data from the frame? I just want to compute the hash of the frame data, without interpret it to display the image. According to AVFrame.h: uint8_t* AVFrame::data[AV_NUM_DATA_POINTERS] pointer to the picture/channel planes. int AVFrame::linesize[AV_NUM_DATA_POINTERS] For video, size in bytes of each picture line. Does this mean