VLCkit configure buffering/caching

iOS, iPad, iPhone, tvOS specific usage questions
kiran_geon
New Cone
New Cone
Posts: 2
Joined: 22 Jan 2016 06:05

VLCkit configure buffering/caching

Postby kiran_geon » 29 Jan 2016 04:52

I am trying to use vlckit to display an RTSP stream. I could see that the display is flickering. My guess is that I haven't set enough caching/buffering. I know how to do this in desktop VLC. But how can I do this in vlckit? I could not find the API to configure this in vlckit. Please help.

ssbmaccom
Cone that earned his stripes
Cone that earned his stripes
Posts: 184
Joined: 26 Nov 2015 15:21
Operating System: Mac OS, iOS, tvOS

Re: VLCkit configure buffering/caching

Postby ssbmaccom » 31 Jan 2016 02:31

What I found so far is, that you can init the mediaplayer with options. What I have seen in the sources of VLCKit is, that the options parameter expects an NSArray <NSString *> * argument, so an NSArray of NSStrings.
There is also a default array of options, that indicate, that it simply uses the same options as you would use on VLC command line.
Unfortunately it is not possible to get this default array (private method) to add or change these default options.
But you can copy the settings from VLCLibrary.m:

Code: Select all

- (NSArray *)_defaultOptions { NSArray *vlcParams = [[NSUserDefaults standardUserDefaults] objectForKey:@"VLCParams"]; #if TARGET_OS_IPHONE if (!vlcParams) { vlcParams = @[@"--no-color", @"--no-osd", @"--no-video-title-show", @"--no-stats", @"--no-snapshot-preview", #ifndef NOSCARYCODECS @"--avcodec-fast", #endif @"--text-renderer=freetype", @"--avi-index=3", @"--extraintf=ios_dialog_provider"]; } #else if (!vlcParams) { NSMutableArray *defaultParams = [NSMutableArray array]; [defaultParams addObject:@"--play-and-pause"]; // We want every movie to pause instead of stopping at eof [defaultParams addObject:@"--no-color"]; // Don't use color in output (Xcode doesn't show it) [defaultParams addObject:@"--no-video-title-show"]; // Don't show the title on overlay when starting to play [defaultParams addObject:@"--verbose=4"]; // Let's not wreck the logs [defaultParams addObject:@"--no-sout-keep"]; [defaultParams addObject:@"--vout=macosx"]; // Select Mac OS X video output [defaultParams addObject:@"--text-renderer=freetype"]; [defaultParams addObject:@"--extraintf=macosx_dialog_provider"]; // Some extra dialog (login, progress) may come up from here [[NSUserDefaults standardUserDefaults] setObject:defaultParams forKey:@"VLCParams"]; [[NSUserDefaults standardUserDefaults] synchronize]; vlcParams = defaultParams; } #endif return vlcParams; }
As you see, the options are written to the NSUserDefaults, where you can also read or set them from Settings or from your application before initing LibVLC through VLCKit. The NSArray with the NSStrings is written to the key @"VCLParams".

Both ways should work.


Return to “VLC for iOS, iPadOS and Apple TV”

Who is online

Users browsing this forum: No registered users and 15 guests