Page 1 of 1

how to take snapshot on iOS

Posted: 09 Dec 2013 08:26
by lawrie
I want to take snapshot on iOS, I have found the method

Code: Select all

- (void)saveVideoSnapshotAt: (NSString *)path withWidth:(NSUInteger)width andHeight:(NSUInteger)height;
here is my codes:

Code: Select all

NSString *desPath = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) lastObject]; NSString *des = [desPath stringByAppendingPathComponent:@"lty.png"]; [_mediaPlayer saveVideoSnapshotAt:des withWidth:0 andHeight:0];
but I got the error:
[0xd445870] main video output error: Encoding support not compiled-in!
[0xd445870] main video output error: Failed to convert image for snapshot

Could anyone help me fix this problem?
Thanks a lot!

Re: how to take snapshot on iOS

Posted: 09 Dec 2013 18:31
by Jean-Baptiste Kempf
You need to recompile with streaming output.

Re: how to take snapshot on iOS

Posted: 10 Dec 2013 02:38
by lawrie
You need to recompile with streaming output.

How to recompile with streaming output, could you describe in detail?

In my project, I just link with the libraries:"libMediaLibraryKit.a" and "libMobileVLCKit.a", then do my custom.

Thank you!

Re: how to take snapshot on iOS

Posted: 10 Dec 2013 11:25
by Jean-Baptiste Kempf
Sorry, no I can't. It's hard.

Re: how to take snapshot on iOS

Posted: 12 Dec 2013 07:33
by lawrie
thank you anyway

Re: how to take snapshot on iOS

Posted: 14 May 2015 05:42
by mark1991
did you fix this problem?

Re: how to take snapshot on iOS

Posted: 14 May 2015 05:42
by mark1991
did you fix this problem?

Re: how to take snapshot on iOS

Posted: 14 May 2015 11:32
by mark1991
You need to recompile with streaming output.
my code :

NSString *desPath = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) lastObject];
NSString *des = [desPath stringByAppendingPathComponent:@"lty.png"];
NSLog(@"%@",des);
[_mediaPlayer saveVideoSnapshotAt:des withWidth:0 andHeight:0];

but it is not ok
the log:shader program 1: WARNING: Output of vertex shader 'TexCoord1' not read by fragment shader
WARNING: Output of vertex shader 'TexCoord2' not read by fragment shader


do you know the reason please hep me please

Re: how to take snapshot on iOS

Posted: 15 May 2015 09:04
by dfuhrmann
Again: We know the reason but this is not easy to fix. I do not know exactly why this method is there already, but do not expect a working version from us soon.

Re: how to take snapshot on iOS

Posted: 15 May 2015 14:12
by fkuehne
This method is OS X only. While it is exposed on iOS (what it should not be, I agree), it won't work on mobile devices.