linphone-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Linphone-developers] Take snapshots of ongoing video


From: Patrick Lin
Subject: [Linphone-developers] Take snapshots of ongoing video
Date: Fri, 1 Aug 2014 11:22:21 +0800

Hello everyone,

I am working on a project based on Linphone-iPhone, the project requires taking a snapshot of current video streams (both in and out).

I've found linphone_call_take_video_snapshot() in liblinphone and gave it a try. The code was simple and running without any error, but the size of the saved file is always 0 kb!

Here's the code:


- (void)capture {
    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *documentsDirectory = [paths objectAtIndex:0];
    NSString *file_path = [documentsDirectory stringByAppendingPathComponent:@"snapshot.jpeg"];
    LinphoneCall *call = linphone_core_get_current_call([LinphoneManager getLc]);
    const char *c_file_path = [file_path cStringUsingEncoding:NSUTF8StringEncoding];
    int ret = linphone_call_take_video_snapshot(call, c_file_path);

    if (ret >= 0 && [[NSFileManager defaultManager] fileExistsAtPath:file_path]) {
        UIImageWriteToSavedPhotosAlbum([UIImage imageWithContentsOfFile:file_path], nil,nil,nil);
    }
}

Have anyone successfully captured image with linphone_call_take_video_snapshot before? What have I been doing wrong?

Any suggestion would be appreciated!

Best regards,
Patrick

reply via email to

[Prev in Thread] Current Thread [Next in Thread]