This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func rgbData(_ frame: AVFrame) throws -> Data { | |
let dstPkt = AVPacket() | |
let dstFrame = AVFrame() | |
dstFrame.width = frame.width | |
dstFrame.height = frame.height | |
dstFrame.pixFmt = .RGB24 | |
let swsCtx = SwsContext( | |
srcW: frame.width, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// EncoderTest.swift | |
// | |
// | |
// Created by T | |
// Copyright © 2018 T. All rights reserved. | |
// | |
import VideoToolbox | |
import AVFoundation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// EncoderTest.swift | |
// | |
// | |
// Created by T | |
// Copyright © 2018 T. All rights reserved. | |
// | |
import VideoToolbox | |
import AVFoundation |