Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to compress the recored video in iPhone app
    primarykey
    data
    text
    <p>I have an iPhone app in which i am recording video and playing that video it works fine.But the file size which comes is huge 3MB for 30 seconds any idea or way to compress to the file here i want when compress button is clicked on Screen it should compress the recorded video.</p> <pre><code> Saved Video NSURL*videoURL = [info objectForKey:UIImagePickerControllerMediaURL]; NSLog(@"found a video"); videoData = [[NSData dataWithContentsOfURL:videoURL] retain]; NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSDateFormatter *dateFormat = [[[NSDateFormatter alloc] init] autorelease]; [dateFormat setDateFormat:@"dd-MM-yyyy_HH:mm:SS"]; NSDate *now = [[[NSDate alloc] init] autorelease]; NSDate* theDate = [dateFormat stringFromDate:now]; NSString*myDate=[dateFormat stringFromDate:theDate]; NSString *dataPath = [documentsDirectory stringByAppendingPathComponent:@"Default Album"]; if (![[NSFileManager defaultManager] fileExistsAtPath:dataPath]) [[NSFileManager defaultManager] createDirectoryAtPath:dataPath withIntermediateDirectories:NO attributes:nil error:nil]; NSString*test=@"test"; NSString*testUser=[test stringByReplacingOccurrencesOfString:@" " withString:@""]; videopath= [[[NSString alloc] initWithString:[NSString stringWithFormat:@"%@/%@.mp4",documentsDirectory,testUser]] autorelease]; BOOL success = [videoData writeToFile:videopath atomically:NO]; NSLog(@"Successs:::: %@", success ? @"YES" : @"NO"); NSLog(@"video path --&gt; %@",videopath); NSURL *movieURL = [NSURL fileURLWithPath:videopath]; AVURLAsset *avUrl = [AVURLAsset assetWithURL:movieURL]; CMTime time1 = [avUrl duration]; int seconds = ceil(time1.value/time1.timescale); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload