我正在开发一个功能上的视频压缩; 我的想法如下:
我有几个问题:
我尝试下面的代码压缩视频,但我不知道它压缩到哪个分辨率:
- (void)convertVideoToLowQuailtyWithInputURL:(NSURL*)inputURL
outputURL:(NSURL*)outputURL
handler:(void (^)(AVAssetExportSession*))handler
{
[[NSFileManager defaultManager] removeItemAtURL:outputURL error:nil];
AVURLAsset *urlAsset = [AVURLAsset URLAssetWithURL:inputURL options:nil];
AVAssetExportSession *session = [[AVAssetExportSession alloc] initWithAsset: urlAsset presetName:AVAssetExportPresetLowQuality];
session.outputURL = outputURL;
session.outputFileType = AVFileTypeQuickTimeMovie;
[session exportAsynchronouslyWithCompletionHandler:^(void)
{
handler(session);
}];
}
Run Code Online (Sandbox Code Playgroud)
请给我一些建议.提前致谢.
我是Core Bluetooth LE的新手.现在我想在配对成功后得到外围设备的MAC地址.据我所知,配对后将返回UUID,名称和RSSI,我没有看到MAC地址.所以我可以这样做吗?任何帮助或答案将不胜感激.提前致谢.
我想在滚动时禁用重新加载表视图。现在,当用户滚动 uitableview 时,我的应用程序cellForRowAtIndexPath已被召回。如何在 srcolling 时禁用它?请给我一些建议。提前致谢。
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
NSString *CellIdentifier = [NSString stringWithFormat:@"%d,%d",indexPath.section,indexPath.row];
UITableViewCell *cell = [_tableView dequeueReusableCellWithIdentifier:CellIdentifier];
UILabel *FileNameLabel;
UILabel *UploadTimeLabel;
if (cell == nil)
{
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
CFileNameLabel = [[UILabel alloc] initWithFrame:CGRectMake(40, 0, 130, 30)];
UploadTimeLabel = [[UILabel alloc] initWithFrame:CGRectMake(40, 20, 130, 25)];
FileNameLabel.tag = 1000;
FileNameLabel.backgroundColor = [UIColor clearColor];
FileNameLabel.font = [UIFont fontWithName:@"Helvetica" size:14];
FileNameLabel.font = [UIFont boldSystemFontOfSize:14];
FileNameLabel.textColor = [UIColor blackColor];
// FileNameLabel.text =[temp objectAtIndex:indexPath.row]; …Run Code Online (Sandbox Code Playgroud) 我想在ios中创建随机AES加密密钥(128位).我搜索过但我找不到一个好的答案.请给我一些建议.提前致谢.
更新:
我用过BBAES lib.我使用下面的代码生成加密密钥,但是当我从NSData转换为NSString时,它显示为NULL
-(NSData*)randomDataWithLength{
NSData* salt = [BBAES randomDataWithLength:BBAESSaltDefaultLength];
NSData *key = [BBAES keyBySaltingPassword:@"password" salt:salt keySize:BBAESKeySize128 numberOfIterations:BBAESPBKDF2DefaultIterationsCount];
NSLog(@"Data ASE Key %@",key);
NSString *aString = [[NSString alloc] initWithData:key encoding:NSUTF8StringEncoding];
}
Run Code Online (Sandbox Code Playgroud)