小编Muh*_*aza的帖子

MobileVLCKit音频正在运行,视频无法正常工作

我正在使用xcode 7.2也在xcode 6.4(Swift)中使用它同样的问题

我正在使用MobileVLCKit的cocoapod http://cocoadocs.org/docsets/MobileVLCKit/2.2.1/index.html

我在控制台中得到这个:

2015-12-22 18:17:01.296 test11[3626:79386] creating player instance using shared library
[00007ff3d0d850f8] core generic error: option marq-color does not exist
[00007ff3d0d850f8] core generic error: option marq-opacity does not exist
[00007ff3d0d850f8] core generic error: option marq-position does not exist
[00007ff3d0d850f8] core generic error: option marq-refresh does not exist
[00007ff3d0d850f8] core generic error: option marq-size does not exist
[00007ff3d0d850f8] core generic error: option marq-timeout does not exist
[00007ff3d0d850f8] core generic error: option marq-x does not exist
[00007ff3d0d850f8] core …
Run Code Online (Sandbox Code Playgroud)

vlc rtmp ios swift

5
推荐指数
0
解决办法
1344
查看次数

从视频中提取图像,图像颜色变化迅速

我使用AVCaptureSession会话预设捕获视频是

session!.sessionPreset = AVCaptureSessionPreset1280x720
Run Code Online (Sandbox Code Playgroud)

并使用此代码从视频中提取图像

func videoThumbnails(url: NSURL ){
    let asset = AVAsset(URL: url)
    let imageGenerator = AVAssetImageGenerator(asset: asset)
    imageGenerator.appliesPreferredTrackTransform = true
    imageGenerator.maximumSize = CGSizeMake(720, 1280)
    imageGenerator.requestedTimeToleranceAfter = kCMTimeZero

    var time = asset.duration
    let totalTime = time
    var frames = 0.0
    let singleFrame = Double(time.seconds) / 4
    while (frames < totalTime.seconds) {
        frames += singleFrame
        time.value = (Int64(frames)) * Int64(totalTime.timescale)
        do {

            let imageRef = try imageGenerator.copyCGImageAtTime(time, actualTime: nil)

            self.sendImage.append(UIImage(CGImage: imageRef))
        }
        catch let error as NSError
        { …
Run Code Online (Sandbox Code Playgroud)

avfoundation ios avcapturesession avassetimagegenerator swift

5
推荐指数
0
解决办法
335
查看次数

从视频AVFoundation中提取音频

func extractAudioFromVideo(videoUrl:NSURL, audioPath:String){
    //2
    var asset = AVURLAsset(URL: videoUrl, options: nil)
    asset.loadValuesAsynchronouslyForKeys(NSArray(object: "tracks") as [AnyObject], completionHandler: { () -> Void in
        var audioTrack = asset.tracksWithMediaType(AVMediaTypeAudio)[0] as! AVAssetTrack

        var audioComposition = AVMutableComposition()

        var audioCompositionTrack:AVMutableCompositionTrack!

        audioCompositionTrack = audioComposition.addMutableTrackWithMediaType(AVMediaTypeAudio, preferredTrackID: CMPersistentTrackID())
        audioCompositionTrack.insertTimeRange(audioTrack.timeRange, ofTrack: audioTrack, atTime: CMTimeMake(0, 1), error: nil)

        var exportSession = AVAssetExportSession(asset: audioComposition, presetName: AVAssetExportPresetAppleM4A)
        var toFileUrl = NSURL(fileURLWithPath: audioPath)

        exportSession.outputURL = toFileUrl
        exportSession.outputFileType = "com.apple.m4a-audio"

        exportSession.exportAsynchronouslyWithCompletionHandler({ () -> Void in
            if exportSession.status == AVAssetExportSessionStatus.Completed {
                println("Succes")
            }else{
                println("not working")
            }
        }) …
Run Code Online (Sandbox Code Playgroud)

avfoundation ios swift

3
推荐指数
2
解决办法
4182
查看次数

UIView初始化程序swift Xcode 6 beta 5

xcode 6 beta 5

错误:

类'ClassName'不实现其超类的必需成员

    class ClassName:UIView
Run Code Online (Sandbox Code Playgroud)

也显示错误

        init(frame: CGRect) {
            super.init(frame: frame)
            // Initialization code
            self.backgroundColor = UIColor.clearColor()
        }
Run Code Online (Sandbox Code Playgroud)

覆盖声明需要'ovveride'关键字

我在init之前放置了覆盖,删除了ovveride错误但是没有超类错误

提前致谢

ios swift xcode6

2
推荐指数
1
解决办法
4331
查看次数