Size of QTMovie file right after its creation differs on intel and power PC platform
Size of QTMovie file right after its creation differs on intel and power PC platform
- Subject: Size of QTMovie file right after its creation differs on intel and power PC platform
- From: "Pascal Vuylsteker" <email@hidden>
- Date: Mon, 4 Jun 2007 19:33:46 +0200
I initially posted the following question on the Quicktime mailing,
but after reflexion, I am starting to wonder if my issue is more
NSFilemanager related than QTKit.
So here it it is, and sorry for those of you who are on both lists.
I open a media into a QTMovie, then I write it (writeToFile) with
QTMovieFlatten set to YES.
After checking that it had been appropriately written, I look at he
written file size trough an NSFileManager ...
And here is the trick : when I run the programme on an intel machine,
I get the correct size, but when I run it on a powerPC machine, I get
a size of 0 !
Is that a well known bug, or did I missed something ?
Here is my code :
movieExtract = [[QTMovie alloc] initWithMovie:movie
timeRange:extractRange error:nil];
NSDictionary *savedMovieAttributes = [NSDictionary
dictionaryWithObject:[NSNumber numberWithBool:YES]
forKey:QTMovieFlatten];
if([movieExtract writeToFile:moviePath withAttributes:savedMovieAttributes]) {
sleep(1);
[aFileHandle writeData:[@"file creation ends\n"
dataUsingEncoding:NSASCIIStringEncoding]];
NSFileManager * fm = [NSFileManager defaultManager];
NSDictionary *fattrs = [fm fileAttributesAtPath:moviePath
traverseLink:NO];
unsigned long long size;
size = [[fattrs objectForKey:NSFileSize] unsignedLongLongValue];
NSLog(@"Size of the produced file %@ : %u", moviePath, size);
[[NSString stringWithFormat:@"%u",size] writeToFile:log_for_file_size
atomically:NO encoding:NSASCIIStringEncoding error:nil];
}
else {
[aFileHandle writeData:[[NSString stringWithFormat: @"Erreur: Bug
when writing the QuickTime Ref file %@\n",
moviePath] dataUsingEncoding:NSASCIIStringEncoding]];
}
--
Pascal Vuylsteker - consultant Opsomai
---
Mob: 06 89 98 31 38 | Tel: +33 (0)1 58 39 38 26 | Fax: +33 (0)1 43 70 70 72
eWork: email@hidden
eHome: email@hidden | callto://pascalpvk
gmail talk : email@hidden
---
Work: http://www.opsomai.com/
CV: http://www.vuylsteker.net/CV/index.fr.html
Contacts:vCard (3.0): http://www.vuylsteker.net/Pascal_Vuylsteker.vcf
Professional sphere: http://www.vrarchitect.net/
LinkedIn: http://www.linkedin.com/in/pascalv
Bookmarks: http://del.icio.us/pvk
Work sphere: http://escience.anu.edu.au/
Personal sphere: http://www.vuylsteker.net/
Photos: http://www.flickr.com/photos/pvk/
Blog: http://blog.vrarchitect.net/
Plazes: http://beta.plazes.com/whereis/pvk
---
La seule révolution possible, c'est d'essayer de s'améliorer soi-même,
en espérant que les autres fassent la même démarche.
Le monde ira mieux alors. [ Georges Brassens ]
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden