GithubHelp home page GithubHelp logo

lmf12 / simplecam Goto Github PK

View Code? Open in Web Editor NEW
210.0 210.0 58.0 63.07 MB

基于 GPUImage 实现的简单相机。

License: MIT License

Ruby 0.04% Objective-C 76.93% C 9.75% Objective-C++ 11.73% GLSL 1.23% Metal 0.32%

simplecam's People

Contributors

lmf12 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

simplecam's Issues

关于架构问题

一直在关注这个项目,有个问题,你通过分类的形式对UIViewController进行瘦身,这种方式很新颖,能否谈谈你的理解呢?微信:fengpingguohaha

我有些疑问?

你好, 就是对于 GPUImage 的使用有些疑问, 现在我想获取到已经经过滤镜处理过的视频帧, 通过获取到滤镜链的最后一个滤镜, 然后执行-setFrameProcessingCompletionBlock 通过获取 output. framebufferForOutput 但是偶尔获取到的第一帧是没有经过处理的, 有时又是经过处理的, 还有时获取视频帧的时候当中有几帧是没有经过处理的, 请问有没有什么方法避免这种情况, 或者是我掉了什么代码. 最后就是希望能实现通过-setFrameProcessingCompletionBlock 获取到的都是处理的视频帧.
谢谢.

UI API called on a background thread

iOS13 iphone7 运行报这个warning

Main Thread Checker: UI API called on a background thread: -[UIView bounds]
PID: 11292, TID: 2714676, Thread name: (none), Queue name: com.sunsetlakesoftware.GPUImage.openGLESContextQueue, QoS: 0
Backtrace:
4 SimpleCam 0x0000000102e9a1d4 __39-[GPUImageView recalculateViewGeometry]_block_invoke + 56
5 SimpleCam 0x0000000102e738c8 runSynchronouslyOnVideoProcessingQueue + 104
6 SimpleCam 0x0000000102e9a17c -[GPUImageView recalculateViewGeometry] + 108
7 SimpleCam 0x0000000102e9ab78 __37-[GPUImageView setInputSize:atIndex:]_block_invoke + 312
8 SimpleCam 0x0000000102e738c8 runSynchronouslyOnVideoProcessingQueue + 104
9 SimpleCam 0x0000000102e9aa20 -[GPUImageView setInputSize:atIndex:] + 136
10 SimpleCam 0x0000000102e4cd5c -[GPUImageFilter informTargetsAboutNewFrameAtTime:] + 748
11 SimpleCam 0x0000000102e4ed94 -[GPUImageFilter newFrameReadyAtTime:atIndex:] + 216
12 SimpleCam 0x0000000102e4d048 -[GPUImageFilter informTargetsAboutNewFrameAtTime:] + 1496
13 SimpleCam 0x0000000102e4ed94 -[GPUImageFilter newFrameReadyAtTime:atIndex:] + 216
14 SimpleCam 0x0000000102e4d048 -[GPUImageFilter informTargetsAboutNewFrameAtTime:] + 1496
15 SimpleCam 0x0000000102e48a70 -[GPUImageCropFilter newFrameReadyAtTime:atIndex:] + 152
16 SimpleCam 0x0000000102e96590 -[GPUImageVideoCamera updateTargetsForVideoCameraUsingCacheTextureAtWidth:height:time:] + 1716
17 SimpleCam 0x0000000102e96e9c -[GPUImageVideoCamera processVideoSampleBuffer:] + 2124
18 SimpleCam 0x0000000102e97a58 __74-[GPUImageVideoCamera captureOutput:didOutputSampleBuffer:fromConnection:]_block_invoke + 176
19 libdispatch.dylib 0x0000000103c217fc _dispatch_call_block_and_release + 24
20 libdispatch.dylib 0x0000000103c22bd8 _dispatch_client_callout + 16
21 libdispatch.dylib 0x0000000103c29b48 _dispatch_lane_serial_drain + 744
22 libdispatch.dylib 0x0000000103c2a6e4 _dispatch_lane_invoke + 448
23 libdispatch.dylib 0x0000000103c35adc _dispatch_workloop_worker_thread + 1324
24 libsystem_pthread.dylib 0x00000001b4d4af88 _pthread_wqthread + 276
25 libsystem_pthread.dylib 0x00000001b4d4dad4 start_wqthread + 8
2020-01-07 15:04:15.420197+0800 SimpleCam[11292:2714676] [reports] Main Thread Checker: UI API called on a background thread: -[UIView bounds]
PID: 11292, TID: 2714676, Thread name: (none), Queue name: com.sunsetlakesoftware.GPUImage.openGLESContextQueue, QoS: 0
Backtrace:
4 SimpleCam 0x0000000102e9a1d4 __39-[GPUImageView recalculateViewGeometry]_block_invoke + 56
5 SimpleCam 0x0000000102e738c8 runSynchronouslyOnVideoProcessingQueue + 104
6 SimpleCam 0x0000000102e9a17c -[GPUImageView recalculateViewGeometry] + 108
7 SimpleCam 0x0000000102e9ab78 __37-[GPUImageView setInputSize:atIndex:]_block_invoke + 312
8 SimpleCam 0x0000000102e738c8 runSynchronouslyOnVideoProcessingQueue + 104
9 SimpleCam 0x0000000102e9aa20 -[GPUImageView setInputSize:atIndex:] + 136
10 SimpleCam 0x0000000102e4cd5c -[GPUImageFilter informTargetsAboutNewFrameAtTime:] + 748
11 SimpleCam 0x0000000102e4ed94 -[GPUImageFilter newFrameReadyAtTime:atIndex:] + 216
12 SimpleCam 0x0000000102e4d048 -[GPUImageFilter informTargetsAboutNewFrameAtTime:] + 1496
13 SimpleCam 0x0000000102e4ed94 -[GPUImageFilter newFrameReadyAtTime:atIndex:] + 216
14 SimpleCam 0x0000000102e4d048 -[GPUImageFilter informTargetsAboutNewFrameAtTime:] + 1496
15 SimpleCam 0x0000000102e48a70 -[GPUImageCropFilter newFrameReadyAtTime:atIndex:] + 152
16 SimpleCam 0x0000000102e96590 -[GPUImageVideoCamera updateTargetsForVideoCameraUsingCacheTextureAtWidth:height:time:] + 1716
17 SimpleCam 0x0000000102e96e9c -[GPUImageVideoCamera processVideoSampleBuffer:] + 2124
18 SimpleCam 0x0000000102e97a58 __74-[GPUImageVideoCamera captureOutput:didOutputSampleBuffer:fromConnection:]_block_invoke + 176
19 libdispatch.dylib 0x0000000103c217fc _dispatch_call_block_and_release + 24
20 libdispatch.dylib 0x0000000103c22bd8 _dispatch_client_callout + 16
21 libdispatch.dylib 0x0000000103c29b48 _dispatch_lane_serial_drain + 744
22 libdispatch.dylib 0x0000000103c2a6e4 _dispatch_lane_invoke + 448
23 libdispatch.dylib 0x0000000103c35adc _dispatch_workloop_worker_thread + 1324
24 libsystem_pthread.dylib 0x00000001b4d4af88 _pthread_wqthread + 276
25 libsystem_pthread.dylib 0x00000001b4d4dad4 start_wqthread + 8

Main Thread Checker: UI API called on a background thread: -[UIView layer]
PID: 11292, TID: 2714676, Thread name: (none), Queue name: com.sunsetlakesoftware.GPUImage.openGLESContextQueue, QoS: 0
Backtrace:
4 SimpleCam 0x0000000102e99bf0 -[GPUImageView createDisplayFramebuffer] + 288
5 SimpleCam 0x0000000102e9a018 -[GPUImageView setDisplayFramebuffer] + 72
6 SimpleCam 0x0000000102e9a664 __44-[GPUImageView newFrameReadyAtTime:atIndex:]_block_invoke + 112
7 SimpleCam 0x0000000102e738c8 runSynchronouslyOnVideoProcessingQueue + 104
8 SimpleCam 0x0000000102e9a5d4 -[GPUImageView newFrameReadyAtTime:atIndex:] + 116
9 SimpleCam 0x0000000102e4d048 -[GPUImageFilter informTargetsAboutNewFrameAtTime:] + 1496
10 SimpleCam 0x0000000102e4ed94 -[GPUImageFilter newFrameReadyAtTime:atIndex:] + 216
11 SimpleCam 0x0000000102e4d048 -[GPUImageFilter informTargetsAboutNewFrameAtTime:] + 1496
12 SimpleCam 0x0000000102e4ed94 -[GPUImageFilter newFrameReadyAtTime:atIndex:] + 216
13 SimpleCam 0x0000000102e4d048 -[GPUImageFilter informTargetsAboutNewFrameAtTime:] + 1496
14 SimpleCam 0x0000000102e48a70 -[GPUImageCropFilter newFrameReadyAtTime:atIndex:] + 152
15 SimpleCam 0x0000000102e96590 -[GPUImageVideoCamera updateTargetsForVideoCameraUsingCacheTextureAtWidth:height:time:] + 1716
16 SimpleCam 0x0000000102e96e9c -[GPUImageVideoCamera processVideoSampleBuffer:] + 2124
17 SimpleCam 0x0000000102e97a58 __74-[GPUImageVideoCamera captureOutput:didOutputSampleBuffer:fromConnection:]_block_invoke + 176
18 libdispatch.dylib 0x0000000103c217fc _dispatch_call_block_and_release + 24
19 libdispatch.dylib 0x0000000103c22bd8 _dispatch_client_callout + 16
20 libdispatch.dylib 0x0000000103c29b48 _dispatch_lane_serial_drain + 744
21 libdispatch.dylib 0x0000000103c2a6e4 _dispatch_lane_invoke + 448
22 libdispatch.dylib 0x0000000103c35adc _dispatch_workloop_worker_thread + 1324
23 libsystem_pthread.dylib 0x00000001b4d4af88 _pthread_wqthread + 276
24 libsystem_pthread.dylib 0x00000001b4d4dad4 start_wqthread + 8
2020-01-07 15:04:26.491685+0800 SimpleCam[11292:2714676] [reports] Main Thread Checker: UI API called on a background thread: -[UIView layer]
PID: 11292, TID: 2714676, Thread name: (none), Queue name: com.sunsetlakesoftware.GPUImage.openGLESContextQueue, QoS: 0
Backtrace:
4 SimpleCam 0x0000000102e99bf0 -[GPUImageView createDisplayFramebuffer] + 288
5 SimpleCam 0x0000000102e9a018 -[GPUImageView setDisplayFramebuffer] + 72
6 SimpleCam 0x0000000102e9a664 __44-[GPUImageView newFrameReadyAtTime:atIndex:]_block_invoke + 112
7 SimpleCam 0x0000000102e738c8 runSynchronouslyOnVideoProcessingQueue + 104
8 SimpleCam 0x0000000102e9a5d4 -[GPUImageView newFrameReadyAtTime:atIndex:] + 116
9 SimpleCam 0x0000000102e4d048 -[GPUImageFilter informTargetsAboutNewFrameAtTime:] + 1496
10 SimpleCam 0x0000000102e4ed94 -[GPUImageFilter newFrameReadyAtTime:atIndex:] + 216
11 SimpleCam 0x0000000102e4d048 -[GPUImageFilter informTargetsAboutNewFrameAtTime:] + 1496
12 SimpleCam 0x0000000102e4ed94 -[GPUImageFilter newFrameReadyAtTime:atIndex:] + 216
13 SimpleCam 0x0000000102e4d048 -[GPUImageFilter informTargetsAboutNewFrameAtTime:] + 1496
14 SimpleCam 0x0000000102e48a70 -[GPUImageCropFilter newFrameReadyAtTime:atIndex:] + 152
15 SimpleCam 0x0000000102e96590 -[GPUImageVideoCamera updateTargetsForVideoCameraUsingCacheTextureAtWidth:height:time:] + 1716
16 SimpleCam 0x0000000102e96e9c -[GPUImageVideoCamera processVideoSampleBuffer:] + 2124
17 SimpleCam 0x0000000102e97a58 __74-[GPUImageVideoCamera captureOutput:didOutputSampleBuffer:fromConnection:]_block_invoke + 176
18 libdispatch.dylib 0x0000000103c217fc _dispatch_call_block_and_release + 24
19 libdispatch.dylib 0x0000000103c22bd8 _dispatch_client_callout + 16
20 libdispatch.dylib 0x0000000103c29b48 _dispatch_lane_serial_drain + 744
21 libdispatch.dylib 0x0000000103c2a6e4 _dispatch_lane_invoke + 448
22 libdispatch.dylib 0x0000000103c35adc _dispatch_workloop_worker_thread + 1324
23 libsystem_pthread.dylib 0x00000001b4d4af88 _pthread_wqthread + 276
24 libsystem_pthread.dylib 0x00000001b4d4dad4 start_wqthread + 8
2020-01-07 15:04:30.048897+0800 SimpleCam[11292:2714475] Can't end BackgroundTask: no background task exists with identifier 2 (0x2), or it may have already been ended. Break in UIApplicationEndBackgroundTaskError() to debug.

GPUImageTwoInputFilter

使用GPUImageTwoInputFilter,添加两个输入,后一个输入的大小无法根据自身宽高比自适应GPUImageView的大小. GPUImageTwoInputFilter中
[super newFrameReadyAtTime:passOnFrameTime atIndex:0]; // Bugfix when trying to record: always use time from first input (unless indefinite, in which case use the second input)。
使用GPUImageTwoPassFilter,可以根据自身宽高比自适应GPUImageView的大小,但是画面会闪烁。
请问下有什么好的解决方法么?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.