Re: [問題] 用QTKit從iSight上面擷取每一張畫面
※ 引述《ryanliang (暑假閒閒的大學生~~)》之銘言:
: ※ 引述《zonble (zonble)》之銘言:
: : QTMovie 有兩個 method
: : - (NSImage *)frameImageAtTime:(QTTime)time
: : - (void *)frameImageAtTime:(QTTime)time withAttributes:(NSDictionary *)attributes error:(NSError **)errorPtr
: : 這兩個 method 可以讓你在取得了一段 QuickTime movie 後
: : 根據時間把 NSImage 或其他的 Image 物件抽出來,不知道
: : 這是不是你想要的?
: Z大的意思是,
: 我先錄影片,錄完後在用QTMovie中的方法,
: 擷取某特定時間點的Frame,
: 是這意思嗎?
: 跟我原本的流程好像有點不大相同,
: 我是想在我按下錄影鍵後的每一張圖(Frame)都存在一個地方,
: 也就是說我不打算輸出成影片檔,
: 我要的是圖檔,
: 不過如果Z大說的方法如果可以找得出"每一張"圖(Frame)的話,
: 那倒也不是不可行,
: 感謝Z大!!
QTCaptureVideoPreviewOutput 有一個 delegate method
- (void)captureOutput:(QTCaptureOutput *)captureOutput
didOutputVideoFrame:(CVImageBufferRef)videoFrame
withSampleBuffer:(QTSampleBuffer *)sampleBuffer
fromConnection:(QTCaptureConnection *)connection
可以擷取 frame
QTCaptureDecompressedVideoOutput 也有一個 delegate method
- (void)captureOutput:(QTCaptureOutput *)captureOutput
didOutputVideoFrame:(CVImageBufferRef)videoFrame
withSampleBuffer:(QTSampleBuffer *)sampleBuffer
fromConnection:(QTCaptureConnection *)connection
可以擷取 frame
應該就是你要找的功能了吧
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 122.116.111.97
推
10/03 19:32, , 1F
10/03 19:32, 1F
→
10/03 19:33, , 2F
10/03 19:33, 2F
→
10/04 04:44, , 3F
10/04 04:44, 3F
→
10/04 04:45, , 4F
10/04 04:45, 4F
→
10/04 04:47, , 5F
10/04 04:47, 5F
→
10/04 04:49, , 6F
10/04 04:49, 6F
→
10/04 04:51, , 7F
10/04 04:51, 7F
推
10/04 12:05, , 8F
10/04 12:05, 8F
→
10/04 12:07, , 9F
10/04 12:07, 9F
→
10/04 12:08, , 10F
10/04 12:08, 10F
→
10/04 12:08, , 11F
10/04 12:08, 11F
討論串 (同標題文章)
MacDev 近期熱門文章
PTT數位生活區 即時熱門文章